fezzik 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -144,6 +144,15 @@ Fezzik.destination :prod do
144
144
  end
145
145
  ```
146
146
 
147
+ Fezzik accepts multiple destinations in the call to `Fezzik.destination`.
148
+ This can be useful if you have common environment variables shared across destinations.
149
+
150
+ ```ruby
151
+ Fezzik.destination :staging, :prod do
152
+ env :unicorn_workers, 4
153
+ end
154
+ ```
155
+
147
156
  You can access the environment settings in your tasks, if you like. It's a hash.
148
157
 
149
158
  ```ruby
data/lib/fezzik/base.rb CHANGED
@@ -11,8 +11,8 @@ module Fezzik
11
11
  end
12
12
  end
13
13
 
14
- def self.destination(name, &block)
15
- block.call if name == @target_destination
14
+ def self.destination(*names, &block)
15
+ block.call if names.include?(@target_destination)
16
16
  end
17
17
 
18
18
  def self.target_destination
data/lib/fezzik/dsl.rb CHANGED
@@ -6,7 +6,7 @@ module Fezzik
6
6
  def role(*args) Fezzik.role(*args) end
7
7
  end
8
8
  end
9
- def destination(name, &block) Fezzik.destination(name, &block) end
9
+ def destination(*names, &block) Fezzik.destination(*names, &block) end
10
10
  def env(*args) Fezzik.env(*args) end
11
11
  def capture_output(&block) Fezzik::Util.capture_output(&block) end
12
12
  end
data/lib/fezzik/io.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # Synchronize 'puts' because it's annoying to have interleaved output when rake remote task is running
2
2
  # several things at once in multiple threads (for instance: commands on multiple servers or commands as
3
3
  # multiple users).
4
+ #
5
+ # TODO(dmac): Is this made obsolete by thread_local_io.rb?
4
6
  class IO
5
7
  @@print_mutex = Mutex.new
6
8
  alias :old_puts :puts
@@ -22,24 +22,26 @@
22
22
  # thread2
23
23
  # thread1
24
24
 
25
- class ThreadLocalIO < IO
26
- @@former_stdout = $stdout
25
+ module Fezzik
26
+ class ThreadLocalIO < IO
27
+ @@former_stdout = $stdout
27
28
 
28
- def self.write(*args)
29
- if Thread.current[:stdout]
30
- Thread.current[:stdout].write(*args)
31
- else
32
- @@former_stdout.write(*args)
29
+ def self.write(*args)
30
+ if Thread.current[:stdout]
31
+ Thread.current[:stdout].write(*args)
32
+ else
33
+ @@former_stdout.write(*args)
34
+ end
33
35
  end
34
- end
35
36
 
36
- def self.flush
37
- if Thread.current[:stdout]
38
- Thread.current[:stdout].flush
39
- else
40
- @@former_stdout.flush
37
+ def self.flush
38
+ if Thread.current[:stdout]
39
+ Thread.current[:stdout].flush
40
+ else
41
+ @@former_stdout.flush
42
+ end
41
43
  end
42
44
  end
43
45
  end
44
46
 
45
- $stdout = ThreadLocalIO
47
+ $stdout = Fezzik::ThreadLocalIO
@@ -1,3 +1,3 @@
1
1
  module Fezzik
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fezzik
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
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-11-27 00:00:00.000000000 Z
13
+ date: 2012-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake-remote_task
@@ -103,6 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  - - ! '>='
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
+ segments:
107
+ - 0
108
+ hash: 3198673685344171649
106
109
  required_rubygems_version: !ruby/object:Gem::Requirement
107
110
  none: false
108
111
  requirements: