rack-track 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/rack/track.rb +3 -3
- data/rack-track.gemspec +2 -2
- data/test/test_rack-track.rb +5 -0
- metadata +9 -9
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "rack-track"
|
18
|
-
gem.version = "0.1.
|
18
|
+
gem.version = "0.1.5"
|
19
19
|
gem.homepage = "http://github.com/michaelbaldry/rack-track"
|
20
20
|
gem.license = "MIT"
|
21
21
|
gem.summary = %Q{Taking all the pain away from managing Tracking Pixels}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/rack/track.rb
CHANGED
@@ -48,10 +48,10 @@ module Rack
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def apply(request, response)
|
51
|
-
url = URI::parse(request.url)
|
52
|
-
|
51
|
+
url = URI::parse(request.url) rescue nil
|
52
|
+
return response if url.nil?
|
53
|
+
|
53
54
|
matching_areas = @areas.find_all { |k, a| a.include? url.path.downcase }.collect { |k, v| k }
|
54
|
-
p matching_areas
|
55
55
|
@pixels.each do |p|
|
56
56
|
paths = @areas[p.area]
|
57
57
|
response.insert(response.rindex("</body>"), p.content) if ([:all_pages, :all].include?(p.area) ||
|
data/rack-track.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack-track}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Baldry"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-12-15}
|
13
13
|
s.description = %q{A rack middleware that allows you to define and document tracking pixels in one location}
|
14
14
|
s.email = %q{clockwize@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_rack-track.rb
CHANGED
@@ -138,4 +138,9 @@ class TestRackTrack < Test::Unit::TestCase
|
|
138
138
|
get '/'
|
139
139
|
assert_equal "90", last_response.headers["Content-Length"]
|
140
140
|
end
|
141
|
+
|
142
|
+
def test_ignores_requests_to_urls_that_uri_cannot_parse
|
143
|
+
#this doesn't work. rack test helpers fail because it's an invalid url.
|
144
|
+
#get '/fancybox/fancybox/+(/^https/i.test(window.location.href||'
|
145
|
+
end
|
141
146
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-track
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Baldry
|
@@ -15,12 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-12-15 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|
23
|
-
type: :runtime
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
@@ -30,11 +29,11 @@ dependencies:
|
|
30
29
|
segments:
|
31
30
|
- 0
|
32
31
|
version: "0"
|
32
|
+
type: :runtime
|
33
33
|
name: rack-track
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
prerelease: false
|
37
|
-
type: :development
|
38
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
40
39
|
requirements:
|
@@ -45,11 +44,11 @@ dependencies:
|
|
45
44
|
- 1
|
46
45
|
- 0
|
47
46
|
version: "1.0"
|
47
|
+
type: :development
|
48
48
|
name: bundler
|
49
49
|
version_requirements: *id002
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
prerelease: false
|
52
|
-
type: :development
|
53
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
53
|
none: false
|
55
54
|
requirements:
|
@@ -61,11 +60,11 @@ dependencies:
|
|
61
60
|
- 6
|
62
61
|
- 4
|
63
62
|
version: 1.6.4
|
63
|
+
type: :development
|
64
64
|
name: jeweler
|
65
65
|
version_requirements: *id003
|
66
66
|
- !ruby/object:Gem::Dependency
|
67
67
|
prerelease: false
|
68
|
-
type: :development
|
69
68
|
requirement: &id004 !ruby/object:Gem::Requirement
|
70
69
|
none: false
|
71
70
|
requirements:
|
@@ -75,11 +74,11 @@ dependencies:
|
|
75
74
|
segments:
|
76
75
|
- 0
|
77
76
|
version: "0"
|
77
|
+
type: :development
|
78
78
|
name: rcov
|
79
79
|
version_requirements: *id004
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
prerelease: false
|
82
|
-
type: :development
|
83
82
|
requirement: &id005 !ruby/object:Gem::Requirement
|
84
83
|
none: false
|
85
84
|
requirements:
|
@@ -89,6 +88,7 @@ dependencies:
|
|
89
88
|
segments:
|
90
89
|
- 0
|
91
90
|
version: "0"
|
91
|
+
type: :development
|
92
92
|
name: rack-test
|
93
93
|
version_requirements: *id005
|
94
94
|
description: A rack middleware that allows you to define and document tracking pixels in one location
|