small-ops 0.0.1.beta → 0.0.1.pre

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 (2) hide show
  1. data/lib/small-setup.rb +2 -23
  2. metadata +1 -1
data/lib/small-setup.rb CHANGED
@@ -17,24 +17,15 @@ OptionParser.new do |opts|
17
17
  opts.on("-p", "--prefix prefix", "Set etcd prefix path") do |p|
18
18
  options[:prefix] = p
19
19
  end
20
- opts.on("-d","--daemon","Run in background") do |d|
20
+ opts.on("-d","--daemon","what") do |d|
21
21
  options[:daemon]=d
22
22
  end
23
- opts.on("-o","--output file","Output file") do |o|
24
- options[:output]=o
25
- end
26
- opts.on("-i","--input file","Input file") do |o|
27
- options[:input]=o
28
- end
29
23
  end.parse!
30
24
 
31
-
32
25
  @host = options[:host] || ENV['HOST'] || `hostname -I | awk '{ print $1 }'`.gsub("\n","")
33
26
  @etcd = options[:etcd] || ENV['ETCD'] || "http://#{@host}:4001"
34
27
  @prefix = options[:prefix] || ENV['PREFIX'] || ""
35
- @foreground = !options[:daemon]
36
- @output = options[:output] || false
37
- @input = options[:input] || false
28
+ @foreground = !options[:daemon] || true
38
29
 
39
30
  def http_get(uri)
40
31
  JSON.parse(Net::HTTP.get(URI(uri)))
@@ -93,15 +84,3 @@ def eflatten(obj)
93
84
  flat
94
85
  end
95
86
 
96
- def nodes2obj(nodes,prefix)
97
- obj={}
98
- nodes.each {|node|
99
- if node['dir'] && node['nodes'] then
100
- obj[node['key'].gsub(prefix,'')]=nodes2obj( node['nodes'],"#{ node['key'] }/" )
101
- elsif node['value'] then
102
- obj[node['key'].gsub(prefix,'')]=node['value']
103
- end
104
- }
105
- obj
106
- end
107
-
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.1.beta
4
+ version: 0.0.1.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: