Class: Simplerb::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



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

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

Instance Method Details

#new(name) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/simplerb/cli.rb', line 9

def new(name)
  self.destination_root = Pathname.pwd.join(name)
  options = { name: name }
  directory('views', options)
  directory('public', options)
  template('config.ru.tt', options)
end

#serverObject



20
21
22
23
# File 'lib/simplerb/cli.rb', line 20

def server
  system "rackup -p #{options[:port]} -s #{options[:server]}"
rescue Interrupt
end