Skip to content

Instantly share code, notes, and snippets.

@shayarnett
Created April 18, 2009 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shayarnett/97782 to your computer and use it in GitHub Desktop.
Save shayarnett/97782 to your computer and use it in GitHub Desktop.
#!/opt/local/bin/ruby
__DIR__ = File.join(File.dirname(__FILE__),"..")
framework = File.join(__DIR__,"framework")
if File.directory?(framework)
puts "Running from frozen framework"
core = File.join(framework,"merb-core")
if File.directory?(core)
$:.push File.join(core,"lib")
end
more = File.join(framework,"merb-more")
if File.directory?(more)
Dir.new(more).select {|d| d =~ /merb-/}.each do |d|
$:.push File.join(more,d,'lib')
end
end
plugins = File.join(framework,"merb-plugins")
if File.directory?(plugins)
Dir.new(plugins).select {|d| d =~ /merb_/}.each do |d|
$:.push File.join(plugins,d,'lib')
end
end
require "merb-core/core_ext/kernel"
require "merb-core/core_ext/rubygems"
else
gem = Dir.glob(__DIR__ + "/gems/gems/merb-core-*").last
raise "Can't run frozen without framework/ or local gem" unless gem
require gem + "/lib/merb-core/core_ext/kernel"
require gem + "/lib/merb-core/core_ext/rubygems"
Gem.clear_paths
Gem.path.unshift(__DIR__+"/gems")
end
gem 'merb-core', '= 0.9.2'
require 'merb-core'
unless %w[-a --adapter -i --irb-console -r --script-runner].any? { |o| ARGV.index(o) }
ARGV.push *%w[-a mongrel]
end
Merb.frozen!
Merb.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment