booby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/booby/parser.rb +5 -15
- data/lib/booby/version.rb +1 -1
- data/test/version_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4c5717f748ffb6a68a2a502f0fa853c7a61dcac
|
4
|
+
data.tar.gz: 87694c849db54accec0c6ad203afdca0bbeaf11f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc3c3d861c9e2df6a751c9ca1f8cdd70e8d568dda3f8dd18e814dc60de42423566317201f95a4e24827b63d09e38231e54bf565f2b7ef63da76b8f2b89785f5
|
7
|
+
data.tar.gz: 1176b49c1099a8026f78327cbf3ba33fa60fc2effd64da8a7ceadc1230dcaa8a20d6b5e576260a2d4ec298bcb39bd01a0ae63ce5e3b2fa3defc3a79843d3dc7c
|
data/lib/booby/parser.rb
CHANGED
@@ -45,22 +45,12 @@ module Booby
|
|
45
45
|
cmd, *args = line.split
|
46
46
|
|
47
47
|
# Check arity for this command...
|
48
|
-
|
49
|
-
|
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
|
-
|
52
|
-
|
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...
|
data/lib/booby/version.rb
CHANGED
data/test/version_test.rb
CHANGED