Thor
# File lib/padrino-core/cli/base.rb, line 61 def console prepare :console require File.expand_path("../../version", __FILE__) ARGV.clear puts "=> Loading #{options.environment} console (Padrino v.#{Padrino.version})" require 'irb' require "irb/completion" require File.expand_path('config/boot.rb') require File.expand_path('../console', __FILE__) IRB.start end
# File lib/padrino-core/cli/base.rb, line 90 def g(*args) invoke(:generate, args) end
# File lib/padrino-core/cli/base.rb, line 95 def gen(*args) invoke(:generate, args) end
# File lib/padrino-core/cli/base.rb, line 74 def generate(*args) # Build Padrino g as an alias of padrino-gen begin # We try to load the vendored padrino-gen if exist padrino_gen_path = File.expand_path('../../../../../padrino-gen/lib', __FILE__) $:.unshift(padrino_gen_path) if File.directory?(padrino_gen_path) && !$:.include?(padrino_gen_path) require 'padrino-core/command' require 'padrino-gen/command' ARGV.shift Padrino.bin_gen(ARGV) rescue puts "<= You need padrino-gen! Run: gem install padrino-gen" end end
# File lib/padrino-core/cli/base.rb, line 45 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" load File.expand_path('../rake.rb', __FILE__) silence(:stdout) { require File.expand_path('config/boot.rb') } PadrinoTasks.init(true) end
# File lib/padrino-core/cli/base.rb, line 20 def start prepare :start require File.expand_path("../adapter", __FILE__) require File.expand_path('config/boot.rb') Padrino::Cli::Adapter.start(options) end
# File lib/padrino-core/cli/base.rb, line 136 def capture(stream) begin stream = stream.to_s eval "$#{stream} = StringIO.new" yield result = eval("$#{stream}").string ensure eval("$#{stream} = #{stream.upcase}") end result end
# File lib/padrino-core/cli/base.rb, line 125 def chdir(dir) return unless dir begin Dir.chdir(dir.to_s) rescue Errno::ENOENT puts "=> Specified Padrino root '#{dir}' does not appear to exist!" rescue Errno::EACCES puts "=> Specified Padrino root '#{dir}' cannot be accessed by the current user!" end end
Generated with the Darkfish Rdoc Generator 2.