kek 1.0.0 → 1.1.0

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: 13e39bcda807decf7fd8192291f311014cdef419
4
- data.tar.gz: f23fc4cddefc977d5335edea23566b76cb3fdcc4
3
+ metadata.gz: 74dc078fb9f4a69bd831f004106740a83ed8b05b
4
+ data.tar.gz: 5d287ffdc439d8d82ad9270d457bd223d65bec54
5
5
  SHA512:
6
- metadata.gz: 2a2eded8f9a7a71354d4fbfe25d6dd3f8fc3e2188dd9036566d682629df2279ff4be2d0af097ec439045c2590fe6560899cbc3ed9eac3f80e23109fc1b00ae68
7
- data.tar.gz: 434d944c78faf3959da7c6a4cb53d81cb61b320673ee54ef63a1ed5f4a3565811b80c207615458a704ec6727e6d72323a5a55e896d1d9f149c376ad736d433f8
6
+ metadata.gz: 87671fecb98a075b323dadf81897883ea0784e44554fe27fe361ad2fcb6ca2c0e602270015e44be03a35dc0a793d7760f732f78f13283df955318d63ef0c9fdd
7
+ data.tar.gz: f698c7e221686b4c2e2c1aac27ea02bb5169657ccea2dc69ece70fb66582ab6eb4f757ae8f7145e94f9fdf959991f6c1ae76be3a2393fc4d8369e3f456ecff25
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1 @@
1
+ language: ruby
data/README.md CHANGED
@@ -1,8 +1,22 @@
1
- # kek
1
+ # kek [![Build Status](https://travis-ci.org/kblanks/kek.svg?branch=master)](https://travis-ci.org/kblanks/kek) [![Gem](https://img.shields.io/gem/dt/kek.svg?maxAge=21600)](https://rubygems.org/gems/kek)
2
2
 
3
- An easy to use [etcd](http://etcd.io) client. View the full documentation [here](https://github.com/kblanks/kek/wiki).
3
+ An easy to use [etcd](http://etcd.io) client.
4
4
 
5
5
  ## Basic Usage
6
6
  ```
7
7
  $ gem install kek
8
8
  ```
9
+
10
+ ```ruby
11
+ require "kek"
12
+ etcd = Kek.new 'http://127.0.0.1:2379'
13
+
14
+ etcd.set 'ayy', 'lmao', ttl: 10
15
+ # => true
16
+
17
+ etcd.get 'ayy'
18
+ # => lmao
19
+
20
+ etcd.delete 'ayy'
21
+ # => true
22
+ ```
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task :default => :spec
7
+ rescue LoadError
8
+ # not running in dev/test environment
9
+ end
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_dependency "faraday", "~> 0.9.2"
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.12"
22
21
  spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rspec", "~> 3.5.0"
23
23
  end
data/lib/kek.rb CHANGED
@@ -6,6 +6,7 @@ require "kek/json"
6
6
 
7
7
  # methods
8
8
  require "kek/keys"
9
+ require "kek/directory"
9
10
 
10
11
  class Kek
11
12
 
@@ -0,0 +1,7 @@
1
+ class Kek
2
+
3
+ def list(directory, opts = {})
4
+ @client.get("/v2/keys/#{directory}", opts).body.dig(:node, :nodes)
5
+ end
6
+
7
+ end
@@ -8,8 +8,8 @@ class Kek
8
8
  @client.get("/v2/keys/#{key}").body.dig(:node, :value)
9
9
  end
10
10
 
11
- def delete(key)
12
- @client.delete("/v2/keys/#{key}").body[:action] == "delete"
11
+ def delete(key, opts = {})
12
+ @client.delete("/v2/keys/#{key}", opts).body[:action] == "delete"
13
13
  end
14
14
 
15
15
  end
@@ -1,3 +1,3 @@
1
1
  class Kek
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kek
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kailan Blanks
@@ -25,33 +25,33 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.2
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.12'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.12'
40
+ version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: 3.5.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: 3.5.0
55
55
  description: A simple etcd client inspired by the redis gem.
56
56
  email:
57
57
  - kailan@kmp.pw
@@ -60,6 +60,8 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
63
65
  - Gemfile
64
66
  - LICENSE.md
65
67
  - README.md
@@ -68,6 +70,7 @@ files:
68
70
  - bin/setup
69
71
  - kek.gemspec
70
72
  - lib/kek.rb
73
+ - lib/kek/directory.rb
71
74
  - lib/kek/json.rb
72
75
  - lib/kek/keys.rb
73
76
  - lib/kek/version.rb