Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added always_notify to Config to be able to notify regardless of

RACK_ENV.
  • Loading branch information...
commit 44af136ed1f40feb6f3595d3e892d04002c42aed 1 parent c4f2cb2
Grzesiek Kolodziejczyk authored
Showing with 10 additions and 5 deletions.
  1. +2 −1  README.markdown
  2. +4 −4 lib/lilypad.rb
  3. +4 −0 lib/lilypad/config.rb
3  README.markdown
View
@@ -120,6 +120,7 @@ Lilypad do
log nil # Path of Hoptoad log
rails # Requires the Rails adapter
sinatra # Requires the Sinatra adapter
+ always_notify # notify regardless of RACK_ENV
end
</pre>
@@ -131,4 +132,4 @@ Tested with Ruby 1.8.6, 1.8.7, and 1.9.1.
Thanks
------
-Lilypad wouldn't have happened without [rack_hoptoad](http://github.com/atmos/rack_hoptoad), [toadhopper](http://github.com/toolmantim/toadhopper), [Builder](http://builder.rubyforge.org), and [Nokogiri](http://nokogiri.org).
+Lilypad wouldn't have happened without [rack_hoptoad](http://github.com/atmos/rack_hoptoad), [toadhopper](http://github.com/toolmantim/toadhopper), [Builder](http://builder.rubyforge.org), and [Nokogiri](http://nokogiri.org).
8 lib/lilypad.rb
View
@@ -24,17 +24,17 @@ def deploy(options)
end
def notify(exception, env=nil)
- if active? && production?
+ if active? && should_notify?
Hoptoad::Notify.new env, exception
end
end
- def production?
- Config.environments.include? ENV['RACK_ENV']
+ def should_notify?
+ Config.always_notify || Config.environments.include?(ENV['RACK_ENV'])
end
end
end
def Lilypad(api_key=nil, &block)
Lilypad.config api_key, &block
-end
+end
4 lib/lilypad/config.rb
View
@@ -40,6 +40,10 @@ def rails
def sinatra
require "#{File.dirname(__FILE__)}/adapters/sinatra"
end
+
+ def always_notify(always_notify=true)
+ @always_notify = always_notify
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.