Class: Undine
- Inherits:
-
Object
- Object
- Undine
- Defined in:
- lib/undine.rb,
lib/undine/version.rb,
lib/undine/configuration.rb
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- VERSION =
'0.2.0'
Class Method Summary collapse
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
- .load ⇒ Object
- .process(exception) ⇒ Object
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Undine
constructor
A new instance of Undine.
- #process(exception) ⇒ Object
- #query_message_from(exception) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Undine
Returns a new instance of Undine.
21 22 23 |
# File 'lib/undine.rb', line 21 def initialize(configuration) @configuration = configuration end |
Class Method Details
.configuration ⇒ Object
4 5 6 |
# File 'lib/undine/configuration.rb', line 4 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
8 9 10 |
# File 'lib/undine/configuration.rb', line 8 def self.configure yield configuration end |
.load ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/undine.rb', line 9 def self.load at_exit do exception = $ERROR_INFO Undine.process(exception) unless exception.nil? end end |
.process(exception) ⇒ Object
17 18 19 |
# File 'lib/undine.rb', line 17 def self.process(exception) new(Undine.configuration).process(exception) end |
Instance Method Details
#process(exception) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/undine.rb', line 25 def process(exception) return if ignore?(exception) url = "https://www.google.com/search?q=#{CGI.escape((exception))}" system "open '#{url}'" end |
#query_message_from(exception) ⇒ Object
33 34 35 |
# File 'lib/undine.rb', line 33 def (exception) @configuration..call(exception) end |