redir 0.0.4 → 0.0.5
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/VERSION +1 -1
- data/lib/rack/redir.rb +2 -1
- data/redir.gemspec +2 -2
- data/spec/unit/rack/redir_spec.rb +4 -2
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.5
|
data/lib/rack/redir.rb
CHANGED
|
@@ -28,7 +28,8 @@ module Rack
|
|
|
28
28
|
if Redirect.append_google_analytics
|
|
29
29
|
redirect_to_url = append_parameter_separater redirect_to_url
|
|
30
30
|
redirect_to_url = "#{redirect_to_url}utm_source=#{Rack::Utils.escape Redirect.host}" +
|
|
31
|
-
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}"
|
|
31
|
+
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}" +
|
|
32
|
+
"&utm_medium=referral"
|
|
32
33
|
end
|
|
33
34
|
[302, {'Location' => redirect_to_url}, self]
|
|
34
35
|
else
|
data/redir.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "redir"
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.5"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Lance Gleason"]
|
|
12
|
-
s.date = "2012-10-
|
|
12
|
+
s.date = "2012-10-25"
|
|
13
13
|
s.description = "This gem adds functionality to shorten url's and gather data about requests going through it."
|
|
14
14
|
s.email = "lgleason@polyglotprogramminginc.com"
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -124,14 +124,16 @@ describe :redir do
|
|
|
124
124
|
let (:redirect) {create :redirect, :original_url => 'www.google.com/?foo=bar'}
|
|
125
125
|
subject {last_request}
|
|
126
126
|
its (:url) {should eq "http://www.google.com/?foo=bar&utm_source=http%3A%2F%2Flocalhost%3A3000%2F" +
|
|
127
|
-
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}"
|
|
127
|
+
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}" +
|
|
128
|
+
"&utm_medium=referral"}
|
|
128
129
|
end
|
|
129
130
|
|
|
130
131
|
context 'without existing url data' do
|
|
131
132
|
let (:redirect) {create :redirect, :original_url => 'www.google.com'}
|
|
132
133
|
subject {last_request}
|
|
133
134
|
its (:url) {should eq "http://www.google.com/?utm_source=http%3A%2F%2Flocalhost%3A3000%2F" +
|
|
134
|
-
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}"
|
|
135
|
+
"&utm_campaign=#{redirect_log.redirect_id}__#{redirect_log._id}" +
|
|
136
|
+
"&utm_medium=referral"}
|
|
135
137
|
end
|
|
136
138
|
|
|
137
139
|
after do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redir
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-10-
|
|
12
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mongoid
|
|
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
197
197
|
version: '0'
|
|
198
198
|
segments:
|
|
199
199
|
- 0
|
|
200
|
-
hash:
|
|
200
|
+
hash: 590702510341136628
|
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
202
|
none: false
|
|
203
203
|
requirements:
|