opt 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 427adb3a36001c85e6d8dc0a5b5dd64086c93465
4
- data.tar.gz: 125c5a7574ee58a627f94067ce0e11fa1920a808
3
+ metadata.gz: 65365f8b3bd3a26fbd82607908f7e6eed5cb1b04
4
+ data.tar.gz: 54a096c8afd77fb9c75d1d32e33f3429ff3e2be4
5
5
  SHA512:
6
- metadata.gz: 6964a05a1355768605a19576c307af86704e09cbe9e398af0128ee3bc85e7922f537a0c6b8fc17c0673938b62a9d59ead0ca87244896068387632cdc1200e995
7
- data.tar.gz: 9b40f785232014d8d1a1e99367a572096dde47c87de536b6c3ec14ececbac592afc09a6a7ab1576181cc686d423a70bea389710152e5aff3f141b99fe36d2a07
6
+ metadata.gz: 33d38ef7732b9229f02cc8a416a76124cec5c877b6c6c1041c0835550d42497fc19c6c181c862feac0fd4a5688afc8819042a526b4bbe9cb32c97c687c415f1d
7
+ data.tar.gz: ee6e9e7facdbd3e73d101f6e1793e44a8f2b69d7371642b943009632098590fc5efc37916421b286ccd1001126dccbf54a43f1b17ab9687b19d22e1ebbd34df3
@@ -175,7 +175,8 @@ module Opt
175
175
 
176
176
  if argv.first.text?
177
177
  if (cmd = commands.find{|c| c.name == argv.first.value })
178
- result.command << argv.shift.value
178
+ argv.shift
179
+ result.command << cmd
179
180
  cmd.parse_argv!(argv, result, options)
180
181
  next
181
182
  end
@@ -1,8 +1,8 @@
1
1
  module Opt
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 2
5
- PATCH = 1
4
+ MINOR = 3
5
+ PATCH = 0
6
6
  STAGE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.').freeze
8
8
 
@@ -100,13 +100,14 @@ describe Opt do
100
100
 
101
101
  expect(result.force?).to eq true
102
102
  expect(result.verbose?).to eq true
103
- expect(result.command).to eq %w(add)
103
+ expect(result.command.first).to be_a Opt::Command
104
+ expect(result.command.map(&:name)).to eq %w(add)
104
105
 
105
106
  result = opt.parse %w(add -f --verbose)
106
107
 
107
108
  expect(result.force?).to eq true
108
109
  expect(result.verbose?).to eq true
109
- expect(result.command).to eq %w(add)
110
+ expect(result.command.map(&:name)).to eq %w(add)
110
111
  end
111
112
 
112
113
  it 'should parse subcommands (II)' do
@@ -121,13 +122,13 @@ describe Opt do
121
122
 
122
123
  expect(result.a?).to eq true
123
124
  expect(result.f?).to eq true
124
- expect(result.command).to eq %w(add)
125
+ expect(result.command.map(&:name)).to eq %w(add)
125
126
 
126
127
  result = opt.parse %w(add -ajf)
127
128
 
128
129
  expect(result.a?).to eq true
129
130
  expect(result.f?).to eq nil
130
131
  expect(result.j).to eq 'f'
131
- expect(result.command).to eq %w(add)
132
+ expect(result.command.map(&:name)).to eq %w(add)
132
133
  end
133
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler