Sha256: d9b4778edec90648abfb53c8c030490e01b44e1e31418c243e17e1c260cc2098
Contents?: true
Size: 1.54 KB
Versions: 10
Compression:
Stored size: 1.54 KB
Contents
#!/usr/bin/env ruby # encoding: utf-8 require 'workflow_manager' require 'fileutils' Version = WorkflowManager::VERSION opt = OptionParser.new do |o| o.banner = "Version: #{Version}\nUsage:\n #{File.basename(__FILE__)} -d [druby://host:port] -m [development|production]" o.on(:server, 'druby://localhost:12345', '-d server', '--server', 'workflow manager URI (default: druby://localhost:12345)') o.on(:mode, 'development', '-m mode', '--mode', 'development|production (default: development)') o.parse!(ARGV) end uri = opt.server if opt.mode =~ /[development|production]/ config = File.join(File.dirname(File.expand_path(__FILE__)), "../config/environments/#{opt.mode}.rb") opt.mode = nil unless File.exist?(config) end puts "version = #{Version}" puts "mode = #{opt.mode}" ruby_path = File.join(RbConfig.expand("$(bindir)"), "ruby") puts "ruby = #{ruby_path}" gem_path = Gem::path puts "GEM_PATH = #{gem_path.join(',')}" if opt.mode config_dir = "./config/environments/" FileUtils.mkdir_p config_dir config_file = File.join(config_dir, opt.mode+".rb") unless File.exist?(config_file) app_dir = File.expand_path('..', __FILE__) default_config_dir = File.join(app_dir, "../config/environments") default_config_file = File.join(default_config_dir, opt.mode+".rb") if File.exist?(default_config_file) FileUtils.cp(default_config_file, config_file) else raise "Configure file does not exist: #{config_file}" end end require config_file end DRb.start_service(uri, WorkflowManager::Server.new) puts DRb.uri DRb.thread.join
Version data entries
10 entries across 10 versions & 1 rubygems