gaq 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTc3MTUwZGM5NmUxNjQ0ODc3NjcwODQ3NWFlNjRlMjk3ZjcxYjdlMA==
5
+ data.tar.gz: !binary |-
6
+ NzEwZGZiNTY2NzRlYzlmZTRlNjAxNTdkMjE0NGNhYTQyMmI3OTcwNQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NzhjNzAzYTVjODI4MGE1YjAxYWMzZmVkNTA5ZTJjMDYxMjMzNjY2NTUxOTQ5
10
+ ZDE1YmIwN2Q3YTVmMDIzZjdmMGY0ZTliMjE2MzdlYzMzOTA5MzNlY2E0NzE1
11
+ NjU0OWIxYmJiYmFlMGE5MTIxMWMwNDA5ODYwOGZiNDUwMzFmNGQ=
12
+ data.tar.gz: !binary |-
13
+ ZTg2Mjc0ZjkyYjFjMmZhNTc4ODIyYjg2NWI3NDIzNGExZTE1MDFiOTBjZmRj
14
+ M2ZiNTVjZWU2Mjg4MTBjYWQ2NmU1ODZmNWEwYTMxZmRkODkwMTE1MTdlMTY3
15
+ N2Q2YjhhZDUxYzQ3MzllMjg3ODA2Y2RjZDU2OWE4ZTU5M2RjYjU=
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
data/Gemfile CHANGED
@@ -17,3 +17,5 @@ gem 'debugger'
17
17
  gem 'nokogiri'
18
18
 
19
19
  gem 'coveralls', require: false
20
+
21
+ gem 'rake'
@@ -27,8 +27,7 @@ module Gaq
27
27
  commands = immediate_commands.dup
28
28
  commands << @language.new_command(:anonymize_ip) if interpret_config(@config.anonymize_ip)
29
29
 
30
- setup_tracker_names = [nil, *track_pageview_tracker_names, *seen_tracker_names].uniq
31
- setup_tracker_names.each do |tracker_name|
30
+ @config.tracker_names.each do |tracker_name|
32
31
  tracker_config = @config.tracker_config(tracker_name)
33
32
  commands += tracker_setup_commands(tracker_config) if tracker_config
34
33
  end
@@ -43,16 +42,6 @@ module Gaq
43
42
  super(value, @controller_facade)
44
43
  end
45
44
 
46
- def seen_tracker_names
47
- immediate_commands.map(&:tracker_name).uniq
48
- end
49
-
50
- def track_pageview_tracker_names
51
- @config.tracker_names.select do |tracker_name|
52
- @config.tracker_config(tracker_name).track_pageview?
53
- end
54
- end
55
-
56
45
  def tracker_setup_commands(tracker_config)
57
46
  [set_account_command(tracker_config), track_pageview_command(tracker_config)].compact
58
47
  end
@@ -1,3 +1,3 @@
1
1
  module Gaq
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -281,24 +281,8 @@ module Gaq
281
281
  rails_config.track_pageview = false
282
282
  end
283
283
 
284
- it "does not render anything for default tracker", pending: true do
285
- # Currently, the default tracker _setAccount is always rendered.
286
- # I'm undecided about that.
287
- # If the implementation stays this way, I should assert
288
- # _setAccount presence here instead.
289
- result.should_not include command_segments.for_default_tracker
290
- end
291
-
292
- context "with a tracker command" do
293
- before do
294
- # this is really an arbitrary tracker command.
295
- root_target.track_event 'category', 'action', 'label'
296
- end
297
-
298
- it "renders the _setAccount, but not a _trackPageview" do
299
- result.should include(["_setAccount", 'UA-TEST23-5'])
300
- result.should_not include(command_segments.starting_with('_trackPageview'))
301
- end
284
+ it "does not render a _trackPageview for the tracker" do
285
+ result.should_not include(["_trackPageview"])
302
286
  end
303
287
  end
304
288
  end
@@ -435,34 +419,6 @@ module Gaq
435
419
  rails_config.additional_trackers = ["foo"]
436
420
  end
437
421
 
438
- context "configured not to track pageviews" do
439
- before do
440
- rails_config.tracker(:foo).track_pageview = false
441
- end
442
-
443
- it "does not render any command for the additional tracker" do
444
- result.should_not include(command_segments.for_tracker('foo'))
445
- end
446
-
447
- context "after gaq[:foo].track_event 'category', 'action', 'label'" do
448
- before do
449
- root_target["foo"].track_event 'category', 'action', 'label'
450
- end
451
-
452
- it "renders the proper _setAccount" do
453
- result.should include(["foo._setAccount", "UA-XUNSET-S"])
454
- end
455
-
456
- it "does not render a _trackPageview for the tracker" do
457
- result.should_not include(["foo._trackPageview"])
458
- end
459
-
460
- it "renders the _trackEvent" do
461
- result.should include(["foo._trackEvent", "category", "action", "label"])
462
- end
463
- end
464
- end
465
-
466
422
  it "renders a _setAccount for the additional tracker" do
467
423
  result.should include(['foo._setAccount', "UA-XUNSET-S"])
468
424
  end
@@ -471,17 +427,19 @@ module Gaq
471
427
  result.should include(["foo._trackPageview"])
472
428
  end
473
429
 
474
- context "after gaq[:foo].track_event 'category', 'action', 'label'" do
430
+ context "configured not to track pageviews" do
475
431
  before do
476
- root_target["foo"].track_event 'category', 'action', 'label'
432
+ rails_config.tracker(:foo).track_pageview = false
477
433
  end
478
434
 
479
- it "renders a _setAccount for the additional tracker" do
480
- result.should include(['foo._setAccount', "UA-XUNSET-S"])
435
+ it "does not render a _trackPageview for the tracker" do
436
+ result.should_not include(["foo._trackPageview"])
481
437
  end
438
+ end
482
439
 
483
- it "renders a _trackPageview for the tracker" do
484
- result.should include(["foo._trackPageview"])
440
+ context "after gaq[:foo].track_event 'category', 'action', 'label'" do
441
+ before do
442
+ root_target["foo"].track_event 'category', 'action', 'label'
485
443
  end
486
444
 
487
445
  it "renders the _trackEvent" do
metadata CHANGED
@@ -1,44 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.2.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Thomas Stratmann
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-04 00:00:00.000000000 Z
11
+ date: 2013-10-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
14
+ type: :runtime
15
+ prerelease: false
15
16
  name: actionpack
16
17
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
- type: :runtime
23
- prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
28
+ type: :runtime
29
+ prerelease: false
31
30
  name: activesupport
32
31
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
32
  requirements:
35
33
  - - ! '>='
36
34
  - !ruby/object:Gem::Version
37
35
  version: '0'
38
- type: :runtime
39
- prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -53,6 +48,7 @@ extra_rdoc_files: []
53
48
  files:
54
49
  - .gitignore
55
50
  - .simplecov
51
+ - .travis.yml
56
52
  - Gemfile
57
53
  - Guardfile
58
54
  - LICENSE.txt
@@ -126,27 +122,26 @@ files:
126
122
  - spec/lib/gaq/snippet_renderer_spec.rb
127
123
  homepage: ''
128
124
  licenses: []
125
+ metadata: {}
129
126
  post_install_message:
130
127
  rdoc_options: []
131
128
  require_paths:
132
129
  - lib
133
130
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
131
  requirements:
136
132
  - - ! '>='
137
133
  - !ruby/object:Gem::Version
138
134
  version: '0'
139
135
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
136
  requirements:
142
137
  - - ! '>='
143
138
  - !ruby/object:Gem::Version
144
139
  version: '0'
145
140
  requirements: []
146
141
  rubyforge_project:
147
- rubygems_version: 1.8.23
142
+ rubygems_version: 2.0.5
148
143
  signing_key:
149
- specification_version: 3
144
+ specification_version: 4
150
145
  summary: Renders _gaq initialization and the ga.js snippet. Supports pushing from
151
146
  the back end
152
147
  test_files: