Class: Grape::App::CLI::Builder

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/grape/app/cli.rb', line 10

def self.source_root
  File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#copy_templatesObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/grape/app/cli.rb', line 14

def copy_templates
  prefix = File.join(self.class.source_root, "")

  Dir[File.join(self.class.source_root, '**', '*')].each do |file|
    next if File.directory?(file)

    file.sub! prefix, ""
    copy_file file, File.join(name, file)
  end
end

#init_libObject



25
26
27
# File 'lib/grape/app/cli.rb', line 25

def init_lib
  empty_directory File.join(name, "lib", name)
end