sickle 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sickle.rb +12 -5
- data/lib/sickle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37ba6c4218882b2efdb67ab648d29f499eabb624
|
4
|
+
data.tar.gz: dcfb6841956fc47a56176d68c87a201209a0ebfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af5e069cd2785a641781ebec053010a7a8c795fbb35c62c8ebed3d1dd0f9de7fa36d667e87409d55a958a6dba6ba0ab04aa86ab06e6939ce1436e92c2977c1af
|
7
|
+
data.tar.gz: 71cd61ec581dda2986f4fb569021df71de003c7f4f461381675a4515e8469c79295fc5a91746d54b8071480f1396ff06dac2905286ca31c564e36dba306aebac
|
data/lib/sickle.rb
CHANGED
@@ -250,10 +250,6 @@ module Sickle
|
|
250
250
|
results[o.name] ||= o.default
|
251
251
|
end
|
252
252
|
|
253
|
-
# puts "args: #{args.inspect}"
|
254
|
-
# puts "results: #{results.inspect}"
|
255
|
-
|
256
|
-
|
257
253
|
obj = self.new
|
258
254
|
obj.instance_variable_set(:@__options, results)
|
259
255
|
|
@@ -261,7 +257,18 @@ module Sickle
|
|
261
257
|
obj.instance_exec(&@__before_hook)
|
262
258
|
end
|
263
259
|
|
264
|
-
command.meth.
|
260
|
+
req, opt = command.meth.parameters.partition {|(r,_)| r == :req }
|
261
|
+
r,o = req.size, opt.size
|
262
|
+
argr = (r..(r+o))
|
263
|
+
|
264
|
+
if argr.include?(args.size)
|
265
|
+
command.meth.bind(obj).call(*args)
|
266
|
+
else
|
267
|
+
puts "\e[31mWrong number of arguments (#{args.size} for #{argr})\e[0m"
|
268
|
+
puts
|
269
|
+
run(["help", command_name])
|
270
|
+
exit 127
|
271
|
+
end
|
265
272
|
else
|
266
273
|
puts "\e[31mCommand '#{command_name}' not found\e[0m"
|
267
274
|
puts
|
data/lib/sickle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sickle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tymon Tobolski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|