booby 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 580e3da73af31344e0932d62b61c2eca1d96e581
4
- data.tar.gz: 0a30866d2bafcfbb14f93ca38d6b83eec8155d19
3
+ metadata.gz: f4c5717f748ffb6a68a2a502f0fa853c7a61dcac
4
+ data.tar.gz: 87694c849db54accec0c6ad203afdca0bbeaf11f
5
5
  SHA512:
6
- metadata.gz: 2c0389b02e6628b40c99fc7fa57a987d23b6082a4a88b890c12640e42109c27c561a0f9106bb940856ff05643d9c5915676e4a46e1b53153e9c9c80a8cc7021e
7
- data.tar.gz: ad3468bf0e854b5b1fc776af68c3862bf4573e2352565bd9366ba9b7a05bce99260f91372369cf071fa927a0399a64e11bb1745b1019ff9bca5b63cb82a3cc51
6
+ metadata.gz: acc3c3d861c9e2df6a751c9ca1f8cdd70e8d568dda3f8dd18e814dc60de42423566317201f95a4e24827b63d09e38231e54bf565f2b7ef63da76b8f2b89785f5
7
+ data.tar.gz: 1176b49c1099a8026f78327cbf3ba33fa60fc2effd64da8a7ceadc1230dcaa8a20d6b5e576260a2d4ec298bcb39bd01a0ae63ce5e3b2fa3defc3a79843d3dc7c
@@ -45,22 +45,12 @@ module Booby
45
45
  cmd, *args = line.split
46
46
 
47
47
  # Check arity for this command...
48
- arity = @__current_processor.class.const_get(:ARITY) rescue nil
49
- arity = arity[cmd] if arity
48
+ ar = @__current_processor.class.const_get(:ARITY) rescue nil
49
+ ar = ar[cmd] if ar
50
+ ar_int = ar.to_i rescue 0
50
51
 
51
- case arity
52
- when true
53
- if args.empty?
54
- raise InvalidNumberOfParametersError.new(
55
- arity, args.size, cmd, line_no
56
- )
57
- end
58
- when Integer
59
- if args.size != arity
60
- raise InvalidNumberOfParametersError.new(
61
- arity, args.size, cmd, line_no
62
- )
63
- end
52
+ if (ar === true && args.empty?) || (ar_int > 0 && args.size != ar_int)
53
+ raise InvalidNumberOfParametersError.new(ar, args.size, cmd, line_no)
64
54
  end
65
55
 
66
56
  # Parse...
@@ -1,3 +1,3 @@
1
1
  module Booby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,6 +2,6 @@ require File.expand_path("../helper.rb", __FILE__)
2
2
 
3
3
  class TestVersion < Minitest::Test
4
4
  def test_version_number
5
- assert_equal Booby::VERSION, "0.0.1"
5
+ assert_equal Booby::VERSION, "0.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hmurca Team