-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Allow symbol value via ENV #286
Comments
I don't think its related to #194. They actually wanted something opposite to your case. Env vars are string and I don't think we should force conversion to symbols. However we could implement a logic where strings staring from If you are interested, maybe you can fire up a PR? |
@khoan are you interested in firing up PR for this? |
I always get Symbol |
@manjunath724 If I understand the feature request correctly, this can be replicated with the following spec: diff --git a/spec/config_env_spec.rb b/spec/config_env_spec.rb
index 65e7da8..5f91def 100644
--- a/spec/config_env_spec.rb
+++ b/spec/config_env_spec.rb
@@ -77,6 +77,12 @@ describe Config::Options do
expect(config.new_var.is_a? Float).to eq(true)
end
+ it 'should recognize strings starting with : as symbols' do
+ ENV['Settings.new_var'] = ':hello'
+
+ expect(config.new_var).to eq(:hello)
+ end
+
it 'should leave strings intact' do
ENV['Settings.new_var'] = 'foobar'
Execute
And you'll get this result
|
@cjlarose Thanks, I have opened a PR, please take a look at it. |
Setup
maybe related to issue#194? Thanks.
The text was updated successfully, but these errors were encountered: