-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parsing of ENV variable values to Boolean type #180
Add parsing of ENV variable values to Boolean type #180
Conversation
4ac4517
to
d89ed7c
Compare
@pkuczynski I can eliminate the CodeClimate issue by taking the logic from |
Monkey-patch config gem per rubyconfig/config#180
…ypatch Update Gemfile to point at rubyconfig/config#180 branch for config gem
I would rather see this done as: # Try to convert string to a correct type
def __value(v)
case value
when 'false'
false
when 'true'
true
else
Integer(v) rescue Float(v) rescue v
end
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dig the modification you made. I believe there may be a typo in it.
lib/config/options.rb
Outdated
@@ -188,7 +188,14 @@ def __convert(h) #:nodoc: | |||
|
|||
# Try to convert string to a correct type | |||
def __value(v) | |||
Integer(v) rescue Float(v) rescue v | |||
case value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/value/v/
here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, totally! sorry!
0eb432e
to
36bb485
Compare
@pkuczynski I fixed a typo in the change you submitted, squashed commits, and pushed again. Thanks for the change! I suspect this is now ready to go. When do you think 1.6.0 can get released with this change? |
Done! Released as |
Thanks for your contributiuon :) |
Thanks for the useful gem, @pkuczynski! |
Monkey-patch config gem per rubyconfig/config#180
…ypatch Update Gemfile to point at rubyconfig/config#180 branch for config gem
Fixes #178
(Discovered in samvera/hyku#1462. Heads-up, @tdonohue.)