staccato 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
1
  --color
2
- --format nested
2
+ --format documentation
@@ -1,3 +1,7 @@
1
+ ## Staccato 0.1.1 ##
2
+
3
+ * fixes NoopTracker when track! is called on a hit *martin1keogh*
4
+
1
5
  ## Staccato 0.1.0 ##
2
6
 
3
7
  * adds support for all global hit options in any hit type
@@ -122,18 +122,12 @@ module Staccato
122
122
  end
123
123
  end
124
124
 
125
- # post the hit to GA collection endpoint
126
- # @return [Net::HTTPOK] the GA api always returns 200 OK
125
+ # send the hit to the tracker
127
126
  def track!
128
- post(Staccato.tracking_uri, params)
127
+ tracker.track(params)
129
128
  end
130
129
 
131
130
  private
132
- # @private
133
- def post(uri, params = {})
134
- Net::HTTP.post_form(uri, params)
135
- end
136
-
137
131
  def convert_booleans(hash)
138
132
  hash.each_pair.with_object({}, &method(:convert_boolean))
139
133
  end
@@ -104,6 +104,19 @@ module Staccato
104
104
  def transaction_item(options = {})
105
105
  Staccato::TransactionItem.new(self, options).track!
106
106
  end
107
+
108
+ # post the hit to GA collection endpoint
109
+ # @return [Net::HTTPOK] the GA api always returns 200 OK
110
+ def track(params={})
111
+ post(Staccato.tracking_uri, params)
112
+ end
113
+
114
+ private
115
+
116
+ # @private
117
+ def post(uri, params)
118
+ Net::HTTP.post_form(uri, params)
119
+ end
107
120
  end
108
121
 
109
122
  # A tracker which does no tracking
@@ -144,5 +157,8 @@ module Staccato
144
157
  # (see Tracker#transaction_item)
145
158
  def transaction_item(*)
146
159
  end
160
+
161
+ def track(*)
162
+ end
147
163
  end
148
164
  end
@@ -1,4 +1,4 @@
1
1
  module Staccato
2
2
  # The current Staccato VERSION
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
@@ -99,4 +99,14 @@ describe Staccato::NoopTracker do
99
99
  codez.should have_received(:test)
100
100
  end
101
101
  end
102
+
103
+ describe "#track" do
104
+ before(:each) do
105
+ tracker.track
106
+ end
107
+
108
+ it 'does not send a post request' do
109
+ Net::HTTP.should have_received(:post_form).never
110
+ end
111
+ end
102
112
  end
@@ -16,6 +16,6 @@ describe Staccato::Exception do
16
16
  end
17
17
 
18
18
  it 'rejects nil fatal boolean field values' do
19
- expect(Staccato::Exception.new(tracker, fatal: nil).params.has_key?('exf')).to be_false
19
+ expect(Staccato::Exception.new(tracker, fatal: nil).params.has_key?('exf')).to eq(false)
20
20
  end
21
21
  end
@@ -25,6 +25,6 @@ describe Staccato::Hit do
25
25
  end
26
26
 
27
27
  it 'rejects nil boolean field values' do
28
- expect(hit_klass.new(tracker, non_interactive: nil).params.has_key?('ni')).to be_false
28
+ expect(hit_klass.new(tracker, non_interactive: nil).params.has_key?('ni')).to eq(false)
29
29
  end
30
30
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "rake", ">= 3.0.0"
23
23
  spec.add_development_dependency "rspec"
24
24
  spec.add_development_dependency "mocha"
25
25
  spec.add_development_dependency "bourne"
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staccato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Tony Pitale
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
12
+ date: 2014-08-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,20 +30,23 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
- version: '0'
37
+ version: 3.0.0
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
- version: '0'
45
+ version: 3.0.0
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: mocha
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ! '>='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: bourne
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ! '>='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ! '>='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: simplecov
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ! '>='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ! '>='
95
108
  - !ruby/object:Gem::Version
@@ -135,26 +148,27 @@ files:
135
148
  homepage: https://github.com/tpitale/staccato
136
149
  licenses:
137
150
  - MIT
138
- metadata: {}
139
151
  post_install_message:
140
152
  rdoc_options: []
141
153
  require_paths:
142
154
  - lib
143
155
  required_ruby_version: !ruby/object:Gem::Requirement
156
+ none: false
144
157
  requirements:
145
158
  - - ! '>='
146
159
  - !ruby/object:Gem::Version
147
160
  version: '0'
148
161
  required_rubygems_version: !ruby/object:Gem::Requirement
162
+ none: false
149
163
  requirements:
150
164
  - - ! '>='
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  requirements: []
154
168
  rubyforge_project:
155
- rubygems_version: 2.2.1
169
+ rubygems_version: 1.8.29
156
170
  signing_key:
157
- specification_version: 4
171
+ specification_version: 3
158
172
  summary: Ruby Google Analytics Measurement
159
173
  test_files:
160
174
  - spec/integration/noop_tracker_spec.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MDM3ZjczOTg3NDUzNWUyZmUxMzI5ZWZhMzEwYmVlMjYyMmY4N2M5YQ==
5
- data.tar.gz: !binary |-
6
- NGUwOTE4YWIyNWE0ZGRjYjlmMzMxNzlmNzY3ZDJkMzMxMDk5ZjhlMw==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- MTdhMzc1NDQ0M2I1ZThiYTVjYTg5ZjFmZmRlY2NlMTdiNDJmODQxZTQwODU0
10
- MTY5MDgyMjg1NjZkNjE2ODdmM2JiNjgxN2ZhY2EwOWVmNGY4NDI4N2Q0OTky
11
- YThkMGMyYTM3Y2UxMDQ2OWJlYTFjMTcxMTliYThlZTU2ZTNjY2M=
12
- data.tar.gz: !binary |-
13
- NGIyZDcxMzVmNzE0NTIwOGQxZjY0MDQyNmEyYjM5NDhjY2EzOTc3MTMyNGJi
14
- YmI1YTRiZTZiOTkzOWQwYmNmZDVlZmJkY2NkOTY2Zjc0YTBmMmQ1NTRkNjcw
15
- NTdkYmMwNjhjZTcyNjIwMWU3NzU2OTZkMzBjZDdkZjc5ZDlkMzY=