rackamole 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source :rubygems
2
2
 
3
+ gem 'rake'
3
4
  gem "logging"
4
5
  gem "hitimes"
5
6
  gem "mongo" , ">= 1.0.1"
@@ -15,4 +16,10 @@ group :development do
15
16
  gem "bones"
16
17
  gem "bones-git"
17
18
  gem "bones-extras"
19
+ end
20
+
21
+ group :test do
22
+ # gem "simplecov"
23
+ # gem "rcov"
24
+ gem "rspec"
18
25
  end
@@ -17,6 +17,7 @@ GEM
17
17
  chronic (0.2.3)
18
18
  hoe (>= 1.2.1)
19
19
  configuration (0.0.5)
20
+ diff-lcs (1.1.2)
20
21
  erubis (2.6.6)
21
22
  abstract (>= 1.0.0)
22
23
  git (1.2.5)
@@ -41,6 +42,14 @@ GEM
41
42
  bson (>= 1.0.4)
42
43
  polyglot (0.3.1)
43
44
  rake (0.8.7)
45
+ rspec (2.6.0)
46
+ rspec-core (~> 2.6.0)
47
+ rspec-expectations (~> 2.6.0)
48
+ rspec-mocks (~> 2.6.0)
49
+ rspec-core (2.6.4)
50
+ rspec-expectations (2.6.0)
51
+ diff-lcs (~> 1.1.2)
52
+ rspec-mocks (2.6.0)
44
53
  ruby-growl (2.0)
45
54
  rubyforge (2.0.4)
46
55
  json_pure (>= 1.1.7)
@@ -64,5 +73,7 @@ DEPENDENCIES
64
73
  logging
65
74
  mail
66
75
  mongo (>= 1.0.1)
76
+ rake
77
+ rspec
67
78
  ruby-growl
68
79
  twitter4r (>= 0.3.0)
@@ -52,23 +52,15 @@
52
52
 
53
53
  === Rails applications
54
54
 
55
- Edit your environment.rb file and add the following lines:
55
+ Edit your environments ruby files and add the following lines:
56
56
 
57
- require 'rackamole'
58
57
  config.middleware.use Rack::Mole, { :app_name => "My Cool App", :user_key => :user_name }
59
58
 
60
59
  This instructs the mole to start logging information to the console and look for the user name
61
- in the session using the :user_name key. There are other options available, please take a look
62
- at the docs for more information.
63
-
64
- Given Rails exception handling logic, you can also edit your application_controller.rb file and
65
- include the mole interceptor to trap exceptions in production environment
66
-
67
- class ApplicationController
68
- include Rackamole::Interceptor
69
-
70
- This will instruct the mole to trap the raised exception from your rails stack.
71
-
60
+ in the session using the :user_name key. In order to associate an action with a logged in user you
61
+ must set a session env variable, in this case we use user_name. There are other options available,
62
+ please take a look at the docs for more information.
63
+
72
64
  === Sinatra Applications
73
65
 
74
66
  Add the following lines in the config section and smoke it...
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Bones {
13
13
  readme_file 'README.rdoc'
14
14
  email 'fernand.galiana@gmail.com'
15
15
  url 'http://www.rackamole.com'
16
- spec.opts %w[--color]
16
+ # spec.opts %w[--color]
17
17
  ruby_opts %w[-W0]
18
18
 
19
19
  # Dependencies
@@ -419,7 +419,8 @@ module Rack
419
419
  return nil unless defined?( RAILS_ENV )
420
420
  # Check for invalid route exception...
421
421
  begin
422
- return ::ActionController::Routing::Routes.recognize_path( request.path, {:method => request.request_method.downcase.to_sym } )
422
+ return Rails.application.routes.recognize_path( request.path, {:method => request.request_method.downcase.to_sym } )
423
+ # return ::ActionController::Routing::Routes.recognize_path( request.path, {:method => request.request_method.downcase.to_sym } )
423
424
  rescue => boom
424
425
  return nil
425
426
  end
@@ -60,12 +60,12 @@ module Rackamole::Utils
60
60
  machine_info = match[1]
61
61
  tokens = machine_info.split( ";" )
62
62
  unless tokens.empty?
63
- index = 1
64
- platform = tokens[0].strip
63
+ platform = tokens.shift.strip
65
64
  @info[:machine][:platform] = platform
66
65
 
67
- index += 1 if tokens[1].match( /[MSIE|U]/ )
68
- os = tokens[index].match( /(.+)\s([\w\d|\.]+)/ )
66
+ os_info = tokens.shift
67
+ os_info = tokens.shift if os_info && os_info.match( /[MSIE|U]/ )
68
+ os = os_info.match( /(.+)\s([\w\d|\.]+)/ ) if os_info
69
69
  if os
70
70
  @info[:machine][:os] = os[1].strip if os[1]
71
71
  @info[:machine][:version] = os[2].strip if os[2]
@@ -5,22 +5,29 @@ describe Rackamole::Utils::AgentDetect do
5
5
  describe "os" do
6
6
  it "should detect the os and version correctly" do
7
7
  agents = [
8
- "Opera/8.65 (X11; Linux i686; U; ru)",
9
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Opera 8.65 [en]",
10
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/1.5.0.12 (.NET CLR 3.5.30729)",
11
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/1.5.0.12 Ubiquity/0.1.5",
12
- "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.12) Gecko/20080326 CentOS/1.5.0.12-14.el5.centos Firefox/1.5.0.12",
13
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.0",
14
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.0",
15
- "Mozilla/5.0 (iPod; U; CPU like Mac OS X; fr) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/522.12",
16
- "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/522.12",
17
- "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
18
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; CPT-IE401SP1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)",
19
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322; InfoPath.2)",
20
- "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)",
21
- "Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.6.30 Version/10.61"
8
+ # "Opera/8.65 (X11; Linux i686; U; ru)",
9
+ # "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Opera 8.65 [en]",
10
+ # "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/1.5.0.12 (.NET CLR 3.5.30729)",
11
+ # "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/1.5.0.12 Ubiquity/0.1.5",
12
+ # "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.12) Gecko/20080326 CentOS/1.5.0.12-14.el5.centos Firefox/1.5.0.12",
13
+ # "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.0",
14
+ # "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.0",
15
+ # "Mozilla/5.0 (iPod; U; CPU like Mac OS X; fr) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/522.12",
16
+ # "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/522.12",
17
+ # "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
18
+ # "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; CPT-IE401SP1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)",
19
+ # "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322; InfoPath.2)",
20
+ # "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)",
21
+ # "Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.6.30 Version/10.61",
22
+ "Safari/6533.17.8 CFNetwork/454.9.7 Darwin/10.4.0 (i386) (iMac10%2C1)",
23
+ # "Mozilla/5.0 (SnapPreviewBot) Gecko/20061206 Firefox/1.5.0.9",
24
+ # "StackRambler/2.0 (MSIE incompatible)"
22
25
  ]
23
26
  expectations = [
27
+ {
28
+ :browser => { :name => "Safari", :version => "6533.17.8" },
29
+ :machine => { :platform => "i386", :os => "Darwin", :version => "10.4.0", :local => "N/A" }
30
+ },
24
31
  {
25
32
  :browser => { :name => "Opera", :version => "8.65" },
26
33
  :machine => { :platform => "X11", :os => "Linux", :version => "i686", :local => "N/A" }
@@ -1,4 +1,3 @@
1
- # require 'rubygems'
2
1
  require 'rack'
3
2
  require 'rack/test'
4
3
 
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackamole
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 4
8
- - 0
9
- version: 0.4.0
4
+ prerelease:
5
+ version: 0.4.1
10
6
  platform: ruby
11
7
  authors:
12
8
  - Fernand Galiana
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-08-20 00:00:00 -06:00
13
+ date: 2011-07-11 00:00:00 -06:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,10 +21,6 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 2
31
- - 2
32
24
  version: 1.2.2
33
25
  type: :runtime
34
26
  version_requirements: *id001
@@ -40,10 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - ">="
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 1
45
- - 0
46
- - 3
47
35
  version: 1.0.3
48
36
  type: :runtime
49
37
  version_requirements: *id002
@@ -55,10 +43,6 @@ dependencies:
55
43
  requirements:
56
44
  - - ">="
57
45
  - !ruby/object:Gem::Version
58
- segments:
59
- - 1
60
- - 0
61
- - 1
62
46
  version: 1.0.1
63
47
  type: :runtime
64
48
  version_requirements: *id003
@@ -70,10 +54,6 @@ dependencies:
70
54
  requirements:
71
55
  - - ">="
72
56
  - !ruby/object:Gem::Version
73
- segments:
74
- - 1
75
- - 0
76
- - 1
77
57
  version: 1.0.1
78
58
  type: :runtime
79
59
  version_requirements: *id004
@@ -85,10 +65,6 @@ dependencies:
85
65
  requirements:
86
66
  - - ">="
87
67
  - !ruby/object:Gem::Version
88
- segments:
89
- - 1
90
- - 0
91
- - 1
92
68
  version: 1.0.1
93
69
  type: :runtime
94
70
  version_requirements: *id005
@@ -100,10 +76,6 @@ dependencies:
100
76
  requirements:
101
77
  - - ">="
102
78
  - !ruby/object:Gem::Version
103
- segments:
104
- - 0
105
- - 2
106
- - 3
107
79
  version: 0.2.3
108
80
  type: :runtime
109
81
  version_requirements: *id006
@@ -115,10 +87,6 @@ dependencies:
115
87
  requirements:
116
88
  - - ">="
117
89
  - !ruby/object:Gem::Version
118
- segments:
119
- - 0
120
- - 3
121
- - 0
122
90
  version: 0.3.0
123
91
  type: :runtime
124
92
  version_requirements: *id007
@@ -130,10 +98,6 @@ dependencies:
130
98
  requirements:
131
99
  - - ">="
132
100
  - !ruby/object:Gem::Version
133
- segments:
134
- - 2
135
- - 6
136
- - 0
137
101
  version: 2.6.0
138
102
  type: :runtime
139
103
  version_requirements: *id008
@@ -145,10 +109,6 @@ dependencies:
145
109
  requirements:
146
110
  - - ">="
147
111
  - !ruby/object:Gem::Version
148
- segments:
149
- - 2
150
- - 1
151
- - 3
152
112
  version: 2.1.3
153
113
  type: :runtime
154
114
  version_requirements: *id009
@@ -160,9 +120,6 @@ dependencies:
160
120
  requirements:
161
121
  - - ">="
162
122
  - !ruby/object:Gem::Version
163
- segments:
164
- - 2
165
- - 0
166
123
  version: "2.0"
167
124
  type: :runtime
168
125
  version_requirements: *id010
@@ -174,14 +131,11 @@ dependencies:
174
131
  requirements:
175
132
  - - ">="
176
133
  - !ruby/object:Gem::Version
177
- segments:
178
- - 3
179
- - 4
180
- - 7
181
- version: 3.4.7
134
+ version: 3.7.0
182
135
  type: :development
183
136
  version_requirements: *id011
184
- description: " The MOle is a rack application that monitors user interactions with your web site. We are not \n talking about counting page hits here. The MOle tracks all the information available to capture\n the essence of a user interaction with your application. Using the MOle, you are able to see\n which feature is a hit or a bust. As an added bonus, the MOle also track performance and exceptions \n that might have escaped your test suites or alpha env. To boot your managers will love you for it! \n\n Whether you are releasing a new application or improving on an old one, it is always a good thing \n to know if anyone is using your application and if they are, how they are using it. \n What features are your users most fond of and which features find their way into the abyss? \n You will be able to rapidly assess whether or not your application is a hit and if\n your coolest features are thought as such by your users. You will be able to elegantly record user\n interactions and leverage these findings for the next iteration of your application. "
137
+ description: " Observe your web applications in the wild!\n \n\
138
+ == DESCRIPTION"
185
139
  email: fernand.galiana@gmail.com
186
140
  executables: []
187
141
 
@@ -192,7 +146,6 @@ extra_rdoc_files:
192
146
  - README.rdoc
193
147
  - lib/rackamole/alert/templates/alert.erb
194
148
  - samples/rails/moled/public/robots.txt
195
- - version.txt
196
149
  files:
197
150
  - ...
198
151
  - Gemfile
@@ -331,23 +284,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
284
  requirements:
332
285
  - - ">="
333
286
  - !ruby/object:Gem::Version
334
- segments:
335
- - 0
336
287
  version: "0"
337
288
  required_rubygems_version: !ruby/object:Gem::Requirement
338
289
  none: false
339
290
  requirements:
340
291
  - - ">="
341
292
  - !ruby/object:Gem::Version
342
- segments:
343
- - 0
344
293
  version: "0"
345
294
  requirements: []
346
295
 
347
296
  rubyforge_project: rackamole
348
- rubygems_version: 1.3.7
297
+ rubygems_version: 1.6.2
349
298
  signing_key:
350
299
  specification_version: 3
351
- summary: The MOle is a rack application that monitors user interactions with your web site
300
+ summary: Observe your web applications in the wild! == DESCRIPTION
352
301
  test_files: []
353
302