public
Fork of KirinDave/fuzed
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
Clone URL: git://github.com/tmm1/fuzed.git
master now has the choice of either yaws or mochiweb
abhay (author)
Mon Jun 09 18:15:49 -0700 2008
commit  da9448539c8b7eabd2caea509f7444e8d6dffaf6
tree    f29d8d5df702cb32131c723cb546542a67c43382
parent  75880e25b039b407d42abd72003d10f79be58303
...
8
9
10
11
 
12
13
14
...
8
9
10
 
11
12
13
14
0
@@ -8,7 +8,7 @@ FUZED_VERSION = "0.4.13"
0
 
0
 task :default do
0
   cd "elibs"
0
- sh "erlc #{ERLC_FLAGS} #{ERLC_TEST_FLAGS} *.erl"
0
+ sh "erlc #{ERLC_FLAGS} #{ERLC_TEST_FLAGS} #{Dir["**/*.erl"].join(" ")}"
0
 end
0
 
0
 task :build_dist do
...
15
16
17
 
18
19
20
...
15
16
17
18
19
20
21
0
@@ -15,6 +15,7 @@ DEFAULT_NODE_NAME = `hostname -s`.chomp + "-#{rand(9999)}"
0
 DEFAULT_MASTER_NODE = "master@fuzed-dev.powerset.com"
0
 DEFAULT_ERLANG_CODEPATHS = %w[ebin/yaws ebin/mochiweb ebin/eunit etest ebin]
0
 DEFAULT_BOOT_DIR = "/p/conf/fuzed/"
0
+DEFAULT_HTTP_SERVER = "yaws"
0
 
0
 def cookie_hash(node)
0
   Digest::MD5.hexdigest(node + "-fuzed-changethis-btw-kkthx")
...
25
26
27
28
 
 
 
 
 
29
30
31
...
25
26
27
 
28
29
30
31
32
33
34
35
0
@@ -25,7 +25,11 @@ init([]) ->
0
   IP = {0,0,0,0},
0
   Port = 9001,
0
   DocRoot = filename:dirname(code:which(?MODULE)) ++ "/../web",
0
- master_server:start(IP, Port, DocRoot),
0
+
0
+ case application:get_env(http_server) of
0
+ {ok, mochiweb} -> mochiweb_master:start(IP, Port, DocRoot);
0
+ _ -> yaws_master:start(IP, Port, DocRoot)
0
+ end,
0
   
0
   %erl_boot_server:add_subnet({0, 0, 0, 0}, {0, 0, 0, 0}),
0
   
...
8
9
10
 
 
 
 
 
11
12
13
14
 
15
16
17
...
21
22
23
 
24
25
26
...
37
38
39
 
40
41
42
...
8
9
10
11
12
13
14
15
16
17
18
 
19
20
21
22
...
26
27
28
29
30
31
32
...
43
44
45
46
47
48
49
0
@@ -8,10 +8,15 @@ OptionParser.new do |opts|
0
     options[:name] = n
0
   end
0
   
0
+ opts.on("-s SERVER", "--server SERVER", "HTTP Server to use. Choices are: mochiweb, yaws") do |s|
0
+ $stderr.puts "Unknown server type. Using yaws." unless %w[mochiweb yaws].include?(s)
0
+ options[:http_server] = s
0
+ end
0
+
0
   opts.on("-d", "--detached", "Run as a daemon") do
0
     options[:detached] = true
0
   end
0
-
0
+
0
   opts.on("-h", "--heartbeat", "Start with a heartbeat.") do
0
     $stderr.puts "WARNING! Heartbeats not supported with this build!"
0
   end
0
@@ -21,6 +26,7 @@ command = ARGV[0]
0
 
0
 detached = options[:detached] ? '-detached' : ''
0
 nodename = options[:name] || DEFAULT_MASTER_NODE
0
+http_server = options[:http_server] || DEFAULT_HTTP_SERVER
0
 
0
 if nodename !~ /@/
0
   abort "Please specify fully qualified node name e.g. -n master@fuzed.tools.powerset.com"
0
@@ -37,6 +43,7 @@ cmd = %Q{erl -boot start_sasl \
0
              -smp enable \
0
              #{code_paths}
0
              -name '#{nodename}' \
0
+ -fuzed http_server '#{http_server}' \
0
              -config '#{FUZED_ROOT}/conf/fuzed_base' \
0
              -setcookie #{cookie_hash(nodename)} \
0
              -kernel start_boot_server true \

Comments

    No one has commented yet.