small-ops 0.0.8 → 0.0.9

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.
Files changed (3) hide show
  1. data/bin/docker2etcd +5 -1
  2. data/lib/small-setup.rb +4 -0
  3. metadata +1 -1
data/bin/docker2etcd CHANGED
@@ -13,7 +13,11 @@ require 'small-setup'
13
13
  container["/#{name}/name"] = name
14
14
  container["/#{name}/port"] = hport
15
15
  container["/#{name}/host"] = @host
16
- container["/#{name}/url"] = "http://#{@host}:#{hport}"
16
+ if @as_url then
17
+ container["/#{name}/url"] = "http://#{@host}/#{name}"
18
+ else
19
+ container["/#{name}/url"] = "http://#{@host}:#{hport}"
20
+ end
17
21
  container.keys.each {|key|
18
22
  if container[key] != nil then
19
23
  puts "#{key} = #{container[key]}"
data/lib/small-setup.rb CHANGED
@@ -32,6 +32,9 @@ OptionParser.new do |opts|
32
32
  opts.on("-t","--target name","Target a single container") do |t|
33
33
  options[:target]=t
34
34
  end
35
+ opts.on("-u","--as_url","Make url as host/name instead of host:port") do |u|
36
+ options[:as_url]=u
37
+ end
35
38
  end.parse!
36
39
 
37
40
 
@@ -43,6 +46,7 @@ end.parse!
43
46
  @input = options[:input] || false
44
47
  @cmd = options[:cmd] || false
45
48
  @target = options[:target] || false
49
+ @as_url = options[:as_url] || false
46
50
 
47
51
  def http_get(uri)
48
52
  JSON.parse(Net::HTTP.get(URI(uri)))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: small-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: