consul_do 0.1.1 → 0.1.2

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: 4d4957226da4752a9ea6c7dbad95d11d26a83a6a
4
- data.tar.gz: 8b162f20735d87d73316e0ed377480b5f3274047
3
+ metadata.gz: eaf53b3f134bde3ccd76c2cbc01b7a96438eff91
4
+ data.tar.gz: 72ed7795cecde8271e9660bb8b5c39f347c25198
5
5
  SHA512:
6
- metadata.gz: cef041656eb904456cbbdfd0556c841f20225ec392ea9c689cc2bc6154d067f9d574b483356005b3c012886b2ada9377e5fc18fdb21ead6fd2b38770e629d528
7
- data.tar.gz: 85f5dbfb0eae86231554843791453e8400dd915b733a66e2a7ddae18edd3e9738a85d8233a9667146a8fec3efe0d3960734bb9f0c359c13f22a0437a7813934a
6
+ metadata.gz: 86abc466576f29bb9948cd515984df0e8b40ba5480829e2ff76e11c88b115331c4003bf5f6095270f28717acccf9e3a5e5a1e74937b8c31dc741870424a360cc
7
+ data.tar.gz: 1d993a16794349c9705e1288a28c94f403c8def2ec17fe52c857ab241335aa05a6497198fafe43ff7dfadf23e30d7eec8ab1a0489314b505985e4ed9bd31a88c
data/README.md CHANGED
@@ -27,17 +27,24 @@ Or install it yourself as:
27
27
 
28
28
  $ consul-do --help
29
29
  Usage: consul-do OPTIONS
30
- -k, --key KEY Coordination key
31
- -h, --consul-host HOST Consul hostname
32
- -p, --consul-port PORT Consul port
30
+ -k, --key KEY=consul_do Coordination key
31
+ -h, --consul-host HOST=localhost Consul hostname
32
+ -p, --consul-port PORT=8500 Consul port
33
+ -t, --token TOKEN ACL Token
33
34
  --http_proxy http://HOST:PORT
34
35
  Use supplied proxy instead of ENV
36
+ -v, --verbose Verbose logging
35
37
 
36
38
  $ consul-do -k my_key && echo "do stuff"
37
39
  do stuff
38
40
 
39
41
  $ consul-do -k not_my_key && echo "don't do stuff"
40
42
 
43
+ ## Requirements
44
+
45
+ * http access to a host running Consul Agent
46
+ * Write access to the `service/` key [via ACL, token](https://www.consul.io/docs/internals/acl.html), or consul default wide-open permissions.
47
+
41
48
  ## Development
42
49
 
43
50
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -46,7 +53,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
46
53
 
47
54
  ## Contributing
48
55
 
49
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/consul_do.
56
+ Bug reports and pull requests are welcome on GitHub at https://github.com/goldstar/consul_do.
50
57
 
51
58
 
52
59
  ## License
data/bin/setup CHANGED
@@ -2,6 +2,10 @@
2
2
  set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
 
5
+ git_root=`git rev-parse --show-cdup`
6
+
5
7
  bundle install
6
8
 
9
+ cp $git_root/hooks/* $git_root/.git/hooks/
10
+
7
11
  # Do any other automated setup that you need to do here
data/circle.yml CHANGED
@@ -1,5 +1,3 @@
1
1
  machine:
2
2
  ruby:
3
3
  version: 2.1.6
4
- timezone:
5
- Etc/GMT
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/goldstar/consul_do"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|hooks)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
@@ -37,9 +37,13 @@ module ConsulDo
37
37
  "consul-do_#{key}_session"
38
38
  end
39
39
 
40
+ def net_http_proxy
41
+ Net::HTTP.Proxy(proxy.host, proxy.port, proxy.user, proxy.password)
42
+ end
43
+
40
44
  def http_client
41
- if ConsulDo.config.proxy.host && ConsulDo.config.proxy.port
42
- ConsulDo.log "http_client", Net::HTTP.Proxy(ConsulDo.config.proxy.host, ConsulDo.config.proxy.port, ConsulDo.config.proxy.user, ConsulDo.config.proxy.password)
45
+ if proxy.host && proxy.port
46
+ ConsulDo.log "http_client", net_http_proxy
43
47
  else
44
48
  ConsulDo.log "http_client", Net::HTTP
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module ConsulDo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul_do
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Scholl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2015-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler