Sha256: e1b7c6528ae60de4154c36bece7158879cff2d25ad36e5c1481a11eeadbb5177
Contents?: true
Size: 735 Bytes
Versions: 19
Compression:
Stored size: 735 Bytes
Contents
require 'grape/app' require 'thor' module Grape::App::CLI class Builder < Thor::Group include Thor::Actions argument :name, required: true def self.source_root File.join(File.dirname(__FILE__), 'templates') end 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 def init_lib empty_directory File.join(name, "lib", name) end end class Runner < Thor register Builder, :new, "new NAME", "create a new application" end end Grape::App::CLI::Runner.start
Version data entries
19 entries across 19 versions & 1 rubygems