ey-deploy 0.2.4.pre1 → 0.2.4.pre2

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,11 +128,40 @@ module EY
128
128
 
129
129
  # before_symlink
130
130
  # before_restart
131
+
132
+ class CallbackContext
133
+ def initialize(deploy)
134
+ @deploy = deploy
135
+ end
136
+
137
+ def method_missing(meth, *args, &blk)
138
+ if @deploy.respond_to?(meth)
139
+ @deploy.send(meth, *args, &blk)
140
+ elsif @deploy.config.respond_to?(meth)
141
+ @deploy.config.send(meth, *args, &blk)
142
+ else
143
+ super
144
+ end
145
+ end
146
+
147
+ def respond_to(meth)
148
+ if @deploy.respond_to?(meth) || @deploy.config.respond_to?(meth)
149
+ true
150
+ else
151
+ super
152
+ end
153
+ end
154
+ end
155
+
156
+ def callback_context
157
+ @context ||= CallbackContext.new(self)
158
+ end
159
+
131
160
  def callback(what)
132
161
  if File.exist?("#{c.latest_release}/deploy/#{what}.rb")
133
162
  Dir.chdir(c.latest_release) do
134
163
  puts "~> running deploy hook: deploy/#{what}.rb"
135
- instance_eval(IO.read("#{c.latest_release}/deploy/#{what}.rb"))
164
+ callback_context.instance_eval(IO.read("#{c.latest_release}/deploy/#{what}.rb"))
136
165
  end
137
166
  end
138
167
  end
@@ -1,3 +1,3 @@
1
1
  module EY
2
- VERSION = "0.2.4.pre1"
2
+ VERSION = "0.2.4.pre2"
3
3
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 2
8
8
  - 4
9
- - pre1
10
- version: 0.2.4.pre1
9
+ - pre2
10
+ version: 0.2.4.pre2
11
11
  platform: ruby
12
12
  authors:
13
13
  - EY Cloud Team
@@ -15,7 +15,7 @@ autorequire: ey-deploy
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-23 00:00:00 -07:00
18
+ date: 2010-04-02 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency