ProvideAssets
Gem to test how to provide assets through an Engine.
Aim : detect issues with sprockets.
Installation
Add this line to your application's Gemfile:
gem 'provide_assets'
And then execute:
$ bundle
Or install it yourself as:
$ gem install provide_assets
If you want the JS include to work, you must provide jquery in your application :
- In Gemfile :
gem 'jquery-rails'
- In a JS manifest :
//= require jquery
//= require jquery_ujs
Usage
You can test the gem without an external application, lauch the Dummy application :
cd test/dummy
rails server
Then go to the root of the application in your web browser.
The page displayed should include shared assets (if sharing of assets works !) :
- An image.
- Some css.
- A javascript piece of code.
Technical informations
- Assets paths added dynamically with an Engine configuration :
Rails.application.config.assets.precompile += %w(
provide_assets/manifest.js
)
- Assets sub-paths added in plugin assets configuration file (manifest.js) :
link_tree ../../images/provide_assets
link_tree ../../stylesheets/provide_assets
link_tree ../../javascripts/provide_assets
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Ennder/provide_assets.
License
The gem is available as open source under the terms of the MIT License.