gabbara 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.
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gabbara (0.0.4)
4
+ gabbara (0.0.5)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- activesupport (3.0.3)
10
+ activesupport (3.0.5)
11
11
  addressable (2.2.2)
12
12
  crack (0.1.8)
13
13
  diff-lcs (1.1.2)
@@ -28,7 +28,6 @@ PLATFORMS
28
28
  ruby
29
29
 
30
30
  DEPENDENCIES
31
- activesupport
32
31
  gabbara!
33
32
  rack
34
33
  rspec
data/Rakefile CHANGED
@@ -3,6 +3,10 @@ Bundler::GemHelper.install_tasks
3
3
 
4
4
  task :default => :spec
5
5
 
6
- task :spec do
7
- ruby "spec/gabba_spec.rb"
6
+ require 'rspec/core'
7
+ require 'rspec/core/rake_task'
8
+
9
+ desc "Run the code examples in spec"
10
+ RSpec::Core::RakeTask.new do |t|
11
+ t.pattern = "./spec/*_spec.rb"
8
12
  end
@@ -15,7 +15,19 @@ module Gabbara
15
15
  BEACON_PATH = "/__utm.gif"
16
16
  USER_AGENT = "Gabbara #{VERSION} Agent"
17
17
 
18
- attr_accessor :logger, :utmwv, :utmn, :utmhn, :utmcs, :utmul, :utmp, :utmac, :utmt, :utmcc, :utmr, :utmip, :user_agent
18
+ attr_accessor :logger,
19
+ :utmwv, # GA version, default: "4.4sh"
20
+ :utmn, # random
21
+ :utmhn, # domain
22
+ :utmcs, # charset, default: "UTF-8"
23
+ :utmul, # language, default: "en-us"
24
+ :utmhid, # Session ID
25
+ :utmp, # path
26
+ :utmac, # account ID
27
+ :utmcc, # utm cookies from client
28
+ :utmr, # referrer, default: params['utmr'] or HTTP_REFERER or -
29
+ :utmip, # client IP
30
+ :user_agent
19
31
 
20
32
  # create with:
21
33
  # ga_acct, domain
@@ -74,7 +86,7 @@ module Gabbara
74
86
  :utmhn => @utmhn,
75
87
  :utmcs => @utmcs,
76
88
  :utmul => @utmul,
77
- :utmhid => rand(8999999999) + 1000000000,
89
+ :utmhid => @utmhid || rand(8999999999) + 1000000000, # TODO don't use random
78
90
  :utmac => @utmac,
79
91
  :utmcc => @utmcc || cookie_params,
80
92
  :utmr => @utmr,
@@ -90,7 +102,7 @@ module Gabbara
90
102
  end
91
103
  end
92
104
 
93
- # create magical cookie params used by GA for its own nefarious purposes
105
+ # TODO don't use random
94
106
  def cookie_params(utma1 = rand(89999999) + 10000000, utma2 = rand(1147483647) + 1000000000, today = Time.now)
95
107
  "__utma=1.#{utma1}00145214523.#{utma2}.#{today.to_i}.#{today.to_i}.15;+__utmz=1.#{today.to_i}.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);"
96
108
  end
@@ -1,3 +1,3 @@
1
1
  module Gabbara
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gabbara
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 4
10
- version: 0.0.4
4
+ prerelease:
5
+ version: 0.0.5
11
6
  platform: ruby
12
7
  authors:
13
8
  - Michael Reinsch
@@ -16,7 +11,7 @@ autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
13
 
19
- date: 2010-12-27 00:00:00 +09:00
14
+ date: 2011-04-25 00:00:00 +09:00
20
15
  default_executable:
21
16
  dependencies:
22
17
  - !ruby/object:Gem::Dependency
@@ -27,9 +22,6 @@ dependencies:
27
22
  requirements:
28
23
  - - ">="
29
24
  - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
25
  version: "0"
34
26
  type: :runtime
35
27
  version_requirements: *id001
@@ -69,23 +61,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
61
  requirements:
70
62
  - - ">="
71
63
  - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
64
  version: "0"
76
65
  required_rubygems_version: !ruby/object:Gem::Requirement
77
66
  none: false
78
67
  requirements:
79
68
  - - ">="
80
69
  - !ruby/object:Gem::Version
81
- hash: 3
82
- segments:
83
- - 0
84
70
  version: "0"
85
71
  requirements: []
86
72
 
87
73
  rubyforge_project: gabbara
88
- rubygems_version: 1.3.7
74
+ rubygems_version: 1.6.2
89
75
  signing_key:
90
76
  specification_version: 3
91
77
  summary: Easy server-side tracking for Google Analytics