etcd-completion 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: 1a87f71c302cc1f90fee1a9f4af10aea41bf8e93
4
- data.tar.gz: 6946203d8229f18ce245e916595c5f54e32ade02
3
+ metadata.gz: 838c65b812cf27f31626684e15e71e7459c6d896
4
+ data.tar.gz: cee0dab9d704ae70f10f7ca1b0939381cd011579
5
5
  SHA512:
6
- metadata.gz: d5c4e02e5c5b05f2e10c872c2bcff83be5f0382c059eedb9ac0cd343bb7633038ca1056ee296bd0f13bbeae6fc9e178580100fcaba9eca072e5b0fd840ad9e84
7
- data.tar.gz: ce738743248867950118a71fa1d79d22ddc1932aee8816e03e8aa6e0d713c2db94931d47b0477c7111fb9d0dc61140baf97fed83037b49ecd5673ebdb52ab884
6
+ metadata.gz: a63fa945007f5c6b161801993ae49cddd31c0c4200d1df1d44945725a6bb1813a81d655a7880947dd63721e6b9f40ff6e8700034deb440601ebb3627d8ea2e0b
7
+ data.tar.gz: 38860b79acf047643e36aafd5b00b49cae64731c7dcbef7e0c409b8006c206cfd139477e5b031c4dc28cae6ec24996f21d4e4558606f93428acc58fa0825b832
data/README.md CHANGED
@@ -1,29 +1,57 @@
1
1
  # Etcd::Completion
2
-
3
- TODO: Write a gem description
2
+ Rubygem. Provides a CLI for performing etcd autocompletion.
4
3
 
5
4
  ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'etcd-completion'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install etcd-completion
5
+ ```bash
6
+ gem install etcd-completion
7
+ ```
18
8
 
19
9
  ## Usage
10
+ ```bash
11
+ etcd-completion <operation> <prefix>
12
+ ```
13
+ Operation must an etcd operation - ie:
14
+ * mkdir
15
+ * get
16
+ * ls
17
+ * set
18
+ * etcetera
19
+
20
+ Prefix must be part of a path or a key.
21
+
22
+ ## Examples
23
+ Given this directory structure:
24
+ ```
25
+ /
26
+ |--dir1
27
+ | |--k/
28
+ | |--key
29
+ | |--key2
30
+ |--dir2
31
+ ```
32
+
33
+ ```
34
+ etcd-completion ls /d
35
+ --> /dir1/ /dir2/
36
+
37
+ etcd-completion ls /dir1
38
+ --> /dir1/key1 /dir1/key2
39
+
40
+ etcd-completion ls /dir1/k
41
+ --> /dir1/k/
42
+
43
+ etcd-completion get /dir1/k
44
+ --> /dir1/k/ /dir1/key /dir1/key2
45
+ ```
46
+
47
+ ## Limitations
48
+ * Currently, etcd-completion does not recurse into subdirectories to prune
49
+ invalid directories. In the above examples, the ```get /dir1/k``` example should
50
+ prune the "dir/k" directory, because there are no keys to "get" in that
51
+ directory, so get cannot possibly operate on a path starting with it. I plan
52
+ to address this problem in a future pull request.
53
+ * Currently, this gem is just a bin file, with no library, so it is useful
54
+ only from the commandline and not from ruby programs. I plan to rectify this
55
+ as well.
20
56
 
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
24
57
 
25
- 1. Fork it ( http://github.com/<my-github-username>/etcd-completion/fork )
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
data/bin/etcd-completion CHANGED
@@ -13,14 +13,7 @@ def filter(prefix, key)
13
13
  key.start_with?(prefix)
14
14
  end
15
15
 
16
- def log msg
17
- open('/tmp/temp.txt', 'a') do |f|
18
- f << msg << "\n"
19
- end
20
- end
21
-
22
16
  def completions(op, prefix)
23
- log "op: #{op}, prefix:#{prefix}"
24
17
  prefix = '' if prefix.nil?
25
18
  if node_ops.include? op
26
19
  type = 'node'
@@ -1,5 +1,5 @@
1
1
  module Etcd
2
2
  module Completion
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcd-completion
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
  - Michael Shea