public
Description: A new revision of Fuzed, the Erlang-based frontend for web apps. Check out the mailing list at http://groups.google.com/group/fuzed
Homepage:
Clone URL: git://github.com/KirinDave/fuzed.git
add rails cli to make railsy stuff easy
mojombo (author)
Sun May 11 18:28:32 -0700 2008
commit  6f4be433ed215bc983b5e4ac346b377c27c21b29
tree    fa3eaeca916dba29a8e4ccfcbb6e3c96d3447874
parent  e9db1600a675c78c970ecde8da2fc3ec8f83f3e2
...
4
5
6
 
7
8
9
...
12
13
14
15
16
17
18
19
 
 
 
 
 
20
 
21
22
23
 
24
25
26
...
4
5
6
7
8
9
10
...
13
14
15
 
 
 
 
 
16
17
18
19
20
21
22
23
24
 
25
26
27
28
0
@@ -4,6 +4,7 @@ LOG = true
0
 # core
0
 require 'stringio'
0
 require 'logger'
0
+require 'optparse'
0
 
0
 # internal
0
 require 'chassis'
0
@@ -12,15 +13,16 @@ require 'rails_adapter'
0
 # gems
0
 require 'rack'
0
 
0
-# get rails root dir
0
-if TESTMODE
0
-  rails_root = File.join(File.dirname(__FILE__), *%w[.. test app])
0
-else
0
-  rails_root = ARGV[0] || File.join(File.dirname(__FILE__), *%w[.. test app])
0
+# read command line options
0
+options = {:rails_root => File.join(File.dirname(__FILE__), *%w[.. test app])}
0
+opts = OptionParser.new
0
+opts.on("-r", "--rails-root RAILS_ROOT", String) do |x| 
0
+  options[:rails_root] = File.join(File.dirname(__FILE__), *%w[.. test app]) unless TESTMODE
0
 end
0
+opts.parse(ARGV)
0
 
0
 # load Rails
0
-require File.join(rails_root, 'config/boot')
0
+require File.join(options[:rails_root], 'config/boot')
0
 require RAILS_ROOT + "/config/environment"
0
 
0
 # initialize logging info

Comments