Class: Padrino::Cli::Base

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions, Thor::RakeCompat
Defined in:
lib/kharites/mixins/server.rb

Instance Method Summary collapse

Instance Method Details

#consoleObject



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/kharites/mixins/server.rb', line 53

def console
  prepare :console
  require File.expand_path(File.dirname(__FILE__) + "/../version")
  ARGV.clear
  puts "=> Loading #{options.environment} console (Padrino v.#{Padrino.version})"
  require 'irb'
  require "irb/completion"
  require 'config/boot'
  require File.expand_path(File.dirname(__FILE__) + '/console')
  IRB.start
end

#rake(*args) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/kharites/mixins/server.rb', line 37

def rake(*args)
  prepare :rake
  args << "-T" if options[:list]
  args << options[:list]  unless options[:list].nil? || options[:list].to_s == "list"
  args << "--trace" if options[:trace]
  args << "--verbose" if options[:verbose]
  ARGV.clear
  ARGV.concat(args)
  puts "=> Executing Rake #{ARGV.join(' ')} ..."
  ENV['PADRINO_LOG_LEVEL'] ||= "test"
  require File.expand_path(File.dirname(__FILE__) + '/rake')
  silence(:stdout) { require 'config/boot' }
  PadrinoTasks.init
end

#startObject



19
20
21
22
23
24
# File 'lib/kharites/mixins/server.rb', line 19

def start
  prepare :start
  require File.expand_path(File.dirname(__FILE__) + "/adapter")
  require 'config/boot'
  Padrino::Cli::Adapter.start(options)
end

#stopObject



27
28
29
30
# File 'lib/kharites/mixins/server.rb', line 27

def stop
  require File.expand_path(File.dirname(__FILE__) + "/adapter")
  Padrino::Cli::Adapter.stop
end

#versionObject



67
68
69
70
# File 'lib/kharites/mixins/server.rb', line 67

def version
  require 'padrino-core/version'
  puts "Padrino v. #{Padrino.version}"
end