Class: Roma::Test::Config
- Inherits:
-
Object
- Object
- Roma::Test::Config
- Defined in:
- lib/roma/tools/test-scenario.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#number_of_nodes ⇒ Object
readonly
Returns the value of attribute number_of_nodes.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#working_path ⇒ Object
readonly
Returns the value of attribute working_path.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(argv) ⇒ Config
Returns a new instance of Config.
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/roma/tools/test-scenario.rb', line 273 def initialize(argv) opts = OptionParser.new opts.="usage:#{File.basename($0)} [options]" opts.on_tail("-h", "--help", "show this message") { puts opts; exit } @number_of_nodes = 3 opts.on("-n N", "number of nodes[default: 3]", Integer) { |v| @number_of_nodes = v } @working_path = '.' opts.on("-p PATH", "working path[default: .]", String) { |v| @working_path = v } @hostname = 'localhost' opts.on("--hname HOSTNAME", "hostname[default: localhost]", String) { |v| @hostname = v } @port = 11211 opts.on("--port PORT_NUMBER", "port number[default: 11211]", Integer) { |v| @port = v } opts.parse!(argv) rescue OptionParser::ParseError => e $stderr.puts e. $stderr.puts opts.help exit 1 end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
270 271 272 |
# File 'lib/roma/tools/test-scenario.rb', line 270 def hostname @hostname end |
#number_of_nodes ⇒ Object (readonly)
Returns the value of attribute number_of_nodes.
268 269 270 |
# File 'lib/roma/tools/test-scenario.rb', line 268 def number_of_nodes @number_of_nodes end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
269 270 271 |
# File 'lib/roma/tools/test-scenario.rb', line 269 def port @port end |
#working_path ⇒ Object (readonly)
Returns the value of attribute working_path.
271 272 273 |
# File 'lib/roma/tools/test-scenario.rb', line 271 def working_path @working_path end |