chap 0.0.2 → 0.0.3

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/lib/chap/config.rb CHANGED
@@ -102,7 +102,7 @@ module Chap
102
102
  @logger
103
103
  end
104
104
 
105
- def run(cmd)
105
+ def run(cmd)
106
106
  log "Running: #{cmd}"
107
107
  cmd = "#{cmd} 2>&1" unless cmd.include?(" > ")
108
108
  out = `#{cmd}`
data/lib/chap/hook.rb CHANGED
@@ -6,6 +6,7 @@ module Chap
6
6
  def initialize(path, config)
7
7
  @path = path
8
8
  @config = config
9
+ @with = nil
9
10
  end
10
11
 
11
12
  def evaluate
@@ -27,5 +28,16 @@ module Chap
27
28
  end
28
29
  end
29
30
 
31
+ def with(prepend)
32
+ prev, @with = @with, prepend
33
+ yield
34
+ @with = prev
35
+ end
36
+
37
+ def run(cmd)
38
+ cmd = "#{@with} #{cmd}"
39
+ config.run(cmd)
40
+ end
41
+
30
42
  end
31
43
  end
data/lib/chap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chap
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake