persist_campaign 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MDM4YWQ4N2YyY2FiY2UzZjA0ZjkyZTYyM2IxNzFkMDE4ZTY5MGI2ZQ==
5
- data.tar.gz: !binary |-
6
- MjdhMGM2YzAxYTMzMTRkYTg2NzgxMzNmYTQ4NWMwMTg4NzM5NTM0Yw==
2
+ SHA1:
3
+ metadata.gz: 1b82f1c95d7fab634604c373cdabbc334c781015
4
+ data.tar.gz: 04f643c8a836396a7d5554d3ad8f2ab1e7f6b884
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YWJmMmEzNGMxNDhjMDJmYTJjZTc5NjcxZTVmNjhiNjhjZDI5ZThmNGIxZDUw
10
- MWE0ZDYwOTA2NGE0NDc5MjkwOWVhZWEyYWJkYTBjOWUyNjEwYzA0MWY5OWIw
11
- MjY3NWJlOGU4MjM0ZGRhY2IzZWZjOGJkN2M4NTYzMDE1NWI5OTE=
12
- data.tar.gz: !binary |-
13
- NTJlMTkzZDgxZjAyN2UwZTZlODU4YjI2NDgzMDI0NjEwMTViZjM3MTFjNTI0
14
- YzExNjMxYjIyMWU4NzQzNzEyMjI4ZDdmMWFmYzRmZWE4ZWJkYWIzZWQ1NTg5
15
- OGIzY2NmYzc1ZjIxOWJiMjk1NjE4ZDc1MzVlZmQ3NmQzMmRjM2M=
6
+ metadata.gz: 43dbdc2fcad408c45976bcd54dc4ed08ae5bc04082c307847de09e645261e37f49efb63baf8fec18e9ee221bff02ba2535bcdb52630f1b8ef6d5901e5a970151
7
+ data.tar.gz: cd52998655c3771d7d9b98dca6f7cf772319bed0a478f9b5d1b0c0bea5cc78dc8fea3d999cc25718161dc8b7863e28cd02f37982c32a45c2ee2e20af51fa315e
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/dummy/log
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ /gemfiles/*.lock
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.1.3
5
+ gemfile:
6
+ - gemfiles/rails_3.1.gemfile
7
+ - gemfiles/rails_3.2.gemfile
8
+ - gemfiles/rails_4.0.gemfile
9
+ - gemfiles/rails_4.1.gemfile
10
+ - gemfiles/rails_4.2.gemfile
11
+ before_install:
12
+ gem install bundler
data/Appraisals ADDED
@@ -0,0 +1,24 @@
1
+ appraise "rails-3.1" do
2
+ gem "rails", "~> 3.1.0"
3
+ gemspec
4
+ end
5
+
6
+ appraise "rails-3.2" do
7
+ gem "rails", "~> 3.2.1"
8
+ gemspec
9
+ end
10
+
11
+ appraise "rails-4.0" do
12
+ gem "rails", "~> 4.0.0"
13
+ gemspec
14
+ end
15
+
16
+ appraise "rails-4.1" do
17
+ gem "rails", "~> 4.1.0"
18
+ gemspec
19
+ end
20
+
21
+ appraise "rails-4.2" do
22
+ gem "rails", "~> 4.2"
23
+ gemspec
24
+ end
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Andy Dust
1
+ Copyright (c) 2014 MUBI
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # PersistCampaign
2
2
 
3
+ [![Build Status](https://travis-ci.org/mubi/persist_campaign.svg)](https://travis-ci.org/mubi/persist_campaign)
4
+
3
5
  Persist campaign parameters - such as utm_campaign, utm_source, etc - on Rails redirect_to.
4
6
 
5
7
  ## Installation
@@ -56,4 +58,4 @@ MIT license.
56
58
  2. Create your feature branch (`git checkout -b my-new-feature`)
57
59
  3. Commit your changes (`git commit -am 'Add some feature'`)
58
60
  4. Push to the branch (`git push origin my-new-feature`)
59
- 5. Create new Pull Request
61
+ 5. Create new Pull Request
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.1.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.0.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.1.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2"
6
+
7
+ gemspec :path => "../"
@@ -8,10 +8,22 @@ module PersistCampaign
8
8
  module InstanceMethods
9
9
  # Solution provided by ndp's save-the-campaign gem (http://github.com/ndp/save-the-campaign),
10
10
  # reproduced here under the MIT license
11
- def _compute_redirect_to_location_with_persist_campaign_params(options = {})
11
+
12
+ if Gem::Version.new(Rails.version) >= Gem::Version.new('4.2.1')
13
+ def _compute_redirect_to_location_with_persist_campaign_params(request, options = {})
14
+ url = _compute_redirect_to_location_without_persist_campaign_params(request, options)
15
+ _add_persisted_keys_to(request, url)
16
+ end
17
+ else
18
+ def _compute_redirect_to_location_with_persist_campaign_params(options = {})
19
+ url = _compute_redirect_to_location_without_persist_campaign_params(options)
20
+ _add_persisted_keys_to(request, url)
21
+ end
22
+ end
23
+
24
+ def _add_persisted_keys_to(request, url)
12
25
  keys = PersistCampaign.config.keys.map(&:to_s)
13
26
  to_persist = request.params.slice(*keys)
14
- url = _compute_redirect_to_location_without_persist_campaign_params(options)
15
27
 
16
28
  unless to_persist.empty?
17
29
  url << (url =~ /\?/ ? '&' : '?')
@@ -22,4 +34,4 @@ module PersistCampaign
22
34
  end
23
35
  end
24
36
  end
25
- end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module PersistCampaign
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency 'rails', '>= 3.1.12'
24
23
  spec.add_development_dependency "bundler", "~> 1.5"
25
24
  spec.add_development_dependency "rake"
26
- spec.add_development_dependency 'rspec-rails', '~> 2.14'
27
- spec.add_development_dependency 'generator_spec', '~> 0.9.2'
25
+ spec.add_development_dependency 'rspec-rails', '~> 3.4.0'
26
+ spec.add_development_dependency 'generator_spec', '~> 0.9.3'
27
+ spec.add_development_dependency "appraisal"
28
28
  end
@@ -10,6 +10,7 @@ module Dummy
10
10
  end
11
11
  end
12
12
 
13
- Rails.application.configure do
13
+ Dummy::Application.configure do
14
14
  config.eager_load = false
15
- end
15
+ config.secret_key_base = 'abcdef123456'
16
+ end
data/spec/spec_helper.rb CHANGED
@@ -7,4 +7,4 @@ Rails.backtrace_cleaner.remove_silencers!
7
7
 
8
8
  RSpec.configure do |config|
9
9
  config.infer_spec_type_from_file_location!
10
- end
10
+ end
metadata CHANGED
@@ -1,100 +1,107 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persist_campaign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Dust
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: 3.1.12
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: 3.1.12
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ~>
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
19
  version: '1.5'
34
20
  type: :development
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ~>
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
26
  version: '1.5'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ! '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - ! '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rspec-rails
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ~>
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '2.14'
47
+ version: 3.4.0
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ~>
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '2.14'
54
+ version: 3.4.0
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: generator_spec
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - ~>
59
+ - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 0.9.2
61
+ version: 0.9.3
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - ~>
66
+ - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 0.9.2
83
- description: ! "This Rails gem allows you to persist analytics parameters through
84
- redirects. By default its\n persists utm_campaign, utm_source,
85
- utm_term, utm_medium, utm_content and gclid (for Google Adwords).\n Additional
86
- param keys can be configured."
68
+ version: 0.9.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: appraisal
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: |-
84
+ This Rails gem allows you to persist analytics parameters through redirects. By default its
85
+ persists utm_campaign, utm_source, utm_term, utm_medium, utm_content and gclid (for Google Adwords).
86
+ Additional param keys can be configured.
87
87
  email:
88
88
  - adust@mubi.com
89
89
  executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
- - .gitignore
93
+ - ".gitignore"
94
+ - ".travis.yml"
95
+ - Appraisals
94
96
  - Gemfile
95
97
  - LICENSE.txt
96
98
  - README.md
97
99
  - Rakefile
100
+ - gemfiles/rails_3.1.gemfile
101
+ - gemfiles/rails_3.2.gemfile
102
+ - gemfiles/rails_4.0.gemfile
103
+ - gemfiles/rails_4.1.gemfile
104
+ - gemfiles/rails_4.2.gemfile
98
105
  - lib/generators/persist_campaign/install_generator.rb
99
106
  - lib/generators/persist_campaign/templates/initializer.rb
100
107
  - lib/persist_campaign.rb
@@ -126,17 +133,17 @@ require_paths:
126
133
  - lib
127
134
  required_ruby_version: !ruby/object:Gem::Requirement
128
135
  requirements:
129
- - - ! '>='
136
+ - - ">="
130
137
  - !ruby/object:Gem::Version
131
138
  version: '0'
132
139
  required_rubygems_version: !ruby/object:Gem::Requirement
133
140
  requirements:
134
- - - ! '>='
141
+ - - ">="
135
142
  - !ruby/object:Gem::Version
136
143
  version: '0'
137
144
  requirements: []
138
145
  rubyforge_project:
139
- rubygems_version: 2.2.1
146
+ rubygems_version: 2.4.6
140
147
  signing_key:
141
148
  specification_version: 4
142
149
  summary: Persist campaign parameters - such as utm_campaign, utm_source, etc - on