analytics_goo 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{analytics_goo}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rob Christie"]
12
- s.date = %q{2011-06-01}
12
+ s.date = %q{2012-04-13}
13
13
  s.email = %q{robchristie@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown",
@@ -39,14 +39,14 @@ Gem::Specification.new do |s|
39
39
  ]
40
40
  s.homepage = %q{http://github.com/eyestreet/analytics_goo}
41
41
  s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.3.6}
42
+ s.rubygems_version = %q{1.3.7}
43
43
  s.summary = %q{AnalyticsGoo provides server side non-javascript tracking using google analytics.}
44
44
 
45
45
  if s.respond_to? :specification_version then
46
46
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
47
  s.specification_version = 3
48
48
 
49
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
50
  else
51
51
  end
52
52
  else
@@ -140,7 +140,11 @@ module AnalyticsGoo
140
140
  # utmip
141
141
  # Remote IP address
142
142
  def utmip
143
- self.remote_address
143
+ return '' if self.remote_address.blank?
144
+ # Capture the first three octects of the IP address and replace the forth
145
+ # with 0, e.g. 124.455.3.123 becomes 124.455.3.0
146
+ ip = self.remote_address.to_s.gsub!(/([^.]+\.[^.]+\.[^.]+\.)[^.]+/,"\\1") + "0"
147
+ ip
144
148
  end
145
149
 
146
150
 
@@ -49,7 +49,7 @@ class AnalyticsGooTest < ActiveSupport::TestCase
49
49
  end
50
50
  context "when initialized with a remote ip address" do
51
51
  should "return that IP" do
52
- assert_equal "127.0.0.1", @ga.utmip
52
+ assert_equal "127.0.0.0", @ga.utmip
53
53
  end
54
54
  end
55
55
 
@@ -143,7 +143,7 @@ class AnalyticsGooTest < ActiveSupport::TestCase
143
143
  end
144
144
  context "makes a request for an image on the google analytics server" do
145
145
  setup do
146
- path = "/__utm.gif?utmwv=4.4sj&utmn=1277734430&utmhn=shor.tswit.ch&utmr=-&utmp=%2Fadmin%2F1&utmac=MO-11685745-3&utmcc=__utma%3D999.999.999.999.999.1%3B&utmvid=0x5719fb3b1e05e909&utmip=127.0.0.1"
146
+ path = "/__utm.gif?utmwv=4.4sj&utmn=1277734430&utmhn=shor.tswit.ch&utmr=-&utmp=%2Fadmin%2F1&utmac=MO-11685745-3&utmcc=__utma%3D999.999.999.999.999.1%3B&utmvid=0x5719fb3b1e05e909&utmip=127.0.0.0"
147
147
  header_hash = {'User-Agent' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6', 'Accept-Language' => 'en-us,en;q=0.5'}
148
148
  @test_ad.expects(:utmn).returns("1277734430")
149
149
  @test_ad.expects(:utmvid).returns("0x5719fb3b1e05e909")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytics_goo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rob Christie
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-01 00:00:00 -04:00
18
+ date: 2012-04-13 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements: []
80
80
 
81
81
  rubyforge_project:
82
- rubygems_version: 1.3.6
82
+ rubygems_version: 1.3.7
83
83
  signing_key:
84
84
  specification_version: 3
85
85
  summary: AnalyticsGoo provides server side non-javascript tracking using google analytics.