Add exclude argument to SpriteFactory config #48
Merged
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.
Added an 'exclude' argument to the SpriteFactory class.
All image names within the target directory will be checked against the exclusion array, and images whose name match, or contain, elements from within the exclusion array will not be included in the sprite or stylesheet.
See tests for further details and for an example.
Use Cases:
User wishes to generate a sprite that contains only a sub-set of the images contained within the target folder. The user makes use of the :exclude argument to exclude certain unused images from the generated sprite. The sprite generated is smaller in size, hopefully resulting in faster load times. Unused images can be left in the target folder until they are needed, but won't bloat the sprite.
User wishes to create a sprite where the target folder matches the output folder. For instance the target folder is the Images/Icons folder, and the output target is Images/Icons/Icons.png. By using the :exclude => "Icons.png" argument future sf commands will not include the existing sprite in the newer sprite.