Skip to content
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

Byte calculations do not work (x.megabytes, x.gigabytes, etc) #19

Closed
uberllama opened this issue Aug 10, 2011 · 7 comments
Closed

Byte calculations do not work (x.megabytes, x.gigabytes, etc) #19

uberllama opened this issue Aug 10, 2011 · 7 comments
Labels
Milestone

Comments

@uberllama
Copy link

I tried to implement a settings as follows:
threshold: <%=10.megabytes%>
max: <%=1.gigabyte%>

...but it doesn't seem to be supported. Not using ERB tags results in a string.

@johnantoni
Copy link

if the config file is in yaml format then this shouldn't be possible as i don't think you can do interpretations in yaml, just a flat file.

could always be wrong

@pkuczynski pkuczynski added this to the 1.0 milestone Mar 31, 2014
@pkuczynski pkuczynski added the bug label Mar 31, 2014
@pkuczynski pkuczynski modified the milestone: 1.0 May 12, 2016
@pkuczynski pkuczynski added feature and removed bug labels May 12, 2016
@pkuczynski pkuczynski added this to the 1.3 milestone May 12, 2016
@pkuczynski pkuczynski modified the milestones: 1.4, 1.6.0 Oct 23, 2017
@pkuczynski pkuczynski modified the milestones: 1.6.0, 1.6.1, 1.6.2 Nov 3, 2017
@pkuczynski pkuczynski modified the milestones: 1.7.0, 1.7.1 Feb 9, 2018
@pkuczynski pkuczynski removed this from the 1.7.1 milestone Jun 19, 2019
@pkuczynski
Copy link
Member

@rdubya could we pass YAML file trough ruby engine before loading it? This could be a nice feature, what you think?

@pkuczynski pkuczynski added this to the 2.0.1 milestone Jun 28, 2019
@rdubya
Copy link
Contributor

rdubya commented Jul 1, 2019

Doesn't it already get ran through ERB? Seems like this is an issue with dependencies not being loaded since those methods come from ActiveSupport iirc

@supremebeing7
Copy link
Contributor

This already seems to work on 2.0.0, I just verified. Since this issue was filed 8 years ago, maybe @uberllama's version didn't support ERB?
However, I did run into a different issue that may be related: max and min appear to be reserved words and will behave unexpectedly.

settings_group:
  max: "max"
  min: "min"
  other: "other"
> Settings.settings_group.max
=> [:other, "other"]
> Settings.settings_group.min
=> [:max, "max"]
> Settings.settings_group.other
=> "other"

I'm going to file a separate issue for that, but seems like this issue can be closed.

@supremebeing7
Copy link
Contributor

#234

@uberllama
Copy link
Author

I can't remember what I had for breakfast this morning, let alone what bugs I had 8 years ago. 😂

@pkuczynski
Copy link
Member

Hahaha, indeed :) Haven't noticed it's so old :) I will close this one and look into #234 separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants