slop 3.4.6 → 3.4.7

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: ee8bab0b8e39c57a64b27be99083022699b0b133
4
- data.tar.gz: 908937f49a1e197b07710292385731891ca3eee1
3
+ metadata.gz: f1c164d9832f305170e0d6711b2ce1aa185098ce
4
+ data.tar.gz: 1e827ece3bd97ff1fb20379bc85f4ae52efbe7b6
5
5
  SHA512:
6
- metadata.gz: a0b5d7a91bd89cf4fe1a272a3aa804e1330c1cf2fd1b6152f25cb7655ee8de759de9763780d7c93c265f9369deea969aec750ad1b123afd3143065b64888d3d7
7
- data.tar.gz: fab9002de7d781eb65b746fe03c01d9b7ba7075082d17afe3c3f57ccecf33425129e80f9ec4c90d1e40add93dc2e75a16e8fb0fa6d84ad19480dbd6a10a38daf
6
+ metadata.gz: 35734081fcec45d6d65abf0546c8de9e8921d5c226b23f8e7306159e87112ca9f6d3afbe20dfc5f9a515cea023caee86f42221f76f66cbe9d2b0523dd45899d7
7
+ data.tar.gz: 677373ed7eee79341843dd52a674b64d17f8644afa6d0799f4f74fecb5603d0b3925fbaba8a616cb15a4be0e00b01e473d52d94d8d5e2a22cd9cdfdbe90e3c7e
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 3.4.7 (2013-11-14)
2
+ ------------------
3
+
4
+ * Ensure trash is cleared on every parse so you can parse multiple
5
+ times with the same instance (#130)
6
+
1
7
  3.4.5 (2013-05-14)
2
8
  ------------------
3
9
 
data/README.md CHANGED
@@ -2,9 +2,9 @@ Slop
2
2
  ====
3
3
 
4
4
  Slop is a simple option parser with an easy to remember syntax and friendly API.
5
- API Documentation is available [here](http://injekt.github.com/rdoc/slop/).
5
+ API Documentation is available [here](http://leejarvis.github.com/rdoc/slop/).
6
6
 
7
- [![Build Status](https://travis-ci.org/injekt/slop.png?branch=master)](http://travis-ci.org/injekt/slop)
7
+ [![Build Status](https://travis-ci.org/leejarvis/slop.png?branch=master)](http://travis-ci.org/leejarvis/slop)
8
8
 
9
9
  Usage
10
10
  -----
@@ -123,7 +123,7 @@ opts = Slop.parse do
123
123
 
124
124
  command 'add' do
125
125
  on :v, :verbose, 'Enable verbose mode'
126
- on :name, 'Your name'
126
+ on :name=, 'Your name'
127
127
 
128
128
  run do |opts, args|
129
129
  puts "You ran 'add' with options #{opts.to_hash} and args: #{args.inspect}"
@@ -4,7 +4,7 @@ require 'slop/commands'
4
4
  class Slop
5
5
  include Enumerable
6
6
 
7
- VERSION = '3.4.6'
7
+ VERSION = '3.4.7'
8
8
 
9
9
  # The main Error class, all Exception classes inherit from this class.
10
10
  class Error < StandardError; end
@@ -226,6 +226,10 @@ class Slop
226
226
  return items
227
227
  end
228
228
 
229
+ # reset the trash so it doesn't carry over if you parse multiple
230
+ # times with the same instance
231
+ @trash.clear
232
+
229
233
  if cmd = @commands[items[0]]
230
234
  items.shift
231
235
  return cmd.parse! items
@@ -40,7 +40,7 @@ class Slop
40
40
  @triggered_command = nil
41
41
 
42
42
  warn "[DEPRECATED] Slop::Commands is deprecated and will be removed in "\
43
- "Slop version 4. Check out http://injekt.github.com/slop/#commands for "\
43
+ "Slop version 4. Check out http://leejarvis.github.io/slop/#commands for "\
44
44
  "a new implementation of commands."
45
45
 
46
46
  if block_given?
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'slop'
3
- s.version = '3.4.6'
3
+ s.version = '3.4.7'
4
4
  s.summary = 'Simple Lightweight Option Parsing'
5
5
  s.description = 'A simple DSL for gathering options and parsing the command line'
6
6
  s.author = 'Lee Jarvis'
7
7
  s.email = 'ljjarvis@gmail.com'
8
- s.homepage = 'http://github.com/injekt/slop'
8
+ s.homepage = 'http://github.com/leejarvis/slop'
9
9
  s.files = `git ls-files`.split("\n")
10
10
  s.test_files = `git ls-files -- test/*`.split("\n")
11
11
  s.license = 'MIT'
@@ -505,4 +505,14 @@ class SlopTest < TestCase
505
505
  assert_equal 'second', i
506
506
  end
507
507
 
508
+ test "taking out the trash" do
509
+ args = []
510
+ opts = Slop.new { on :f, :foo }
511
+ opts.run { |_, a| args = a }
512
+ opts.parse! %w(--foo bar)
513
+ assert_equal %w(bar), args
514
+ opts.parse! %w(foo)
515
+ assert_equal %w(foo), args
516
+ end
517
+
508
518
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.6
4
+ version: 3.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Jarvis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-25 00:00:00.000000000 Z
11
+ date: 2013-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -59,7 +59,7 @@ files:
59
59
  - test/helper.rb
60
60
  - test/option_test.rb
61
61
  - test/slop_test.rb
62
- homepage: http://github.com/injekt/slop
62
+ homepage: http://github.com/leejarvis/slop
63
63
  licenses:
64
64
  - MIT
65
65
  metadata: {}