Class: Gumdrop::CLI::External
- Inherits:
-
Thor
- Object
- Thor
- Gumdrop::CLI::External
- Includes:
- Thor::Actions
- Defined in:
- lib/gumdrop/cli/external.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/gumdrop/cli/external.rb', line 8 def self.source_root File.('../../../..', __FILE__) end |
Instance Method Details
#new(name) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gumdrop/cli/external.rb', line 14 def new(name) template= [:template] || 'default' if File.directory? gem_template_path(template) say "New site from template: #{template} (gem)" directory(gem_template_path(template), name) elsif File.directory? home_template_path(template) say "New site from template: #{template} (local)" directory(home_template_path(template), name) else say "Unknown template!!\n" say "Please select from one of the following:\n\n" self.templates return end path= File.(name) puts `cd #{path} && bundle install` end |
#templates ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/gumdrop/cli/external.rb', line 36 def templates say "Gem templates:" Dir[ gem_template_path ].each do |name| say " - #{File.basename name}" if File.directory?(name) end say "Local templates:" Dir[ home_template_path ].each do |name| say " - #{File.basename name}" if File.directory?(name) end end |