exceptional 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/bin/exceptional CHANGED
@@ -10,6 +10,9 @@ case command
10
10
  help # Show this usage.
11
11
  test # Send a test exception to Exceptional.
12
12
  install <api_key> # Create config/exceptional.yml with your api_key. Overrites existing one.
13
+ install <api_key> <environment> # Create config/exceptional.yml with your api_key and enabled for a specific environment. Overrites existing config file.
14
+ install <api_key> <environment>,<environment> # Create config/exceptional.yml with your api_key enabled for multiple environments (comma seperated). Overrites existing config file.
15
+
13
16
  USAGE
14
17
  when 'test'
15
18
  if defined?(RAILS_ROOT)
@@ -30,6 +33,8 @@ USAGE
30
33
  end
31
34
  when 'install'
32
35
  api_key = args[0]
36
+ environments = args[1]
37
+
33
38
  if (api_key.nil?)
34
39
  puts 'Missing required paramater <api-key>. Check your app configuration at http://getexceptional.com.'
35
40
  else
@@ -41,6 +46,19 @@ USAGE
41
46
  end
42
47
  config_file = File.open('config/exceptional.yml', 'w')
43
48
  config_file.puts("api-key: #{api_key}\n")
49
+
50
+ unless(environments.nil?)
51
+ environments.split(',').each do |envo|
52
+ config_file.puts("#{envo}:\n")
53
+ config_file.puts(" enabled: true\n")
54
+ end
55
+ end
56
+
44
57
  config_file.close
45
- puts "Config file written as config/exceptional.yml."
58
+ puts "Config file written as config/exceptional.yml.";
59
+ puts "----------------------------------------------";
60
+ File.open('config/exceptional.yml').readlines.each do |line|
61
+ puts line
62
+ end
63
+ puts "----------------------------------------------";
46
64
  end
data/exceptional.gemspec CHANGED
@@ -1,15 +1,17 @@
1
1
  # -*- encoding: utf-8 -*-
2
- Gem::Specification.new do |s|
3
- s.name = %q{exceptional}
4
- s.version = "2.0.7"
5
- s.authors = ["Contrast"]
6
- s.summary = %q{ getexceptional.com is a hosted service for tracking errors in your Ruby/Rails/Rack apps }
7
- s.description = %q{Exceptional is the Ruby gem for communicating with http://getexceptional.com (hosted error tracking service). Use it to find out about errors that happen in your live app. It captures lots of helpful information to help you fix the errors.}
8
- s.email = %q{hello@contrast.ie}
9
- s.files = Dir['lib/**/*'] + Dir['spec/**/*'] + Dir['spec/**/*'] + Dir['rails/**/*'] + Dir['tasks/**/*'] + Dir['*.rb'] + ["exceptional.gemspec"]
10
- s.homepage = %q{http://getexceptional.com/}
11
- s.require_paths = ["lib"]
12
- s.executables << 'exceptional'
13
- s.rubyforge_project = %q{exceptional}
14
- s.requirements << "json_pure, json-jruby or json gem required"
2
+ require File.expand_path('../lib/exceptional/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = %q{exceptional}
6
+ gem.version = Exceptional::VERSION
7
+ gem.authors = ["Contrast"]
8
+ gem.summary = %q{ getexceptional.com is a hosted service for tracking errors in your Ruby/Rails/Rack apps }
9
+ gem.description = %q{Exceptional is the Ruby gem for communicating with http://getexceptional.com (hosted error tracking service). Use it to find out about errors that happen in your live app. It captures lots of helpful information to help you fix the errors.}
10
+ gem.email = %q{hello@contrast.ie}
11
+ gem.files = Dir['lib/**/*'] + Dir['spec/**/*'] + Dir['spec/**/*'] + Dir['rails/**/*'] + Dir['tasks/**/*'] + Dir['*.rb'] + ["exceptional.gemspec"]
12
+ gem.homepage = %q{http://getexceptional.com/}
13
+ gem.require_paths = ["lib"]
14
+ gem.executables << 'exceptional'
15
+ gem.rubyforge_project = %q{exceptional}
16
+ gem.requirements << "json_pure, json-jruby or json gem required"
15
17
  end
data/init.rb CHANGED
@@ -15,7 +15,9 @@ if (defined?(Exceptional::VERSION::STRING) rescue nil) && %w(development test).i
15
15
  else
16
16
  begin
17
17
  Exceptional::Config.load(File.join(RAILS_ROOT, "/config/exceptional.yml"))
18
- Exceptional::Startup.announce
18
+ if Exceptional::Config.should_send_to_api?
19
+ Exceptional::Startup.announce
20
+ end
19
21
  require File.join('exceptional', 'integration', 'rails')
20
22
  rescue => e
21
23
  STDERR.puts "Problem starting Exceptional Plugin. Your app will run as normal."
data/lib/exceptional.rb CHANGED
@@ -10,11 +10,10 @@ require 'exceptional/controller_exception_data'
10
10
  require 'exceptional/rack_exception_data'
11
11
  require 'exceptional/remote'
12
12
  require 'exceptional/integration/rack'
13
+ require 'exceptional/version'
13
14
 
14
15
  module Exceptional
15
-
16
16
  PROTOCOL_VERSION = 5
17
- VERSION = '2.0.7'
18
17
  CLIENT_NAME = 'getexceptional-gem'
19
18
 
20
19
  def self.logger
@@ -9,7 +9,7 @@ module Exceptional
9
9
  :disabled_by_default => %w(development test)
10
10
  }
11
11
 
12
- attr_accessor :api_key
12
+ attr_accessor :api_key, :enabled
13
13
  attr_accessor :http_proxy_host, :http_proxy_port, :http_proxy_username, :http_proxy_password
14
14
  attr_writer :ssl
15
15
 
@@ -4,9 +4,16 @@ require 'rack'
4
4
  module Rack
5
5
  class Exceptional
6
6
 
7
- def initialize(app, exceptional_config = "config/exceptional.yml")
7
+ def initialize(app, api_key = nil)
8
8
  @app = app
9
- ::Exceptional::Config.load(exceptional_config)
9
+ if api_key.nil?
10
+ exceptional_config = "config/exceptional.yml"
11
+ ::Exceptional::Config.load(exceptional_config)
12
+ else
13
+ ::Exceptional.configure(api_key)
14
+ ::Exceptional::Config.enabled = true
15
+ ::Exceptional.logger.info "Enabling Exceptional for Rack"
16
+ end
10
17
  end
11
18
 
12
19
  def call(env)
@@ -0,0 +1,6 @@
1
+ if defined? Sinatra::Request
2
+ error do
3
+ Exceptional.handle_with_rack(request.env['sinatra.error'], request.env, request)
4
+ raise request.env['sinatra.error']
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module Exceptional
2
+ VERSION = '2.0.8'
3
+ end
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'exceptional', 'integrati
3
3
 
4
4
  describe Exceptional, 'version number' do
5
5
  it "be available proramatically" do
6
- Exceptional::VERSION.should == '2.0.7'
6
+ Exceptional::VERSION.should =~ /\d+\.\d+\.\d+/
7
7
  end
8
8
  end
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptional
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contrast
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-27 00:00:00 +00:00
12
+ date: 2010-02-02 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -29,11 +29,13 @@ files:
29
29
  - lib/exceptional/exception_data.rb
30
30
  - lib/exceptional/integration/rack.rb
31
31
  - lib/exceptional/integration/rails.rb
32
+ - lib/exceptional/integration/sinatra.rb
32
33
  - lib/exceptional/integration/tester.rb
33
34
  - lib/exceptional/log_factory.rb
34
35
  - lib/exceptional/rack_exception_data.rb
35
36
  - lib/exceptional/remote.rb
36
37
  - lib/exceptional/startup.rb
38
+ - lib/exceptional/version.rb
37
39
  - lib/exceptional.rb
38
40
  - spec/bin/ginger
39
41
  - spec/exceptional/catcher_spec.rb