4 require File
.join(File
.dirname(__FILE__
), *%w
[.. lib fuzed
])
10 OptionParser
.new
do |opts
|
11 opts
.banner
= "Usage: fuzed command [options]"
13 opts
.on("-c CONFIG", "--config CONFIG", "Path to Yaws config file") do |n
|
17 opts
.on("-n NAME", "--name NAME", "Node name") do |n
|
21 opts
.on("-m NAME", "--master NAME", "Master node name") do |n
|
22 options
[:master_name] = n
25 opts
.on("-r RAILS_ROOT", "--rails RAILS_ROOT", "Path to Rails root") do |a
|
34 config
= options
[:config]
35 nodename
= options
[:name]
37 puts
"Starting yaws server with name: #{nodename}"
38 system
%Q{yaws --conf #{config} --pa #{Fuzed.relative 'elibs'} -name "#{nodename}" --runmod rails_connection_pool}
40 nodename = options[:name]
41 master = options[:master_name]
42 rails = options[:rails]
44 puts "Starting a client named #{nodename} offering service to #{master}"
45 puts "Each node will run: 'fuzed-adapter #{rails}'"
46 system %Q{cd #{Fuzed.root}; erl -noshell -name #{nodename} -eval "join_cluster:start('#{master}','fuzed-adapter #{rails}')."}
48 puts 'Invalid command'
53 ruby-prof -p graph_html -f graph.html