dreck 0.1.1 → 0.2.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: cfc9512964b3a66fc3a2709e31d1412dee4cb684
4
- data.tar.gz: 95892444001b731ec570f958df48bf6d3d8ffd37
3
+ metadata.gz: 6bb0f4c554c04b604345d8188c40a8ad320c1708
4
+ data.tar.gz: 790ff1a92be0e412c7435e9fc7371c35a5672450
5
5
  SHA512:
6
- metadata.gz: 1f64b2923fa096c4c7e6a098da10cbb038229712a20929b37740bcb3e3ffd30d77930fd190dda242678da140128aa908d47f17e5df270661ae4fe04b434b7f25
7
- data.tar.gz: 74172e2018095bfc400613fed8469461ec8ce3e01276f059345fb9407ed311ac121c6b0a2d2ed1f46d93454e735fb4654afa9c86a6549e46a63626842d995177
6
+ metadata.gz: '0296b43f00a880bd0936483cc9b5eaa6fda6bd04abd4cbe4c5d717050dd3c51a4f884cf00194fdbe153ff130786426c0457229201e59792434a2ebb251b43003'
7
+ data.tar.gz: 6b3e56d3e99a701e0e1664862f5df4e3ae0cefcb3472540a4c84ccc9e24a4c096f2c8a2ef47fca3c01ed44a7ce2e4ae5691c737c857b609b736460f3c4f6140f
@@ -5,7 +5,7 @@ require_relative "dreck/result"
5
5
  # The primary namespace for {Dreck}.
6
6
  module Dreck
7
7
  # {Dreck}'s current version.
8
- VERSION = "0.1.1"
8
+ VERSION = "0.2.0"
9
9
 
10
10
  # Parse the given arguments and produce a result.
11
11
  # @param args [Array<String>] the arguments to parse
@@ -5,6 +5,11 @@ module Dreck
5
5
  class DreckError < RuntimeError
6
6
  end
7
7
 
8
+ # Raised during list specification if a non-positive number of arguments
9
+ # are requested.
10
+ class BadCountError < DreckError
11
+ end
12
+
8
13
  # Raised during argument absorption if arguments are either left over
9
14
  # or are insufficient to populate the expected results.
10
15
  class AbsorptionError < DreckError
@@ -43,6 +43,10 @@ module Dreck
43
43
  # @param sym [Symbol] the name of the argument in {results}
44
44
  # @param count [Integer] the number of arguments in the list
45
45
  def list(type, sym, count: nil)
46
+ if count
47
+ raise BadCountError unless count.positive?
48
+ end
49
+
46
50
  @expected << [:list, type, sym, count]
47
51
  end
48
52
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dreck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff