Class: SvgSprite::CLI
- Inherits:
-
Thor
- Object
- Thor
- SvgSprite::CLI
- Defined in:
- lib/svg_sprite/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
5 6 7 |
# File 'lib/svg_sprite/cli.rb', line 5 def self.exit_on_failure? true end |
.formats ⇒ Object
9 10 11 |
# File 'lib/svg_sprite/cli.rb', line 9 def self.formats TEMPLATES.keys end |
Instance Method Details
#generate ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/svg_sprite/cli.rb', line 25 def generate format = ["format"] || File.extname(["output"])[1..-1] fail Error, "ERROR: invalid output format. Must be one of #{formats.join("|")}." unless valid_format?(format) SvgSprite.export( source: File.(["source"]), output: File.(["output"]), format: format, name: ["name"] ) end |