class Simplerb::CLI
Public Class Methods
source_root()
click to toggle source
# File lib/simplerb/cli.rb, line 30 def self.source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates')) end
Public Instance Methods
new(name)
click to toggle source
# File lib/simplerb/cli.rb, line 10 def new(name) target = Pathname.pwd.join(name) self.destination_root = target options = { name: name } directory 'views', options directory 'public', options template 'Gemfile.tt', options template 'config.ru.tt', options inside target do run 'bundle install' end end
server()
click to toggle source
# File lib/simplerb/cli.rb, line 26 def server exec "rackup -p #{options[:port]} -s #{options[:server]}" end