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 +3 -1
- data/Rakefile +1 -1
- data/lib/rackamole.rb +1 -1
- data/spec/expected_results/mole_exception.log +2 -2
- data/spec/expected_results/mole_feature.log +2 -2
- data/spec/expected_results/mole_perf.log +2 -2
- data/spec/rackamole/alert/emole_spec.rb +1 -1
- data/spec/rackamole/alert/growl_spec.rb +1 -1
- data/spec/rackamole/alert/twitt_spec.rb +1 -1
- data/spec/rackamole/interceptor_spec.rb +25 -25
- data/spec/rackamole/logger_spec.rb +2 -2
- data/spec/rackamole/mole_spec.rb +6 -7
- data/spec/rackamole/stash/collector_spec.rb +2 -2
- data/spec/rackamole/stash/fault_spec.rb +2 -2
- data/spec/rackamole/stash/perf_spec.rb +1 -1
- data/spec/rackamole/store/log_spec.rb +1 -1
- data/spec/rackamole/store/mongo_db_spec.rb +1 -1
- data/spec/rackamole/utils/agent_detect_spec.rb +1 -1
- data/spec/rackamole_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/tasks/spec.rake +17 -1
- metadata +5 -6
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
data/lib/rackamole.rb
CHANGED
@@ -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 : {
|
8
|
-
Machine : {
|
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 : {
|
8
|
-
Machine : {
|
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 : {
|
8
|
-
Machine : {
|
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,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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
5
|
+
# Test application...
|
6
|
+
class Fred
|
7
|
+
def rescue_action_in_public( exception )
|
8
|
+
end
|
9
9
|
|
10
|
-
|
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(
|
28
|
-
Fred.private_instance_methods.should be_include(
|
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(
|
31
|
-
Fred.private_instance_methods.should be_include(
|
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/
|
data/spec/rackamole/mole_spec.rb
CHANGED
@@ -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, "/", "
|
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, "/", "
|
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, "/", "
|
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, "/", "
|
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, "/", "
|
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 == "
|
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 == "
|
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
|
data/spec/rackamole_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/tasks/spec.rake
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.3.
|
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-
|
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
|
-
-
|
154
|
+
- 2
|
155
155
|
- 0
|
156
|
-
|
157
|
-
version: 1.0.1
|
156
|
+
version: "2.0"
|
158
157
|
type: :runtime
|
159
158
|
version_requirements: *id010
|
160
159
|
- !ruby/object:Gem::Dependency
|