cl 0.1.9 → 0.1.10

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: '0168a1a806d15fb5c655865d996fdee2781a0c5b'
4
- data.tar.gz: bf543bb35df052627752c1e15b9fc6b26b277c49
3
+ metadata.gz: 5097e3fcd96f977c5384e2cbd4517446f1c23f12
4
+ data.tar.gz: b5be035521723319b454d4c77c0156b03693974c
5
5
  SHA512:
6
- metadata.gz: 8dc7ebf6fa6b26693f3fd701e44f99157586b7543455ff70aeaa1766765818ffe654c247ce545925874decf7c5b7a6f4aeca01c3988e9795e379ff8b6fd0be59
7
- data.tar.gz: 3d9a6c226898d22bbbef574cbcbccb95e30457143e807b3c6c3b1e920d59d664dea2f4e524e45e527dbde5f6f9410d365a21015bd7ce82f7b4feccc8a5bd2da4
6
+ metadata.gz: 7aae3ad9799257c430f8be056881e4417d4ac93172e41f89ff522ed51ddfabbf4cbb25879c657bbda12254cfa5252c697947ef1185e4a74ed70993a47c3408d9
7
+ data.tar.gz: e56d5e67686bad275d1335afa078cdf4ba9ab28fd722143069481b5e56fb0e39729958953ba6c58303ab1d355d9b4c3e6df439a16e3a65a1ddcee9d56688e040
data/Gemfile.lock ADDED
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cl (0.1.9)
5
+ regstry (~> 1.0.3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ memfs (1.0.0)
12
+ regstry (1.0.6)
13
+ rspec (3.8.0)
14
+ rspec-core (~> 3.8.0)
15
+ rspec-expectations (~> 3.8.0)
16
+ rspec-mocks (~> 3.8.0)
17
+ rspec-core (3.8.0)
18
+ rspec-support (~> 3.8.0)
19
+ rspec-expectations (3.8.3)
20
+ diff-lcs (>= 1.2.0, < 2.0)
21
+ rspec-support (~> 3.8.0)
22
+ rspec-mocks (3.8.0)
23
+ diff-lcs (>= 1.2.0, < 2.0)
24
+ rspec-support (~> 3.8.0)
25
+ rspec-support (3.8.0)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ cl!
32
+ memfs
33
+ rspec
34
+
35
+ BUNDLED WITH
36
+ 2.0.1
@@ -34,24 +34,17 @@ class Cl
34
34
  private
35
35
 
36
36
  def lookup(args)
37
- keys = expand(args) & Cmd.registry.keys.map(&:to_s)
38
- cmd = Cmd[keys.last] || abort("Unknown command: #{args.join(' ')}")
39
- [cmd, args - keys(cmd)]
37
+ keys = expand(args)
38
+ keys = keys & Cmd.registry.keys.map(&:to_s)
39
+ cmd = Cmd[keys.last] || abort("Unknown command: #{args.join(' ')}")
40
+ args = args[keys.last.split(':').size..-1]
41
+ [cmd, args]
40
42
  end
41
43
 
42
- def name
43
- const.registry_key
44
- end
45
-
46
- def keys(cmd)
47
- keys = cmd.registry_key.to_s.split(':')
48
- keys.concat(expand(keys)).uniq
49
- end
50
-
51
- def expand(strs)
52
- # strs = strs.reject { |str| str.start_with?('-') }
53
- strs = strs.take_while { |str| !str.start_with?('-') }
54
- strs.inject([]) { |strs, str| strs << [strs.last, str].compact.join(':') }
44
+ def expand(args)
45
+ keys = args.take_while { |str| !str.start_with?('-') }
46
+ args = args[keys.size..-1]
47
+ keys.inject([]) { |strs, str| strs << [strs.last, str].compact.join(':') }
55
48
  end
56
49
  end
57
50
  end
data/lib/cl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -32,6 +32,7 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - CHANGELOG.md
34
34
  - Gemfile
35
+ - Gemfile.lock
35
36
  - MIT_LICENSE.md
36
37
  - NOTES.md
37
38
  - README.md