Class: Fontcustom::CLI
- Inherits:
-
Thor
- Object
- Thor
- Fontcustom::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/fontcustom/cli.rb
Class Method Summary collapse
-
.source_root ⇒ Object
Required for Thor::Actions#template.
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
Required for Thor::Actions#template
22 23 24 |
# File 'lib/fontcustom/cli.rb', line 22 def self.source_root File.join Fontcustom::Util.gem_lib_path, "templates" end |
Instance Method Details
#compile(input) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/fontcustom/cli.rb', line 27 def compile(input) opts = .merge :input => input opts = Fontcustom::Util. opts Fontcustom::Generator::Font.start [opts] Fontcustom::Generator::Template.start [opts] rescue Fontcustom::Error => e puts "ERROR: #{e.message}" end |
#config(input) ⇒ Object
47 48 49 |
# File 'lib/fontcustom/cli.rb', line 47 def config(input) template "fontcustom.yml", File.join(input, "fontcustom.yml") end |
#version ⇒ Object
52 53 54 |
# File 'lib/fontcustom/cli.rb', line 52 def version puts "fontcustom-#{Fontcustom::VERSION}" end |
#watch(input) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/fontcustom/cli.rb', line 38 def watch(input) opts = .merge :input => input, :skip_first => !! [:skip_first] opts = Fontcustom::Util. opts Fontcustom::Watcher.new(opts).watch rescue Fontcustom::Error => e puts "ERROR: #{e.message}" end |