Class: Geri::CLI::Extension

Inherits:
Thor
  • Object
show all
Includes:
Rails::Generators::Actions, Thor::Actions
Defined in:
lib/geri/cli/extension.rb

Instance Method Summary collapse

Instance Method Details

#install(name) ⇒ Object



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

def install(name)
  extname = 'geri'
  extname << "_#{name}" unless name == 'geri'
  script = %Q{bundle exec rails runner -c 'puts Gem::Specification.find_by_name("#{extname}").gem_dir'}
  gemdir = run script, capture: true, verbose: false
  load("#{gemdir.strip}/installer.rb")
  "#{extname.gsub('_', '/').classify}::Installer".constantize.start(name)
end