shayarnett (owner)

Revisions

gist: 7502 Download_button fork
public
Public Clone URL: git://gist.github.com/7502.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/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.pwd + "/gems")
end
 
gem 'merb-core', '= 0.9.3'
require 'merb-core'
unless ARGV.index('-a') || ARGV.index('-i')
  ARGV.push *%w[-a mongrel]
end
  
Merb.frozen!
Merb.start