Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adhearsion 3 #15

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.gem
*.rbc
.sw*
.*.sw*
.bundle
.config
.yardoc
Expand Down
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
language: ruby
rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
- jruby-19mode
- 2.2.4
- jruby-9.0.0.0
- rbx-19mode
- ruby-head
matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ Adhearsion::Reporter.config.email = {
Copyright
---------

Copyright (C) 2012 Adhearsion Foundation Inc.
Copyright (C) 2012-2015 Adhearsion Foundation Inc.
Released under the MIT License - Check [License file](https://github.com/adhearsion/adhearsion-reporter/blob/master/LICENSE)
2 changes: 1 addition & 1 deletion adhearsion-reporter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EOF
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency "adhearsion", ["~> 2.0"]
s.add_runtime_dependency "adhearsion", ["~> 3.0.0.beta"]
s.add_runtime_dependency "toadhopper", [">= 1.3.0"]
s.add_runtime_dependency "newrelic_rpm", ["~> 3.6"]
s.add_runtime_dependency "pony", ["~> 1.10"]
Expand Down
4 changes: 2 additions & 2 deletions lib/adhearsion/reporter/airbrake_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class AirbrakeNotifier
def init
@notifier = Toadhopper.new Reporter.config.api_key, :notify_host => Reporter.config.url
@options = {
framework_env: Adhearsion.config.platform.environment,
framework_env: Adhearsion.environment,
notifier_name: 'adhearsion-reporter',
notifier_version: Adhearsion::Reporter::VERSION,
project_root: Adhearsion.config.platform[:root],
project_root: Adhearsion.root,
environment: {
'HOSTNAME' => Socket.gethostname,
'AHN_VERSION' => Adhearsion::VERSION
Expand Down
2 changes: 1 addition & 1 deletion lib/adhearsion/reporter/email_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def exception_text(exception)
end

def environment
Adhearsion.config.platform.environment.to_s.upcase
Adhearsion.environment.to_s.upcase
end

def hostname
Expand Down
6 changes: 3 additions & 3 deletions spec/reporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def self.method_missing(m, *args, &block)
end

context "with an environment set" do
before { Adhearsion.config.platform.environment = :foo }
before { Adhearsion.environment = :foo }

it "notifies airbrake with that environment" do
expect(mock_notifier).to receive(:post!).at_least(:once).with(event_error, hash_including(framework_env: :foo)).and_return(response)
Expand All @@ -78,7 +78,7 @@ def self.method_missing(m, *args, &block)

context "in excluded environments" do
before do
Adhearsion.config.platform.environment = :development
Adhearsion.environment = :development
Adhearsion::Plugin.init_plugins
end
it "should not report errors for excluded environments" do
Expand Down Expand Up @@ -144,7 +144,7 @@ def self.method_missing(m, *args, &block)
event_error.set_backtrace(fake_backtrace)

hostname = Socket.gethostname
environment = Adhearsion.config.platform.environment.to_s.upcase
environment = Adhearsion.environment.to_s.upcase

Timecop.freeze(time_freeze) do
expect(Pony).to receive(:mail).at_least(:once).with({
Expand Down