Class: Jammit::CLI
- Inherits:
-
Thor
- Object
- Thor
- Jammit::CLI
- Defined in:
- lib/jammit-core/cli.rb
Constant Summary collapse
- ARGV =
::ARGV.dup
Instance Method Summary collapse
- #build(package = :all, *params) ⇒ Object
- #config(cmd, *params) ⇒ Object
- #init ⇒ Object
-
#initialize(args = ARGV, options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(args = ARGV, options = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/jammit-core/cli.rb', line 31 def initialize(args=ARGV, ={}, config={}) Jammit.ui = UI::Shell.new(shell) super #@options = { # :config_path => Jammit::DEFAULT_CONFIG_PATH, # :output_folder => nil, # :base_url => nil, # :force => false #} if .kind_of? Hash Jammit. = end #Jammit.packager.force = @options[:force] #Jammit.packager.precache_all(@options[:output_folder], @options[:base_url]) end |
Instance Method Details
#build(package = :all, *params) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jammit-core/cli.rb', line 19 def build(package = :all, *params) package = package.to_s case package when "all" Jammit.packager.force = true #Jammit.configuration[:force] Jammit.packager.precache_all(Jammit.config[:output_folder], Jammit.config[:base_url]) else Jammit.packager.force = true Jammit.packager.precache(package, Jammit.config[:output_folder], Jammit.config[:base_url]) end end |