toad_notifier 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ toad_notifier (0.1)
5
+ activesupport
6
+ toadhopper (~> 2.1)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ activesupport (3.2.12)
12
+ i18n (~> 0.6)
13
+ multi_json (~> 1.0)
14
+ diff-lcs (1.2.4)
15
+ i18n (0.6.4)
16
+ multi_json (1.6.1)
17
+ rake (10.0.4)
18
+ rspec (2.13.0)
19
+ rspec-core (~> 2.13.0)
20
+ rspec-expectations (~> 2.13.0)
21
+ rspec-mocks (~> 2.13.0)
22
+ rspec-core (2.13.1)
23
+ rspec-expectations (2.13.0)
24
+ diff-lcs (>= 1.1.3, < 2.0)
25
+ rspec-mocks (2.13.1)
26
+ toadhopper (2.1)
27
+
28
+ PLATFORMS
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ rake
33
+ rspec
34
+ toad_notifier!
data/README.md ADDED
@@ -0,0 +1,5 @@
1
+ ToadNotifier
2
+
3
+ Convenience wrapper for ToadHopper gem.
4
+
5
+
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new do |t|
5
+ t.rspec_opts = ["--color", "--format", "documentation"]
6
+ t.pattern = "./**/*_spec.rb"
7
+ end
8
+
9
+ task :default => :spec
@@ -0,0 +1,3 @@
1
+ class ToadNotifier
2
+ VERSION = 0.1
3
+ end
@@ -0,0 +1,18 @@
1
+ require 'toadhopper'
2
+ require 'active_support/core_ext/hash/indifferent_access'
3
+
4
+ class ToadNotifier
5
+
6
+ def self.notify!(exception, options={})
7
+ Toadhopper.new(@@config[:api_key]).post!(exception, options)
8
+ end
9
+
10
+ def self.config=(config)
11
+ @@config = config.with_indifferent_access
12
+ end
13
+
14
+ def self.config
15
+ @@config
16
+ end
17
+
18
+ end
@@ -0,0 +1,2 @@
1
+ require_relative '../lib/toad_notifier'
2
+
@@ -0,0 +1,30 @@
1
+ require_relative 'spec_helper.rb'
2
+
3
+ describe ToadNotifier do
4
+
5
+ let(:exception) { double 'SomeException', :message => 'blah' }
6
+ let(:hopper) { double Toadhopper }
7
+
8
+ before :all do
9
+ ToadNotifier.config = {'api_key' => 'test key'}
10
+ end
11
+
12
+ it "#config" do
13
+ ToadNotifier.config.should == {'api_key' => 'test key'}
14
+ end
15
+
16
+ describe "#notify!" do
17
+ it "passes supplied data on to Toadhopper" do
18
+ options = {:some => "important_stuff"}
19
+ Toadhopper.should_receive(:new).with('test key').and_return hopper
20
+ hopper.should_receive(:post!).with(exception, options)
21
+ ToadNotifier.notify!(exception, options)
22
+ end
23
+
24
+ it "defaults options if none are provided" do
25
+ Toadhopper.should_receive(:new).with('test key').and_return hopper
26
+ hopper.should_receive(:post!).with(exception, {})
27
+ ToadNotifier.notify!(exception)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "toad_notifier/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "toad_notifier"
7
+ s.version = ToadNotifier::VERSION
8
+ s.authors = ["Glenn Roberts", "Ile Eftimov"]
9
+ s.email = ["glenn@siyelo.com", "ile@siyelo.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Hetzner wrapper for ToadHopper}
12
+ s.description = %q{Hetzner wrapper for ToadHopper}
13
+
14
+ s.rubyforge_project = "toad_notifier"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ s.add_development_dependency "rspec"
23
+ s.add_development_dependency "rake"
24
+ s.add_runtime_dependency "activesupport"
25
+ s.add_runtime_dependency "toadhopper", '~> 2.1'
26
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: toad_notifier
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Glenn Roberts
9
+ - Ile Eftimov
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-06-18 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: rake
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: activesupport
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: toadhopper
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ version: '2.1'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ version: '2.1'
79
+ description: Hetzner wrapper for ToadHopper
80
+ email:
81
+ - glenn@siyelo.com
82
+ - ile@siyelo.com
83
+ executables: []
84
+ extensions: []
85
+ extra_rdoc_files: []
86
+ files:
87
+ - Gemfile
88
+ - Gemfile.lock
89
+ - README.md
90
+ - Rakefile
91
+ - lib/toad_notifier.rb
92
+ - lib/toad_notifier/version.rb
93
+ - spec/spec_helper.rb
94
+ - spec/toad_notifier_spec.rb
95
+ - toad_notifier.gemspec
96
+ homepage: ''
97
+ licenses: []
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ segments:
109
+ - 0
110
+ hash: -2809266027088210016
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ segments:
118
+ - 0
119
+ hash: -2809266027088210016
120
+ requirements: []
121
+ rubyforge_project: toad_notifier
122
+ rubygems_version: 1.8.23
123
+ signing_key:
124
+ specification_version: 3
125
+ summary: Hetzner wrapper for ToadHopper
126
+ test_files:
127
+ - spec/spec_helper.rb
128
+ - spec/toad_notifier_spec.rb