shayarnett (owner)

Revisions

gist: 97782 Download_button fork
public
Public Clone URL: git://gist.github.com/97782.git
Embed All Files: show embed
Text only #
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
#!/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