Class: Bowndler::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bowndler/cli.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



26
27
28
29
# File 'lib/bowndler/cli.rb', line 26

def method_missing(method_name, *args, &block)
  invoke :bower_configure, []
  exec "bower #{method_name} #{args.join(' ')}"
end

Instance Method Details

#autohookObject



18
19
20
21
22
23
24
# File 'lib/bowndler/cli.rb', line 18

def autohook
  gemfile = options.include?(:gemfile) ?
    File.expand_path(options[:gemfile]) :
    Bundler.default_gemfile

  Commands::Autohook.new(gemfile).call
end

#bower_configureObject



8
9
10
11
12
13
14
# File 'lib/bowndler/cli.rb', line 8

def bower_configure
  template_path = options.include?(:template) ?
    File.expand_path(options[:template]) :
    Bundler.default_gemfile.dirname.join('bower.json.erb')

  Commands::RecursiveBowerConfigure.new(template_path).call
end