hinoki 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 +7 -0
- data/README.md +1 -1
- data/lib/hinoki/config.rb +1 -1
- data/lib/hinoki/connection.rb +8 -6
- data/lib/hinoki/stashes.rb +5 -2
- data/lib/hinoki/version.rb +1 -1
- metadata +10 -12
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 132ed86ba9f3e9114eed5124c1fe6c5d5c175a14
|
4
|
+
data.tar.gz: 1c14203f306d34c1214a2d90b2c1a83ad4f015b0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 67b55f8fd4457a099761493f53bcd3aa337097cc6399d0f3bb10ddf776637524a6df6a10ec1d09539b29f403c7c0b88e967dbd16b2328cb00fe58e05dca7b40a
|
7
|
+
data.tar.gz: 74b9bb76222c203d73b9027bb73b98d1dde3b1e6b309a1adf9d58de781dfba1d84fc1695bf6be2c179cd77c3b4711d31f55fc51340e1a8a7865decb3fc9a585e
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ by a DSL-like logical description of the desired task. Where appropriate, the
|
|
10
10
|
same terminology is used across endpoints.
|
11
11
|
|
12
12
|
### Configuration
|
13
|
-
Hinoki looks for a config file in `~/.hinoki
|
13
|
+
Hinoki looks for a config file in `~/.hinoki`. If it does not find this
|
14
14
|
configuration file, it will assume it should contact `localhost:4567` for all
|
15
15
|
requests. The config file is JSON format and accepts only a `host` and `port`
|
16
16
|
parameter at present.
|
data/lib/hinoki/config.rb
CHANGED
@@ -15,7 +15,7 @@ class Hinoki
|
|
15
15
|
private
|
16
16
|
|
17
17
|
# Reads the base config file and parses it to a hash
|
18
|
-
def parse_config_file(path=File.join(ENV['HOME'], '.hinoki'
|
18
|
+
def parse_config_file(path=File.join(ENV['HOME'], '.hinoki'))
|
19
19
|
if !File.exists?(path)
|
20
20
|
puts 'I was unable to find your Hinoki config file!'
|
21
21
|
return defaults
|
data/lib/hinoki/connection.rb
CHANGED
@@ -26,6 +26,10 @@ class Hinoki
|
|
26
26
|
def delete(path)
|
27
27
|
return interpret_response(@http.delete(path))
|
28
28
|
end
|
29
|
+
|
30
|
+
def request(req)
|
31
|
+
return interpret_response(@http.request(req))
|
32
|
+
end
|
29
33
|
|
30
34
|
private
|
31
35
|
|
@@ -34,13 +38,11 @@ class Hinoki
|
|
34
38
|
case response.code.to_i
|
35
39
|
when 200
|
36
40
|
puts 'OK'
|
37
|
-
when 201
|
38
|
-
puts '
|
39
|
-
when 204
|
40
|
-
puts 'Success; no content'
|
41
|
+
when 201,202,204
|
42
|
+
puts 'OK'
|
41
43
|
return
|
42
44
|
when 400
|
43
|
-
puts '
|
45
|
+
puts 'Bad request'
|
44
46
|
return
|
45
47
|
when 404
|
46
48
|
puts 'Resource not found'
|
@@ -49,7 +51,7 @@ class Hinoki
|
|
49
51
|
puts 'Sensu encountered an error'
|
50
52
|
return
|
51
53
|
else
|
52
|
-
puts
|
54
|
+
puts "Unexpected HTTP response code #{response.code}"
|
53
55
|
return
|
54
56
|
end
|
55
57
|
|
data/lib/hinoki/stashes.rb
CHANGED
@@ -20,9 +20,12 @@ class Hinoki
|
|
20
20
|
# Add a new stash (JSON formatted)
|
21
21
|
def self.create(path, content, expiration=nil)
|
22
22
|
hash = {path: path, content: content}
|
23
|
-
if expiration then hash.merge!({expire: expiration}) end
|
23
|
+
if expiration then hash.merge!({expire: expiration.to_i}) end
|
24
24
|
|
25
|
-
|
25
|
+
post = Net::HTTP::Post.new('/stashes')
|
26
|
+
post.body=JSON.generate(hash)
|
27
|
+
|
28
|
+
return @conn.request(post)
|
26
29
|
end
|
27
30
|
|
28
31
|
# Get information about a specific stash
|
data/lib/hinoki/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hinoki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jake Davis
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-25 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A programmatic CLI utility for interacting with the Sensu API
|
15
14
|
email: jake.davis5989@gmail.com
|
@@ -17,7 +16,10 @@ executables: []
|
|
17
16
|
extensions: []
|
18
17
|
extra_rdoc_files: []
|
19
18
|
files:
|
19
|
+
- LICENSE
|
20
|
+
- README.md
|
20
21
|
- hinoki.gemspec
|
22
|
+
- lib/hinoki.rb
|
21
23
|
- lib/hinoki/aggregates.rb
|
22
24
|
- lib/hinoki/base.rb
|
23
25
|
- lib/hinoki/checks.rb
|
@@ -27,32 +29,28 @@ files:
|
|
27
29
|
- lib/hinoki/events.rb
|
28
30
|
- lib/hinoki/stashes.rb
|
29
31
|
- lib/hinoki/version.rb
|
30
|
-
- lib/hinoki.rb
|
31
|
-
- LICENSE
|
32
|
-
- README.md
|
33
32
|
homepage: http://github.com/jakedavis/hinoki
|
34
33
|
licenses:
|
35
34
|
- Apache 2.0
|
35
|
+
metadata: {}
|
36
36
|
post_install_message:
|
37
37
|
rdoc_options: []
|
38
38
|
require_paths:
|
39
39
|
- lib
|
40
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
41
|
requirements:
|
43
|
-
- -
|
42
|
+
- - ">="
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: '0'
|
46
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
46
|
requirements:
|
49
|
-
- -
|
47
|
+
- - ">="
|
50
48
|
- !ruby/object:Gem::Version
|
51
49
|
version: '0'
|
52
50
|
requirements: []
|
53
51
|
rubyforge_project:
|
54
|
-
rubygems_version:
|
52
|
+
rubygems_version: 2.2.0
|
55
53
|
signing_key:
|
56
|
-
specification_version:
|
54
|
+
specification_version: 4
|
57
55
|
summary: Sensu CLI utility
|
58
56
|
test_files: []
|