rack-tracker 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7d3f0a731a9473254d058fda92f9e088a255470
4
- data.tar.gz: 897423fe72752a8dc9a7a49513b6554b70245f53
3
+ metadata.gz: b473a608ce31dc8b7ccaeefd6f5dc63b2f646b06
4
+ data.tar.gz: 5222acfc0fc22d21c17bec320d67edb827d7c62a
5
5
  SHA512:
6
- metadata.gz: d298b6b90718d9fbe380dc47c8408b1c9a7e987b2d85b2eafb98b69fb922289e5797e581891304c23f53dd5b9a0c26600a9cea4982ec7147c36f6f8e230cf6c9
7
- data.tar.gz: 8480c1144c530cb3ba33739e4c5ecba55e5bcfa036bc14ced3633097590e936464899a49c31011380d1a9be90a8bd126d2034b5fc795aa96160c6de68196069a
6
+ metadata.gz: c76c3b35efb245af58c515e348301c699b6e91afc1a5476e98404937f3540716a453c82a5ffb01cb3d88febd49b1356b80d6995609550ad7101f3f8a405a907f
7
+ data.tar.gz: e1f155a40afb4f56467a10aff0bcec5dffe72584951daeb3ede7b24933322d804849376cf8ca045909b03fc6ac99362b3b6120a685d327a35d4081734c983b6d
@@ -1,3 +1,7 @@
1
+ # 0.2.6
2
+
3
+ * [ENHANCEMENT] rails 3 support
4
+
1
5
  # 0.2.5
2
6
 
3
7
  * [BUGFIX] stringify google analytics event values to be api compliant
data/README.md CHANGED
@@ -259,7 +259,7 @@ Lets give it a try! We need to mount our new handler in the `Rack::Tracker` midd
259
259
 
260
260
  ```ruby
261
261
  config.middleware.use(Rack::Tracker) do
262
- handler MyTracker, { awesome: true }
262
+ handler MyHandler, { awesome: true }
263
263
  end
264
264
  ````
265
265
 
@@ -14,4 +14,20 @@ class Hash
14
14
  options
15
15
  end
16
16
  end
17
+
18
+ def compact
19
+ select { |_, value| !value.nil? }
20
+ end
21
+
22
+ def deep_merge!(other_hash, &block)
23
+ other_hash.each_pair do |k,v|
24
+ tv = self[k]
25
+ if tv.is_a?(Hash) && v.is_a?(Hash)
26
+ self[k] = tv.deep_merge(v, &block)
27
+ else
28
+ self[k] = block && tv ? block.call(k, tv, v) : v
29
+ end
30
+ end
31
+ self
32
+ end
17
33
  end
@@ -25,7 +25,7 @@ class Rack::Tracker::GoogleAnalytics < Rack::Tracker::Handler
25
25
  end
26
26
 
27
27
  def tracker
28
- options[:tracker].try(:call, env) || options[:tracker]
28
+ options[:tracker].respond_to?(:call) ? options[:tracker].call(env) : options[:tracker]
29
29
  end
30
30
 
31
31
  def render
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Tracker
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
5
5
  end
@@ -18,14 +18,14 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "rack", ">= 1.5.2"
21
+ spec.add_dependency "rack", ">= 1.4.0"
22
22
  spec.add_dependency "tilt", "~> 1.4.1"
23
- spec.add_dependency "activesupport", ">= 4.0.0"
23
+ spec.add_dependency 'activesupport', '>= 3.0'
24
24
 
25
+ spec.add_development_dependency 'actionpack', '>= 3.0'
25
26
  spec.add_development_dependency "bundler", "~> 1.5"
26
27
  spec.add_development_dependency "rake"
27
28
  spec.add_development_dependency "rspec", "~> 3.0.0"
28
29
  spec.add_development_dependency "capybara", "~> 2.4.1"
29
- spec.add_development_dependency "actionpack", ">= 4.0.0"
30
30
  spec.add_development_dependency "pry"
31
31
  end
@@ -3,7 +3,14 @@ require 'action_controller'
3
3
  class MetalController < ActionController::Metal
4
4
  include Rack::Tracker::Controller
5
5
  include AbstractController::Rendering
6
- include ActionView::Layouts
6
+
7
+ # depending on the actionpack version the layout code was moved
8
+ if defined?(ActionView::Layouts)
9
+ include ActionView::Layouts # => this is the new and shiny
10
+ else
11
+ include AbstractController::Layouts
12
+ end
13
+
7
14
  append_view_path File.join(File.dirname(__FILE__), '../fixtures/views')
8
15
  layout 'application'
9
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-20 00:00:00.000000000 Z
12
+ date: 2014-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 1.5.2
20
+ version: 1.4.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 1.5.2
27
+ version: 1.4.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: tilt
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -45,14 +45,28 @@ dependencies:
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 4.0.0
48
+ version: '3.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 4.0.0
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: actionpack
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '3.0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '3.0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: bundler
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -109,20 +123,6 @@ dependencies:
109
123
  - - "~>"
110
124
  - !ruby/object:Gem::Version
111
125
  version: 2.4.1
112
- - !ruby/object:Gem::Dependency
113
- name: actionpack
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: 4.0.0
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: 4.0.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: pry
128
128
  requirement: !ruby/object:Gem::Requirement