Module: Ribbit
- Defined in:
- lib/ribbit.rb,
lib/ribbit/notice.rb,
lib/ribbit/sender.rb,
lib/ribbit/adapters.rb,
lib/ribbit/backtrace.rb,
lib/ribbit/adapters/merb.rb,
lib/ribbit/adapters/none.rb,
lib/ribbit/configuration.rb,
lib/ribbit/adapters/adapter.rb
Defined Under Namespace
Modules: Adapters Classes: Backtrace, Configuration, Notice, Sender
Constant Summary collapse
- CLIENT_NAME =
"Ribbit"
- VERSION =
"0.1.0.dev"
- API_VERSION =
"2.0"
- LOG_PREFIX =
"** [Ribbit] "
Class Attribute Summary collapse
-
.adapter ⇒ Object
The adapter allows different things to happen on different environments Basicially we proxy some methods through to subclasses of Ribbit::Adapters::Adapter.
-
.configuration ⇒ Object
A Hoptoad configuration object.
-
.sender ⇒ Object
The sender object is responsible for delivering formatted data to the Hoptoad server.
Class Method Summary collapse
-
.adapters ⇒ Object
Collection of all existing adapters.
-
.configure(silent = false) {|configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
-
.logger ⇒ Object
Proxy logger onto the adapter.
-
.notify(exception, opts = {}) ⇒ Object
Sends an exception manually using this method, even when you are not in a controller.
-
.notify_or_ignore(exception, opts = {}) ⇒ Object
Sends the notice unless it is one of the default ignored exceptions.
Class Attribute Details
.adapter ⇒ Object
The adapter allows different things to happen on different environments Basicially we proxy some methods through to subclasses of Ribbit::Adapters::Adapter
26 27 28 |
# File 'lib/ribbit.rb', line 26 def adapter @adapter end |
.configuration ⇒ Object
A Hoptoad configuration object. Must act like a hash and return sensible values for all Hoptoad configuration options. See Ribbit::Configuration.
21 22 23 |
# File 'lib/ribbit.rb', line 21 def configuration @configuration end |
.sender ⇒ Object
The sender object is responsible for delivering formatted data to the Hoptoad server. Must respond to #send_to_hoptoad. See Ribbit::Sender.
17 18 19 |
# File 'lib/ribbit.rb', line 17 def sender @sender end |
Class Method Details
.adapters ⇒ Object
Collection of all existing adapters
29 30 31 |
# File 'lib/ribbit.rb', line 29 def adapters Ribbit::Adapters.adapters end |
.configure(silent = false) {|configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ribbit.rb', line 45 def configure(silent = false) self.configuration ||= Configuration.new yield(configuration) self.sender = Sender.new(configuration) # Attempt to attach an adapter, either by class or name if adapters.include? configuration.adapter self.adapter = configuration.adapter.new(configuration) elsif configuration.adapter adapter_class = Ribbit::Adapters.load_adapter configuration.adapter self.adapter = adapter_class.new(configuration) rescue nil end self.adapter.activate! if self.adapter end |
.logger ⇒ Object
Proxy logger onto the adapter
34 35 36 |
# File 'lib/ribbit.rb', line 34 def logger adapter.logger if adapter end |
.notify(exception, opts = {}) ⇒ Object
Sends an exception manually using this method, even when you are not in a controller.
70 71 72 |
# File 'lib/ribbit.rb', line 70 def notify(exception, opts = {}) send_notice(build_notice_for(exception, opts)) end |
.notify_or_ignore(exception, opts = {}) ⇒ Object
Sends the notice unless it is one of the default ignored exceptions
76 77 78 79 |
# File 'lib/ribbit.rb', line 76 def notify_or_ignore(exception, opts = {}) notice = build_notice_for(exception, opts) send_notice(notice) unless notice.ignore? end |