Class: Tumbler::Cli

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/tumbler/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



7
# File 'lib/tumbler/cli.rb', line 7

def self.banner; "tumbler name [options]"; end

Instance Method Details

#setup_gemObject



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

def setup_gem
  path = File.join options[:root], name
  case
  when options[:update] then Tumbler::Updater.new(path, options).update
  when File.exist?(path) then raise("Directory path #{path} already exists!")
  else FileUtils.mkdir_p(path) ; Tumbler::Generate.app(path, name, options).write
  end
  say "Gem #{name} successfully generated!", :green
end