guignol 0.3.5.1 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.2-p320
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,24 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guignol (0.3.5.1)
4
+ guignol (0.3.6)
5
5
  activesupport
6
- fog (~> 1.6.0)
7
- parallel (~> 0.5.14)
6
+ fog (~> 1.9.0)
7
+ parallel (~> 0.6.2)
8
8
  thor
9
9
  uuidtools
10
10
 
11
11
  GEM
12
- remote: http://rubygems.org/
12
+ remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (3.2.8)
14
+ activesupport (3.2.12)
15
15
  i18n (~> 0.6)
16
16
  multi_json (~> 1.0)
17
- builder (3.1.3)
17
+ builder (3.1.4)
18
18
  coderay (1.0.7)
19
19
  diff-lcs (1.1.3)
20
- excon (0.16.7)
21
- fog (1.6.0)
20
+ excon (0.17.0)
21
+ fog (1.9.0)
22
22
  builder
23
23
  excon (~> 0.14)
24
24
  formatador (~> 0.2.0)
@@ -28,16 +28,16 @@ GEM
28
28
  net-ssh (>= 2.1.3)
29
29
  nokogiri (~> 1.5.0)
30
30
  ruby-hmac
31
- formatador (0.2.3)
31
+ formatador (0.2.4)
32
32
  i18n (0.6.1)
33
33
  method_source (0.8)
34
- mime-types (1.19)
35
- multi_json (1.3.6)
34
+ mime-types (1.21)
35
+ multi_json (1.6.1)
36
36
  net-scp (1.0.4)
37
37
  net-ssh (>= 1.99.1)
38
- net-ssh (2.6.1)
39
- nokogiri (1.5.5)
40
- parallel (0.5.19)
38
+ net-ssh (2.6.5)
39
+ nokogiri (1.5.6)
40
+ parallel (0.6.2)
41
41
  pry (0.9.10)
42
42
  coderay (~> 1.0.5)
43
43
  method_source (~> 0.8)
@@ -55,7 +55,7 @@ GEM
55
55
  rspec-mocks (2.4.0)
56
56
  ruby-hmac (0.4.0)
57
57
  slop (3.3.3)
58
- thor (0.16.0)
58
+ thor (0.17.0)
59
59
  uuidtools (2.1.3)
60
60
 
61
61
  PLATFORMS
data/guignol.gemspec CHANGED
@@ -22,8 +22,9 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "pry"
23
23
  s.add_development_dependency "pry-nav"
24
24
 
25
- s.add_dependency "fog", "~> 1.6.0"
26
- s.add_dependency "parallel", "~> 0.5.14"
25
+
26
+ s.add_dependency "fog", "~> 1.9.0"
27
+ s.add_dependency "parallel", '~> 0.6.2'
27
28
  s.add_dependency "activesupport"
28
29
  s.add_dependency "uuidtools"
29
30
  s.add_dependency "thor"
@@ -0,0 +1,28 @@
1
+
2
+ require 'guignol/commands/base'
3
+ require 'guignol/models/instance'
4
+
5
+ Guignol::Shell.class_eval do
6
+ desc 'dns [PATTERNS]', 'Prints the DNS mappings for servers matching PATTERNS'
7
+ def dns(*patterns)
8
+ patterns.push('.*') if patterns.empty?
9
+ Guignol::Commands::DNS.new(patterns).run
10
+ end
11
+ end
12
+
13
+
14
+ module Guignol::Commands
15
+ class DNS < Base
16
+ def run_on_server(instance, options = {})
17
+ synchronize do
18
+ shell.say instance.name.ljust(@max_width + 1)
19
+ shell.say instance.dns_name
20
+ end
21
+ end
22
+
23
+ def before_run(configs, options = {})
24
+ @max_width = configs.keys.map(&:size).max
25
+ end
26
+ end
27
+ end
28
+
@@ -1,4 +1,4 @@
1
-
1
+ require 'pathname'
2
2
  require 'active_support'
3
3
  require 'active_support/core_ext/enumerable'
4
4
  require 'guignol'
@@ -135,15 +135,21 @@ module Guignol::Models
135
135
  end
136
136
  end
137
137
 
138
- dns_zone.records.create(:name => fqdn, :type => 'CNAME', :value => subject.dns_name, :ttl => 5)
138
+ # Route53's API is not concurrently accessible
139
+ DNS_MUTEX.synchronize do
140
+ dns_zone.records.create(:name => fqdn, :type => 'CNAME', :value => subject.dns_name, :ttl => 5)
141
+ end
139
142
  log "#{fqdn} -> #{subject.dns_name}"
140
143
  return self
141
144
  end
142
145
 
146
+ def dns_name
147
+ subject && subject.dns_name
148
+ end
149
+
143
150
 
144
151
  private
145
152
 
146
-
147
153
  def default_options
148
154
  { :volumes => {} }
149
155
  end
@@ -211,7 +217,7 @@ module Guignol::Models
211
217
  unless dns_record_matches?(record)
212
218
  log "warning, while removing, DNS record exist but does not point to the current server"
213
219
  end
214
- record.destroy
220
+ DNS_MUTEX.synchronize { record.destroy }
215
221
  end
216
222
 
217
223
  return self
data/lib/guignol/shell.rb CHANGED
@@ -44,3 +44,4 @@ require 'guignol/commands/uuid'
44
44
  require 'guignol/commands/fix_dns'
45
45
  require 'guignol/commands/clone'
46
46
  require 'guignol/commands/execute'
47
+ require 'guignol/commands/dns'
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Guignol
3
- VERSION = "0.3.5.1"
3
+ VERSION = "0.3.6"
4
4
  end
@@ -6,19 +6,20 @@ describe Guignol::Configuration do
6
6
  let(:test_path) { Pathname.new 'tmp/test.yml' }
7
7
  let(:result) { subject.configuration }
8
8
 
9
- before do
10
- ENV['GUIGNOL_YML'] = test_path.to_s
11
- test_path.open('w') do |io|
12
- io.write config_data
9
+ shared_examples_for 'loaded config' do
10
+ before do
11
+ ENV['GUIGNOL_YML'] = test_path.to_s
12
+ test_path.open('w') do |io|
13
+ io.write config_data
14
+ end
13
15
  end
14
- end
15
16
 
16
- after do
17
- test_path.delete
18
- end
17
+ after do
18
+ test_path.delete
19
+ end
19
20
 
20
- shared_examples_for 'loaded config' do
21
21
  it 'should load' do
22
+ test_path.should exist
22
23
  result.should be_a_kind_of(Hash)
23
24
  end
24
25
 
data/spec/spec_helper.rb CHANGED
@@ -6,9 +6,11 @@ Fog.mock!
6
6
 
7
7
  ENV['GUIGNOL_ENV'] = 'test'
8
8
  ENV['GUIGNOL_LOG'] = '/dev/null'
9
+ ENV['AWS_SECRET_KEY_ID'] = 'aws-key-id'
10
+ ENV['AWS_SECRET_ACCESS_KEY'] = 'aws-password'
9
11
 
10
12
  RSpec.configure do |config|
11
13
  config.before do
12
- Fog::Mock.reset
14
+ Fog::Mock.reset
13
15
  end
14
- end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guignol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5.1
4
+ version: 0.3.6
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: 2012-10-18 00:00:00.000000000 Z
12
+ date: 2013-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 1.6.0
101
+ version: 1.9.0
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 1.6.0
109
+ version: 1.9.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: parallel
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.5.14
117
+ version: 0.6.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 0.5.14
125
+ version: 0.6.2
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: activesupport
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +182,7 @@ extra_rdoc_files: []
182
182
  files:
183
183
  - .gitignore
184
184
  - .rspec
185
+ - .ruby-version
185
186
  - Gemfile
186
187
  - Gemfile.lock
187
188
  - LICENCE
@@ -195,6 +196,7 @@ files:
195
196
  - lib/guignol/commands/base.rb
196
197
  - lib/guignol/commands/clone.rb
197
198
  - lib/guignol/commands/create.rb
199
+ - lib/guignol/commands/dns.rb
198
200
  - lib/guignol/commands/execute.rb
199
201
  - lib/guignol/commands/fix_dns.rb
200
202
  - lib/guignol/commands/kill.rb
@@ -232,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
234
  version: '0'
233
235
  segments:
234
236
  - 0
235
- hash: -3716300324724774277
237
+ hash: 3742329953402264220
236
238
  required_rubygems_version: !ruby/object:Gem::Requirement
237
239
  none: false
238
240
  requirements:
@@ -241,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
243
  version: 1.3.6
242
244
  requirements: []
243
245
  rubyforge_project:
244
- rubygems_version: 1.8.24
246
+ rubygems_version: 1.8.23
245
247
  signing_key:
246
248
  specification_version: 3
247
249
  summary: Manipulate Amazon EC2 instances