Class: Mogu::GemCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/mogu/gem_command.rb

Instance Method Summary collapse

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mogu/gem_command.rb', line 10

def run
  erb = ERB.new File.read(File.expand_path('templates/gem.erb', __dir__.to_s))
  template = Tempfile.new

  gems = ask_gems
  template.write erb.result_with_hash(gems: gems)
  template.rewind

  ENV.store 'LOCATION', template.path

  Rails::Command.invoke 'app:template'
end