main 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  module Main
2
2
  # top level constants
3
3
  #
4
- Main::VERSION = '5.1.0' unless
4
+ Main::VERSION = '5.1.1' unless
5
5
  defined? Main::VERSION
6
6
  def self.version() Main::VERSION end
7
7
 
@@ -128,10 +128,22 @@ module Main
128
128
  values << value
129
129
  end
130
130
 
131
+ def set(*values)
132
+ self.values.replace(values)
133
+ end
134
+
135
+ def get
136
+ self.values.first
137
+ end
138
+
131
139
  def value
132
140
  values.first
133
141
  end
134
142
 
143
+ def value=(value)
144
+ set(value)
145
+ end
146
+
135
147
  def argument_none?
136
148
  argument.nil?
137
149
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "main"
6
- spec.version = "5.1.0"
6
+ spec.version = "5.1.1"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "main"
9
9
  spec.description = "description: main kicks the ass"
@@ -456,6 +456,36 @@ class T < Test::Unit::TestCase
456
456
  }
457
457
  }
458
458
  end
459
+
460
+ # manual parmeter setting
461
+ #
462
+ def test_0272
463
+ assert_nothing_raised{
464
+ h = {}
465
+
466
+ main(){
467
+ argument(:foo){ optional }
468
+ run do
469
+ o = param['foo']
470
+ h[nil] = o.value
471
+
472
+ o.set 'bar'
473
+ h['bar'] = o.value
474
+
475
+ o.set ['bar']
476
+ h[['bar']] = o.value
477
+
478
+ o.set 'foo', 'bar'
479
+ h['foo'] = o.value
480
+ h[['foo', 'bar']] = o.values
481
+ end
482
+ }
483
+
484
+ h.each do |expected, actual|
485
+ assert_equal expected, actual
486
+ end
487
+ }
488
+ end
459
489
 
460
490
  # usage
461
491
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: main
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chronic