Module: Ripl::Padrino

Defined in:
lib/ripl/padrino.rb,
lib/ripl/commands.rb

Defined Under Namespace

Modules: Commands

Constant Summary collapse

VERSION =
'0.0.1'

Instance Method Summary collapse

Instance Method Details

#before_loopObject



8
9
10
11
# File 'lib/ripl/padrino.rb', line 8

def before_loop
  load_padrino
  super
end

#load_padrinoObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ripl/padrino.rb', line 13

def load_padrino
  boot_path = File.join(Dir.pwd,'config/boot.rb')
  ENV["PADRINO_ENV"] ||= ARGV.first
  ENV["RACK_ENV"] = ENV["PADRINO_ENV"] # Also set this for middleware
  unless File.exist?(boot_path)
    puts "=> Could not find boot file in: #{boot_path} !!!"
    raise SystemExit
  else
    require File.join(Dir.pwd,'config/boot.rb')
    puts "=> Loading #{ENV["PADRINO_ENV"]} console (Padrino v.#{::Padrino.version})"
    # Load apps
    ::Padrino.mounted_apps.each do |app|
      puts "=> Loading Application #{app.app_class}"
      app.app_obj.setup_application!
    end
  end
end