Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to #31
This PR moves the gem's asset files to
vendor/assets
and refactors most of its code, making its API more powerful.Assets now reside in
vendor/assets/gemojione
This makes loading the files into Rails' asset pipeline a lot easier as it is already searching in the corresponding gem directories.
This change also includes a new helper method to add the correct paths to the precompile list:
The stylesheet can now be
@import
ed directly through the asset pipeline without any configurationReplaced class attributes with an actual configuration object
Gemojione.configuration
now returns a configuration object which may be used to customize the gem's workings.This cleans the
Gemojione
module of these additional methods and makes testing the configuration itself a bit easier.The API methods accept configuration options
It is still possible to specify whether to use sprites or the requested image format through the global configuration, but now these options may also be specified directly within the Gemojione API call:
The fallback value here is always the global configuration.
Rails' asset_url method is used when available
The
ApplicationController.helpers
proxy is used if it's available. This makes the URL generation for assets within the asset pipeline easier than having the developer to manually specify the URL components, including the host.Regarding this, I noticed that the SCSS file contains the
image-path
helper. As far as I know, this means, that sprockets is a dependency when using this file, this should be mentioned in the README.@jonathanwiesel This is still a WIP, I just wanted to keep you updated (it's been a long time again, sorry).
I'm trying to keep the Gem as separated from Rails as possible, though I'm guessing that it will be mainly used in Rails applications.
Still TODO:
Gemojione
moduleIndex
refactoring