fezzik 0.7.3 → 0.7.4
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.
- data/README.md +9 -0
- data/lib/fezzik/base.rb +2 -2
- data/lib/fezzik/dsl.rb +1 -1
- data/lib/fezzik/io.rb +2 -0
- data/lib/fezzik/thread_local_io.rb +16 -14
- data/lib/fezzik/version.rb +1 -1
- metadata +5 -2
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
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(
|
|
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
|
-
|
|
26
|
-
|
|
25
|
+
module Fezzik
|
|
26
|
+
class ThreadLocalIO < IO
|
|
27
|
+
@@former_stdout = $stdout
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
data/lib/fezzik/version.rb
CHANGED
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.
|
|
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-
|
|
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:
|