class Sinatra::Command

Public Class Methods

command() click to toggle source
# File lib/sinatra/commands/command.rb, line 9
def self.command
  nil
end
commands() click to toggle source
# File lib/sinatra/commands/command.rb, line 13
def self.commands
  @commands ||= []
end
inherited(klass) click to toggle source
# File lib/sinatra/commands/command.rb, line 17
def self.inherited(klass)
  self.commands << klass
end

Public Instance Methods

app_path(*path) click to toggle source
# File lib/sinatra/commands/command.rb, line 40
def app_path(*path)
  File.expand_path(File.join(@app_dir, *path))
end
cmd(command) click to toggle source
# File lib/sinatra/commands/command.rb, line 21
def cmd(command)
  puts command
  system command
end
rm(path) click to toggle source
# File lib/sinatra/commands/command.rb, line 26
def rm(path)
  begin
    FileUtils.rm path, verbose: true
  rescue Errno::ENOENT => e
  end
end
rm_r(path) click to toggle source
# File lib/sinatra/commands/command.rb, line 33
def rm_r(path)
  begin
    FileUtils.rm_r path, verbose: true
  rescue Errno::ENOENT => e
  end
end
template_path(*path) click to toggle source
# File lib/sinatra/commands/command.rb, line 44
def template_path(*path)
  File.expand_path(File.join(Sinatra.template_dir, *path))
end