slop 3.4.7 → 3.5.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: f1c164d9832f305170e0d6711b2ce1aa185098ce
4
- data.tar.gz: 1e827ece3bd97ff1fb20379bc85f4ae52efbe7b6
3
+ metadata.gz: 3fa9956c84ddd760c06fd3ace9d4e0b76a7fea5b
4
+ data.tar.gz: 38bc53ca3626ec471672ec15022392e6e32cb26d
5
5
  SHA512:
6
- metadata.gz: 35734081fcec45d6d65abf0546c8de9e8921d5c226b23f8e7306159e87112ca9f6d3afbe20dfc5f9a515cea023caee86f42221f76f66cbe9d2b0523dd45899d7
7
- data.tar.gz: 677373ed7eee79341843dd52a674b64d17f8644afa6d0799f4f74fecb5603d0b3925fbaba8a616cb15a4be0e00b01e473d52d94d8d5e2a22cd9cdfdbe90e3c7e
6
+ metadata.gz: b9acff23d30d56234cb7744f1eefb16328987d198a340ead9e7e793dab38e33e55b33c3250a302eea0b138abe9a2da848e044e963c23abf42387324fdbc5597e
7
+ data.tar.gz: d9c073d8f01c14d4c8f40cd0211eeb2f88863e82a1d8c97ab66c3ccf7f75a55cc519032f69d3589c2a6ef33951c87d304ad7e7b62b6da37cc4944a51731220ad
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 3.5.0 (2014-03-12)
2
+ ------------------
3
+
4
+ * Add support for `as: Regexp` #132
5
+
1
6
  3.4.7 (2013-11-14)
2
7
  ------------------
3
8
 
@@ -4,7 +4,7 @@ require 'slop/commands'
4
4
  class Slop
5
5
  include Enumerable
6
6
 
7
- VERSION = '3.4.7'
7
+ VERSION = '3.5.0'
8
8
 
9
9
  # The main Error class, all Exception classes inherit from this class.
10
10
  class Error < StandardError; end
@@ -46,6 +46,7 @@ class Slop
46
46
  :integer => proc { |v| value_to_integer(v) },
47
47
  :float => proc { |v| value_to_float(v) },
48
48
  :range => proc { |v| value_to_range(v) },
49
+ :regexp => proc { |v| Regexp.new(v) },
49
50
  :count => proc { |v| @count }
50
51
  }
51
52
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'slop'
3
- s.version = '3.4.7'
3
+ s.version = '3.5.0'
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'
@@ -92,6 +92,10 @@ class OptionTest < TestCase
92
92
  assert_equal %w/lee john:bill/, option_value(%w/-p lee:john:bill/, :p=, :as => Array, :limit => 2, :delimiter => ':')
93
93
  end
94
94
 
95
+ test "regexp type cast" do
96
+ assert_equal Regexp.new("foo"), option_value(%w/-p foo/, :p=, :as => Regexp)
97
+ end
98
+
95
99
  test "adding custom types" do
96
100
  opts = Slop.new
97
101
  opt = opts.on :f=, :as => :reverse
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.7
4
+ version: 3.5.0
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-11-14 00:00:00.000000000 Z
11
+ date: 2014-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 5.0.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 5.0.0
41
41
  description: A simple DSL for gathering options and parsing the command line
@@ -44,8 +44,8 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
- - .gitignore
48
- - .travis.yml
47
+ - ".gitignore"
48
+ - ".travis.yml"
49
49
  - CHANGES.md
50
50
  - Gemfile
51
51
  - LICENSE
@@ -69,17 +69,17 @@ require_paths:
69
69
  - lib
70
70
  required_ruby_version: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 1.8.7
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - '>='
77
+ - - ">="
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.0.2
82
+ rubygems_version: 2.2.0
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Simple Lightweight Option Parsing