Permalink
Browse files

Logging deploys properly

  • Loading branch information...
1 parent 9b66aea commit 5ff65a13c41d89c54b203b9be653fcb0d5812594 @winton committed Dec 7, 2009
Showing with 15 additions and 4 deletions.
  1. +8 −2 lib/lilypad/hoptoad/deploy.rb
  2. +1 −1 lib/lilypad/hoptoad/xml.rb
  3. +6 −1 lib/lilypad/log.rb
@@ -13,14 +13,20 @@ def initialize(options)
rescue Exception => e
end
- log :debug, @response
+ log :deploy, @response
success?
end
+ class <<self
+ def last_request
+ defined?(@@last_request) ? @@last_request : nil
+ end
+ end
+
private
def params
- {
+ @@last_request = {
'api_key' => api_key,
'deploy[local_username]' => @options[:username],
'deploy[rails_env]' => @options[:environment],
@@ -53,7 +53,7 @@ def build(backtrace, env, exception, params, request_path)
end
def last_request
- @@last_request
+ defined?(@@last_request) ? @@last_request : nil
end
end
end
View
@@ -40,7 +40,12 @@ def title
end
def xml_request
- Hoptoad::XML.last_request
+ case @type
+ when :deploy then
+ Hoptoad::Deploy.last_request
+ when :notify then
+ Hoptoad::XML.last_request
+ end
end
end
end

0 comments on commit 5ff65a1

Please sign in to comment.