omniturize 1.0.1 → 1.0.2

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,3 +1,3 @@
1
1
  module Omniturize
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -8,7 +8,7 @@ module Omniturize
8
8
  module ClassMethods
9
9
  def omniturize(options = {})
10
10
  include InstanceMethods
11
- before_filter :set_reporter, options
11
+ before_filter{|c| c.send(:set_reporter, options.reverse_merge(:reporter => c.class.name.gsub(/Controller$/, '')))}
12
12
  attr_accessor :reporter
13
13
  end
14
14
  end
@@ -18,10 +18,8 @@ module Omniturize
18
18
  private
19
19
 
20
20
  def set_reporter(options = {})
21
-
22
21
  @reporter ||= begin
23
- options[:controller].present? ? "#{options[:controller].classify}Reporter".constantize.new(self) :
24
- "#{self.class.name.gsub(/Controller$/, '')}Reporter".constantize.new(self)
22
+ "#{options[:reporter].classify.pluralize}Reporter".constantize.new(self)
25
23
  rescue NameError
26
24
  BasicReporter.new(self)
27
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniturize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - eLafo
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-21 00:00:00 Z
18
+ date: 2011-10-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: meta_vars