Class: Simplerb::CLI
- Inherits:
-
Thor
- Object
- Thor
- Simplerb::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/simplerb/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
30 31 32 |
# File 'lib/simplerb/cli.rb', line 30 def self.source_root File.(File.join(File.dirname(__FILE__), 'templates')) end |
Instance Method Details
#new(name) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/simplerb/cli.rb', line 10 def new(name) target = Pathname.pwd.join(name) self.destination_root = target = { name: name } directory 'views', directory 'public', template 'Gemfile.tt', template 'config.ru.tt', inside target do run 'bundle install' end end |
#server ⇒ Object
26 27 28 |
# File 'lib/simplerb/cli.rb', line 26 def server exec "rackup -p #{[:port]} -s #{[:server]}" end |