cl 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cl/runner/default.rb +13 -10
- data/lib/cl/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: 9a4e37103d294db33627a373c3d1d19b2113b0a6
|
4
|
+
data.tar.gz: 7733d1f9d8f3ca199fcea0a697e679829e758597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd906f7c16c3ea0fed71806baf8c12b0e78f62ebaa8f61ea398223d51383b22075bbbfa5afa87a95e549469fad46af93e231551cc01d12207379fda5ff4d55d8
|
7
|
+
data.tar.gz: 26459916c941da8486acc6f92e87c89f91f03b37115b83149fb231843738c4eb03968c0c4b27737b8a9b525e0e7f51df6bfe21f989385622bb9bc3e3d8be002b
|
data/Gemfile.lock
CHANGED
data/lib/cl/runner/default.rb
CHANGED
@@ -31,18 +31,21 @@ class Cl
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
+
# stopping at any arg that starts with a dash, find the command
|
35
|
+
# with the key matching the most args when joined with ":", and
|
36
|
+
# remove these used args from the array
|
34
37
|
def lookup(args)
|
35
|
-
keys =
|
36
|
-
keys = keys & Cmd.registry.keys.map(&:to_s)
|
37
|
-
cmd = Cmd[keys.last] || abort("Unknown command: #{args.join(' ')}")
|
38
|
-
args = args[keys.last.split(':').size..-1]
|
39
|
-
[cmd, args]
|
40
|
-
end
|
38
|
+
keys = args.take_while { |key| !key.start_with?('-') }
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
keys = keys.inject([[], []]) do |keys, key|
|
41
|
+
keys[1] << key
|
42
|
+
keys[0] << [Cmd[keys[1].join(':')], keys[1].dup] if Cmd.registered?(keys[1].join(':'))
|
43
|
+
keys
|
44
|
+
end
|
45
|
+
|
46
|
+
cmd, keys = keys[0].last
|
47
|
+
keys.each { |key| args.delete_at(args.index(key)) }
|
48
|
+
[cmd, args]
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
data/lib/cl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: regstry
|