-
Notifications
You must be signed in to change notification settings - Fork 109
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 global configuration from Ruby #36
Comments
Please look at #31 by @bencrouse it allows to set options for image_optim in rails app config, it is already merged, but not yet released. |
You could write your own config/image_optim.yml and do something like this to load it: IMAGE_OPTIM_CONFIG = YAML.load_file(Rails.root.join('config', 'image_optim.yml')[Rails.env]
config.assets.image_optim = IMAGE_OPTIM_CONFIG and then where ever else you wanted to use image_optim... io = ImageOptim.new(IMAGE_OPTIM_CONFIG) |
@bencrouse , thanks for your suggestion, I will use it from now. I would still be in favor of adding this directly in this gem in order to avoid having to specify default option everywhere we use |
I think ideally, I'd like to see a
I may take a stab at it if @toy likes the idea and I have some free dev time this week. |
@bencrouse , seems like a perfect answer to my needs. |
@bencrouse @bobbus Better to put it into |
+1 for rails initializer idea |
Actually, the only way to set global config for
image_optim
is to write them in a.yml
file.For our Rails application, this is not really practical and we would like to make it possible to set them in an initializer or application config.
Does it seems like a useful feature ? If so, I can try to write a PR implementing this.
The text was updated successfully, but these errors were encountered: