auger 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Gemfile +1 -0
  2. data/README.md +20 -5
  3. data/VERSION +1 -1
  4. data/lib/auger/project.rb +12 -3
  5. metadata +3 -3
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gem 'rainbow'
6
6
  gem 'net-dns'
7
7
  gem 'redis'
8
8
  gem 'json'
9
+ gem 'net-ssh-gateway'
9
10
 
10
11
  group :development do
11
12
  gem 'gemcutter'
data/README.md CHANGED
@@ -68,7 +68,7 @@ Reference config files using `aug foo`, to find `foo.rb` in
68
68
  ```ruby
69
69
  project "Front-end Web Servers" do
70
70
  server "web-fe-[01-02]"
71
-
71
+
72
72
  http 8000 do
73
73
  get '/' do
74
74
  test 'status code is 200' do |response|
@@ -126,7 +126,7 @@ Let's extend our example to be more interesting.
126
126
  project "Front-end Web Servers" do
127
127
  server 'web-fe-[01-02]', :web
128
128
  server 'www.mydomain.com', :vip, :port => 80
129
-
129
+
130
130
  socket 8000 do
131
131
  roles :web
132
132
  open? do
@@ -167,11 +167,26 @@ Servers can also have a hash of options, which will override
167
167
  the matching connection options for just that server. In this case
168
168
  we want to connect to port 80 on the vip rather than 8000.
169
169
 
170
+ Server names may be given as strings (which will be parsed by HostRange),
171
+ as arrays (or expressions returning arrays), or as a block returning
172
+ an array. All arrays will be flattened. Hence the following are all
173
+ equivalent:
174
+
175
+ ```ruby
176
+ server "foo1", "foo2", "foo3"
177
+ server "foo[1-3]"
178
+ server HostRange.parse("foo[1-3]")
179
+ server [ "foo1", "foo2", "foo3" ]
180
+ server do
181
+ %w{ foo1 foo2 foo3 }
182
+ end
183
+ ```
184
+
170
185
  The `header` command demonstrates setting options for a request,
171
186
  in this case setting an http request header.
172
187
 
173
188
  The `socket` command creates a connection to the given port, and
174
- `open?` returns true if the port is open. We just apply this to
189
+ `open?` returns true if the port is open. We just apply this to
175
190
  the real web servers and not the vip.
176
191
 
177
192
  The document title test demonstrates how to extract and return a regex
@@ -228,9 +243,9 @@ project "Elasticsearch" do
228
243
  end
229
244
  end
230
245
 
231
- # I've discovered that a typical fail case with elasticsearch is
246
+ # I've discovered that a typical fail case with elasticsearch is
232
247
  # that on occassion, nodes will come up and not join the cluster
233
- # This is an easy way to see if the number of nodes that the host
248
+ # This is an easy way to see if the number of nodes that the host
234
249
  # actually sees (actual_data_nodes) matches what we're
235
250
  # expecting (expected_data_nodes).
236
251
  # TODO: dynamically update expected_data_nodes based on defined hosts:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.4.2
data/lib/auger/project.rb CHANGED
@@ -4,7 +4,7 @@ module Auger
4
4
 
5
5
  class Project
6
6
  attr_accessor :name, :connections, :servers
7
-
7
+
8
8
  def self.load(name, &block)
9
9
  project = new(name)
10
10
  project.instance_eval(&block)
@@ -20,10 +20,19 @@ module Auger
20
20
 
21
21
  ## set server, or list of server names, with optional roles and options
22
22
  ## e.g. server server1, server2, :roleA, :roleB, options => values
23
+ ## servers can be any combination in:
24
+ ## strings: passed through HostRange to make an array
25
+ ## array: or expressions that returns an array
26
+ ## block: returning an array (arrays will be flattened)
27
+ ## roles are symbols
28
+ ## options are hash members, must be last args
23
29
  def server(*args)
24
30
  options = args.last.is_a?(Hash) ? args.pop : {}
25
31
  roles = args.select { |arg| arg.class == Symbol }
26
- servers = args.select { |arg| arg.class == String }.map { |arg| HostRange.parse(arg) }
32
+ servers =
33
+ args.select { |arg| arg.class == String }.map { |arg| HostRange.parse(arg) } +
34
+ args.select { |arg| arg.class == Array } +
35
+ (block_given? ? yield : [])
27
36
  @servers += servers.flatten.map do |name|
28
37
  Auger::Server.new(name, *roles, options)
29
38
  end
@@ -60,5 +69,5 @@ module Auger
60
69
  end
61
70
 
62
71
  end
63
-
72
+
64
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-27 00:00:00.000000000 Z
13
+ date: 2012-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 1.8.23
153
+ rubygems_version: 1.8.24
154
154
  signing_key:
155
155
  specification_version: 3
156
156
  summary: App && infrastructure testing DSL