hlascelles / figjam Goto Github PK
View Code? Open in Web Editor NEWENV configuration for ruby using yaml files
License: MIT License
ENV configuration for ruby using yaml files
License: MIT License
We currently have all private methods below one keyword saying "private".
This issue is to change all the private methods to be individually marked with the private keyword instead.
For example, change:
private
def foo
end
def bar
end
To:
private def foo
end
private def bar
end
All ENV keys should be in UPPERCASE.
Psych 4 (the default packaged with Ruby 3.0.1) uses safe_load
by default, which does not support aliases. This causes an error when trying to load an application.yml
that does use aliases. Rails 7 has adopted a simple patch to workaround this issue, since figjam calls YAML.load
I think it should use the same workaround to support Psych 4.
With the following application.yml
:
default: &default
MY_SETTING: "my_value"
test:
<<: *default
production:
<<: *default
the following simple script fails:
require 'figjam'
p Figjam::Application.new(environment: :production, path: "application.yml").load
with
/Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:430:in `visit_Psych_Nodes_Alias': Unknown alias: default (Psych::BadAlias)
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych.rb:334:in `safe_load'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/3.1.0/psych.rb:369:in `load'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:65:in `parse'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:61:in `block in raw_configuration'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:61:in `raw_configuration'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:69:in `global_configuration'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:37:in `configuration'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:47:in `each'
from /Users/owenstephens/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/figjam-1.5.0/lib/figjam/application.rb:41:in `load'
```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.