Skip to content

Commit

Permalink
Using { |val| conf.host = val } syntax to correct errors showing up r…
Browse files Browse the repository at this point in the history
…unning 'ruby -rubygems -Ilib bin/camping nuts.rb'.
  • Loading branch information
babalela authored and judofyr committed Feb 21, 2010
1 parent 451cae5 commit bb4c155
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/camping
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ opts = OptionParser.new do |opts|
opts.separator ""
opts.separator "Specific options:"

opts.on("-h", "--host HOSTNAME", "Host for web server to bind to (default is all IPs)") { |conf.host| }
opts.on("-p", "--port NUM", "Port for web server (defaults to #{conf.port})") { |conf.port| }
opts.on("-h", "--host HOSTNAME", "Host for web server to bind to (default is all IPs)") { |val| conf.host = val }
opts.on("-p", "--port NUM", "Port for web server (defaults to #{conf.port})") { |val| conf.port = val }
opts.on("-d", "--database FILE", "SQLite3 database path (defaults to #{db_path ? db_path : '<none>'})") { |db_path| conf.database = {:adapter => 'sqlite3', :database => db_path} }
opts.on("-C", "--console", "Run in console mode with IRB") { conf.server = "console" }
server_list = ["mongrel", "webrick", "console"]
opts.on("-s", "--server NAME", server_list, "Server to force (#{server_list.join(', ')})") { |conf.server| }
opts.on("-s", "--server NAME", server_list, "Server to force (#{server_list.join(', ')})") { |val| conf.server = val }

opts.separator ""
opts.separator "Common options:"
Expand Down

0 comments on commit bb4c155

Please sign in to comment.