mystro-common 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mystro/account.rb +9 -1
- data/lib/mystro/common/version.rb +1 -1
- data/lib/mystro/connect/dns.rb +12 -6
- data/lib/mystro/plugin.rb +3 -3
- data/lib/mystro-common.rb +1 -1
- data/mystro-common.gemspec +6 -6
- metadata +4 -10
data/lib/mystro/account.rb
CHANGED
@@ -2,9 +2,17 @@ module Mystro
|
|
2
2
|
class Account
|
3
3
|
class << self
|
4
4
|
#attr_reader :name
|
5
|
-
attr_reader :list
|
5
|
+
#attr_reader :list
|
6
6
|
attr_reader :selected
|
7
7
|
|
8
|
+
def [](name)
|
9
|
+
get(name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(name)
|
13
|
+
@list[name]
|
14
|
+
end
|
15
|
+
|
8
16
|
def read
|
9
17
|
dir = Mystro.directory
|
10
18
|
@list = { }
|
data/lib/mystro/connect/dns.rb
CHANGED
@@ -9,12 +9,17 @@ module Mystro
|
|
9
9
|
all.select {|e| [*e.value].flatten.include?(dns)}
|
10
10
|
end
|
11
11
|
|
12
|
+
def find_by_name(name)
|
13
|
+
connection.zones.all.detect {|e| e.domain == name}
|
14
|
+
end
|
15
|
+
|
12
16
|
# customize the connect function, because we are defaulting
|
13
17
|
# to the zone from the configuration
|
14
18
|
def connect
|
15
19
|
@fog ||= begin
|
16
|
-
raise "
|
17
|
-
|
20
|
+
raise "must set zone" unless cfg.zone
|
21
|
+
raise "must set options" unless opt
|
22
|
+
find_by_name(cfg.zone)
|
18
23
|
end
|
19
24
|
rescue => e
|
20
25
|
Mystro::Log.error "DNS connect failed: #{e.message} at #{e.backtrace.first}"
|
@@ -30,11 +35,12 @@ module Mystro
|
|
30
35
|
end
|
31
36
|
|
32
37
|
def zone(name)
|
33
|
-
|
34
|
-
|
38
|
+
n = "#{name}."
|
39
|
+
z = connection.zones.get(n)
|
40
|
+
raise("zone #{n} not found") unless z
|
35
41
|
z
|
36
42
|
rescue => e
|
37
|
-
raise("
|
43
|
+
raise("#{e.message} at #{e.backtrace.first}")
|
38
44
|
end
|
39
45
|
|
40
46
|
def create_zone(model)
|
@@ -42,4 +48,4 @@ module Mystro
|
|
42
48
|
end
|
43
49
|
end
|
44
50
|
end
|
45
|
-
end
|
51
|
+
end
|
data/lib/mystro/plugin.rb
CHANGED
data/lib/mystro-common.rb
CHANGED
data/mystro-common.gemspec
CHANGED
@@ -17,10 +17,10 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_dependency "fog", "~> 1.12.1"
|
21
|
-
gem.add_dependency "yell", "~> 1.2.0"
|
22
|
-
gem.add_dependency "hashie"
|
23
|
-
gem.add_dependency "activesupport", "3.2.
|
24
|
-
gem.add_dependency "ipaddress"
|
25
|
-
gem.add_dependency "erubis"
|
20
|
+
gem.add_dependency "fog", "~> 1.12.1" # talk to cloud
|
21
|
+
gem.add_dependency "yell", "~> 1.2.0" # logging
|
22
|
+
gem.add_dependency "hashie" # better data objects
|
23
|
+
gem.add_dependency "activesupport", "3.2.14" # active support
|
24
|
+
gem.add_dependency "ipaddress" # ip address library
|
25
|
+
gem.add_dependency "erubis" # userdata templates
|
26
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mystro-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 3.2.
|
69
|
+
version: 3.2.14
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 3.2.
|
77
|
+
version: 3.2.14
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: ipaddress
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,18 +151,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- - ! '>='
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
|
-
segments:
|
155
|
-
- 0
|
156
|
-
hash: -618115457408293498
|
157
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
155
|
none: false
|
159
156
|
requirements:
|
160
157
|
- - ! '>='
|
161
158
|
- !ruby/object:Gem::Version
|
162
159
|
version: '0'
|
163
|
-
segments:
|
164
|
-
- 0
|
165
|
-
hash: -618115457408293498
|
166
160
|
requirements: []
|
167
161
|
rubyforge_project:
|
168
162
|
rubygems_version: 1.8.25
|