fezzik 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +16 -0
  2. data/bin/fezify +1 -1
  3. data/fezzik.gemspec +1 -1
  4. data/lib/fezzik.rb +8 -0
  5. metadata +4 -4
data/README.md CHANGED
@@ -38,3 +38,19 @@ Ready to deploy!
38
38
  $ fez to_prod deploy
39
39
  ...
40
40
  fezzik deployed!
41
+
42
+ ## Utilities
43
+
44
+ Fezzik exposes some utilities that can be useful when running remote tasks.
45
+
46
+ **capture\_output(&block)**
47
+
48
+ Use this function if you would like to hide or capture the normal output that the "run" command prints.
49
+
50
+ remote_task :my_task
51
+ # Nothing is printed to stdout
52
+ server_output = capture_output { run "echo 'hello'"}
53
+
54
+ # prints "hello"
55
+ puts server_output
56
+ end
data/bin/fezify CHANGED
@@ -91,7 +91,7 @@ namespace :fezzik do
91
91
 
92
92
  desc "runs the executable in project/bin"
93
93
  remote_task :start do
94
- puts "starting from #\{release_path\}"
94
+ puts "starting from #\{capture_output \{ run \"readlink #\{current_path\}\" \}\}"
95
95
  run "cd #\{current_path\} && source config/environment.sh" +
96
96
  " && ./bin/run_app.sh"
97
97
  end
data/fezzik.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fezzik"
3
- s.version = "0.1.6"
3
+ s.version = "0.2.0"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">=0") if s.respond_to? :required_rubygems_version=
6
6
  s.specification_version = 2 if s.respond_to? :specification_version=
data/lib/fezzik.rb CHANGED
@@ -40,4 +40,12 @@ namespace :fezzik do
40
40
  def env(key, value)
41
41
  @environment[key] = value
42
42
  end
43
+
44
+ def capture_output(&block)
45
+ output = StringIO.new
46
+ $stdout = output
47
+ block.call
48
+ $stdout = STDOUT
49
+ output.string
50
+ end
43
51
  end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 6
10
- version: 0.1.6
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel MacDougall
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-23 00:00:00 -07:00
18
+ date: 2011-05-25 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency