I started to venture into the rubygems world. I am developing a gem to generate the assets of my twitter bootstrap-style application, since I intend to reuse my front-end code. All I need to do is put the assets in the correct places, add some helpers and make some settings. Several gems that work that way make additions to the application.js / .css file at the time of installation. For example, the bootstrap, when the rails g bootstrap:install
command is executed, the assets are transferred to the proper path and a require is automatically added to the application.css and the application.js.
I want to do something similar, except at a specific point in the application.rb file. To be more exact, what I want is to add more folders to the assets path. The file looks something like this:
class Application < Rails::Application
end
I need it to look like this:
class Application < Rails::Application
config.assets.paths << 'path/para/a/pasta'
end
But how would I ensure that this content will always be added within the class definition? I mean, simply making additions to the file is simple, but in that case I can not add outside the scope of the class.