rackamole 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/HISTORY CHANGED
@@ -70,4 +70,6 @@
70
70
  * Added growl notification alerts
71
71
 
72
72
  0.3.7 Updates to use the latest mongo ruby gem
73
- NOTE: Some api changed in this version of the mongo ruby driver and hosed OrderedHash refs.
73
+ NOTE: Some api changed in this version of the mongo ruby driver and hosed OrderedHash refs.
74
+
75
+ 0.3.8 Updates for ruby 1.9 compatibility
data/Rakefile CHANGED
@@ -34,4 +34,4 @@ depend_on "chronic" , ">= 0.2.3"
34
34
  depend_on "twitter4r" , ">= 0.3.0"
35
35
  depend_on "erubis" , ">= 2.6.0"
36
36
  depend_on "mail" , ">= 2.1.3"
37
- depend_on "ruby-growl" , ">= 1.0.1"
37
+ depend_on "ruby-growl" , ">= 2.0"
@@ -1,7 +1,7 @@
1
1
  module Rackamole
2
2
 
3
3
  # :stopdoc:
4
- VERSION = '0.3.7'
4
+ VERSION = '0.3.8'
5
5
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
6
6
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
7
7
  # :startdoc:
@@ -4,8 +4,8 @@ Type : 2
4
4
  App_name : "Test app"
5
5
  Environment : :test
6
6
  Ip : "1.1.1.1"
7
- Browser : {"name"=>"Ibrowse", "version"=>"1.X"}
8
- Machine : {"platform"=>"Blee", "os"=>"Windoze", "version"=>"10.0"}
7
+ Browser : {:name=>"Ibrowse", :version=>"1.X"}
8
+ Machine : {:platform=>"Blee", :os=>"Windoze", :version=>"10.0"}
9
9
  User_id : 100
10
10
  User_name : "Fernand"
11
11
  Request_time : 1.0
@@ -4,8 +4,8 @@ Type : 0
4
4
  App_name : "Test app"
5
5
  Environment : :test
6
6
  Ip : "1.1.1.1"
7
- Browser : {"name"=>"Ibrowse", "version"=>"1.X"}
8
- Machine : {"platform"=>"Blee", "os"=>"Windoze", "version"=>"10.0"}
7
+ Browser : {:name=>"Ibrowse", :version=>"1.X"}
8
+ Machine : {:platform=>"Blee", :os=>"Windoze", :version=>"10.0"}
9
9
  User_id : 100
10
10
  User_name : "Fernand"
11
11
  Request_time : 1.0
@@ -4,8 +4,8 @@ Type : 1
4
4
  App_name : "Test app"
5
5
  Environment : :test
6
6
  Ip : "1.1.1.1"
7
- Browser : {"name"=>"Ibrowse", "version"=>"1.X"}
8
- Machine : {"platform"=>"Blee", "os"=>"Windoze", "version"=>"10.0"}
7
+ Browser : {:name=>"Ibrowse", :version=>"1.X"}
8
+ Machine : {:platform=>"Blee", :os=>"Windoze", :version=>"10.0"}
9
9
  User_id : 100
10
10
  User_name : "Fernand"
11
11
  Request_time : 1.0
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
 
3
3
  describe Rackamole::Alert::Emole do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Alert::Growl do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Alert::Twitt do
@@ -1,34 +1,34 @@
1
- require File.join(File.dirname(__FILE__), %w[.. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. spec_helper]))
2
+
2
3
  require 'ostruct'
3
4
 
4
- describe Rackamole::Interceptor do
5
- before( :all ) do
6
- class Fred
7
- def rescue_action_in_public( exception )
8
- end
5
+ # Test application...
6
+ class Fred
7
+ def rescue_action_in_public( exception )
8
+ end
9
9
 
10
- def rescue_action_locally( exception )
11
- end
12
-
13
- def request
14
- @request ||= OpenStruct.new( :env => {} )
15
- end
16
-
17
- def self.alias_method_chain(target, feature)
18
- alias_method "#{target}_without_#{feature}", target
19
- alias_method target, "#{target}_with_#{feature}"
20
- end
21
-
22
- include Rackamole::Interceptor
23
- end
10
+ def rescue_action_locally( exception )
24
11
  end
25
-
12
+
13
+ def request
14
+ @request ||= OpenStruct.new( :env => {} )
15
+ end
16
+
17
+ def self.alias_method_chain(target, feature)
18
+ alias_method "#{target}_without_#{feature}", target
19
+ alias_method target, "#{target}_with_#{feature}"
20
+ end
21
+
22
+ include Rackamole::Interceptor
23
+ end
24
+
25
+ describe Rackamole::Interceptor do
26
26
  it "should include the correct methods" do
27
- Fred.instance_methods.should be_include( 'rescue_action_locally_without_mole' )
28
- Fred.private_instance_methods.should be_include( 'rescue_action_locally_with_mole' )
27
+ Fred.instance_methods.should be_include( :rescue_action_locally_without_mole )
28
+ Fred.private_instance_methods.should be_include( :rescue_action_locally_with_mole )
29
29
 
30
- Fred.instance_methods.should be_include( 'rescue_action_in_public_without_mole' )
31
- Fred.private_instance_methods.should be_include( 'rescue_action_in_public_with_mole' )
30
+ Fred.instance_methods.should be_include( :rescue_action_in_public_without_mole )
31
+ Fred.private_instance_methods.should be_include( :rescue_action_in_public_with_mole )
32
32
  end
33
33
 
34
34
  it "should set the env correctly when a local exception is raised" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. spec_helper] )
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. spec_helper]))
2
2
 
3
3
  require 'stringio'
4
4
 
@@ -24,7 +24,7 @@ describe Rackamole::Logger do
24
24
  it "logs to an IO stream if given" do
25
25
  io = StringIO.new
26
26
  l = Rackamole::Logger.new( { :log_file => io, :logger_name => "Test4" })
27
- l.info "This is a test io message"
27
+ l.info "This is a test io message"
28
28
  io.string.split("\n").should have(1).item
29
29
  io.string.should =~ /This is a test io message/
30
30
  io.string.should =~ /INFO/
@@ -1,5 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. spec_helper])
2
- # require 'action_controller'
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. spec_helper]))
3
2
 
4
3
  describe Rack::Mole do
5
4
  include Rack::Test::Methods
@@ -65,7 +64,7 @@ describe Rack::Mole do
65
64
  get "/", nil, @test_env
66
65
  rescue
67
66
  last_request.env['mole.stash'].should_not be_nil
68
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
67
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", File.join( File.dirname(__FILE__), "mole_spec.rb:43:in `block (2 levels) in error_app'" ) )
69
68
  fault.should_not be_nil
70
69
  fault.count.should == 1
71
70
  end
@@ -78,7 +77,7 @@ describe Rack::Mole do
78
77
  get "/", nil, env
79
78
  rescue
80
79
  last_request.env['mole.stash'].should_not be_nil
81
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
80
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", File.join( File.dirname(__FILE__), "mole_spec.rb:43:in `block (2 levels) in error_app'" ) )
82
81
  fault.should_not be_nil
83
82
  fault.count.should == i+1
84
83
  env = last_request.env
@@ -94,7 +93,7 @@ describe Rack::Mole do
94
93
  get "/#{i}", nil, env
95
94
  rescue => boom
96
95
  last_request.env['mole.stash'].should_not be_nil
97
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
96
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", File.join( File.dirname(__FILE__), "mole_spec.rb:43:in `block (2 levels) in error_app'" ) )
98
97
  fault.should_not be_nil
99
98
  fault.count.should == i+1
100
99
  env = last_request.env
@@ -193,7 +192,7 @@ describe Rack::Mole do
193
192
  rescue
194
193
  @test_store.mole_result[:stack].should have(4).items
195
194
  last_request.env['mole.stash'].should_not be_nil
196
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
195
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", File.join( File.dirname(__FILE__), "mole_spec.rb:43:in `block (2 levels) in error_app'" ) )
197
196
  fault.should_not be_nil
198
197
  fault.count.should == 1
199
198
  end
@@ -273,7 +272,7 @@ describe Rack::Mole do
273
272
  @test_store.mole_result[:stack].should have(4).items
274
273
  @test_store.mole_result[:fault].should == 'Oh snap!'
275
274
  last_request.env['mole.stash'].should_not be_nil
276
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:268" )
275
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", File.join( File.dirname(__FILE__), "mole_spec.rb:267:in `block (3 levels) in <top (required)>'" ) )
277
276
  fault.should_not be_nil
278
277
  fault.count.should == 1
279
278
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Stash::Collector do
@@ -18,7 +18,7 @@ describe Rackamole::Stash::Collector do
18
18
  fault = @collector.send( :find_fault, "/", boom.backtrace.first )
19
19
  fault.should_not be_nil
20
20
  fault.send( :path ).should == "/"
21
- fault.send( :stack ).should == "./spec/rackamole/stash/collector_spec.rb:13"
21
+ fault.send( :stack ).should == File.join( File.dirname(__FILE__), "collector_spec.rb:13:in `block (3 levels) in <top (required)>'" )
22
22
  fault.send( :timestamp ).should == @now
23
23
  end
24
24
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Stash::Fault do
@@ -12,7 +12,7 @@ describe Rackamole::Stash::Fault do
12
12
  rescue => boom
13
13
  fault = Rackamole::Stash::Fault.new( "/", boom.backtrace.first, @now )
14
14
  fault.send( :path ).should == "/"
15
- fault.send( :stack ).should == "./spec/rackamole/stash/fault_spec.rb:11"
15
+ fault.send( :stack ).should == File.join( File.dirname(__FILE__), "fault_spec.rb:11:in `block (2 levels) in <top (required)>'" )
16
16
  fault.send( :timestamp ).should == @now
17
17
  end
18
18
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Stash::Perf do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
 
3
3
  describe Rackamole::Store::Log do
4
4
  describe "#mole" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
  require 'chronic'
3
3
 
4
4
  describe Rackamole::Store::MongoDb do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper] )
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. spec_helper]))
2
2
 
3
3
  describe Rackamole::Utils::AgentDetect do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), %w[spec_helper])
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[spec_helper]))
2
2
 
3
3
  describe Rackamole do
4
4
  before( :all ) do
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ # require 'rubygems'
2
2
  require 'rack'
3
3
  require 'rack/test'
4
4
 
@@ -2,6 +2,21 @@
2
2
  if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
3
3
  require 'spec/rake/verify_rcov'
4
4
 
5
+ if defined?(Rcov)
6
+ puts "!!!!!! HERE !!!!!!!!!"
7
+ class Rcov::CodeCoverageAnalyzer
8
+ def update_script_lines__
9
+ puts "AAA"
10
+ if '1.9'.respond_to?(:force_encoding)
11
+ SCRIPT_LINES__.each do |k,v|
12
+ v.each { |src| src.force_encoding('utf-8') }
13
+ end
14
+ end
15
+ @script_lines__ = @script_lines__.merge(SCRIPT_LINES__)
16
+ end
17
+ end
18
+ end
19
+
5
20
  namespace :spec do
6
21
 
7
22
  desc 'Run all specs with basic output'
@@ -29,7 +44,8 @@ namespace :spec do
29
44
  t.libs += PROJ.libs
30
45
  t.rcov = true
31
46
  t.rcov_dir = PROJ.rcov.dir
32
- t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
47
+ t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'gems\/,spec\/', '--rails']
48
+ puts t.inspect
33
49
  end
34
50
 
35
51
  RCov::VerifyTask.new(:verify) do |t|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 7
9
- version: 0.3.7
8
+ - 8
9
+ version: 0.3.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Fernand Galiana
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-04 00:00:00 -06:00
17
+ date: 2010-06-12 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -151,10 +151,9 @@ dependencies:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
153
  segments:
154
- - 1
154
+ - 2
155
155
  - 0
156
- - 1
157
- version: 1.0.1
156
+ version: "2.0"
158
157
  type: :runtime
159
158
  version_requirements: *id010
160
159
  - !ruby/object:Gem::Dependency