From: Hyoun Jiil Date: Tue, 26 Aug 2014 14:42:39 +0000 (+0900) Subject: remove white space in web-svr X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=487dd32c60795fd3d2a044189e92c73995875b45;p=sdk%2Ftools%2Fsdk-build.git remove white space in web-svr Change-Id: Iec1d98c89823bd835856b49bf8bac9ba583ae365 --- diff --git a/web-svr b/web-svr index abb900a..0561577 100755 --- a/web-svr +++ b/web-svr @@ -48,22 +48,22 @@ class OptParse def self.option_error_check( options ) case options[:cmd] when "start" then - if options[:name].nil? then + if options[:name].nil? then raise ArgumentError, "Usage: " + START end when "stop" then - if options[:name].nil? then + if options[:name].nil? then raise ArgumentError, "Usage: " + STOP end when "create" then - if options[:name].nil? then + if options[:name].nil? then raise ArgumentError, "Usage: " + CREATE end else raise ArgumentError, "Input is incorrect : #{options[:cmd]}" end end - + def self.option_parse options = {} banner = "DIBS web service command-line tool." + "\n" \ @@ -77,35 +77,35 @@ class OptParse + "\t" + STOP+ "\n" \ + "\t" + CREATE + "\n" \ + "\n" + "Options:" + "\n" - + optparse = OptionParser.new(nil, 32, ' '*8) do|opts| opts.banner = banner - + options[:locate] = File.dirname(__FILE__) opts.on( '-n', '--name ', 'build server name' ) do|name| options[:name] = name end - - options[:engine] = "WEBRick" + + options[:engine] = "WEBRick" opts.on( '-e', '--engine ', 'web server engine : WEBrick | Passenger' ) do|engine| options[:engine] = engine end - + options[:port] = 3000 opts.on( '-p', '--port ', 'default server port' ) do|port| options[:port] = port end - + options[:mode] = "production" opts.on( '-m', '--mode ', 'DB mode : production | test | development' ) do|mode| options[:mode] = mode.strip end - - options[:port] = "3000" + + options[:port] = "3000" opts.on( '-p', '--port ', 'server port number: 3000' ) do|port| options[:port] = port.strip.to_i end - + opts.on( '-i', '--import', 'import configuration from build-server' ) do|import| options[:import] = true end @@ -113,7 +113,7 @@ class OptParse opts.on( '-d', '--daemon', 'daemon process' ) do|import| options[:daemon] = true end - + opts.on( '-h', '--help', 'display this information' ) do opts.help.split("\n").each {|op| puts op if not op.include? "--noreverse"} exit @@ -133,11 +133,11 @@ class OptParse else raise ArgumentError, "Usage: build-cli [OPTS] or build-cli -h" end - + optparse.parse! - + option_error_check options - + return options end end @@ -159,7 +159,7 @@ class ControlWebServer def self.get_server_config(svr_name) config = YAML.load_file("#{CONFIG_ROOT}/#{svr_name}/server.yml") end - + def self.get_build_server_config(svr_name) config_file = "#{ControlWebServer::BUILD_SERVER_CONFIG_ROOT}/#{svr_name}/server.cfg" config = {} @@ -279,7 +279,7 @@ begin f.puts " password: #{test[:db_passwd]}" f.puts " pool: #{test[:pool]}" f.puts " timeout: #{test[:timeout]}" - f.puts "" + f.puts "" f.puts " production: " f.puts " adapter: #{production[:adapter]}" f.puts " encoding: #{production[:encoding]}" @@ -290,7 +290,7 @@ begin f.puts " password: #{production[:db_passwd]}" f.puts " pool: #{production[:pool]}" f.puts " timeout: #{production[:timeout]}" - f.puts "" + f.puts "" f.puts " development: " f.puts " adapter: #{development[:adapter]}" f.puts " encoding: #{development[:encoding]}" @@ -317,7 +317,7 @@ begin File.open("#{ControlWebServer::SERVER_CONFIG}", 'w') do |f| f.write(YAML.dump(database)) end - + # run web-server if option[:daemon] daemon = "-d"