neutral 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28bba1188ad74ced81d86d0eb403f409096a47fa
4
- data.tar.gz: c8f8894572d72f30ebfb941e8d94762d5779f5da
3
+ metadata.gz: e83ee56c8fc7a787238c1e0ba3c22111fb939fc1
4
+ data.tar.gz: 0d4aa6e7ac6764008c1906a34fb9ce5020ea0c1a
5
5
  SHA512:
6
- metadata.gz: fc745f228aad30bd887a3e4d821f2eae223165bb4186c3ed6bcd6c149976a954fe07dbe89f475abe3d253c058924352196c38761ec136fa13c7a239c68c62dfc
7
- data.tar.gz: 317ec623838b2d8e8c15a7dcad67515667280e25b65ae7050fbbd57f3803f8a08c9ed674a544d2ab6896818e8ca1946ab0fca025f39bdbb4bea2706545f52b26
6
+ metadata.gz: 270976a25f3af1dd261df7017f9fb5634dcfd16f2f4027696e9b6cfc26ccca3020a4ec105c79f937be4aa56e7121b8d0d6dde4ca3cc2e8581d07549a632d841d
7
+ data.tar.gz: 4575c4016b18eba8ddcbaa1a98df2cb3212fd0729e08c0524875491779cb5ebcd0cfdfcc23872ebf514474fe9d76288b2c60273b9ad999e33976369706ae459b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neutral (0.0.3)
4
+ neutral (0.0.4)
5
5
  font-awesome-rails (~> 4.0.3.1)
6
6
  jquery-rails
7
7
  rails (~> 4.0.0)
@@ -6,14 +6,10 @@ module Neutral
6
6
  ::ActiveSupport.on_load(:active_record) { extend Neutral::Model::ActiveRecordExtension }
7
7
  ::ActiveSupport.on_load(:action_view) { include Neutral::Helpers::ActionViewExtension }
8
8
  ::ActionDispatch::Routing::Mapper.send(:include, Neutral::Helpers::Routes)
9
+ ::ApplicationController.send(:include, Neutral::Helpers::CurrentVoter)
9
10
  end
10
11
 
11
12
  config.after_initialize do
12
- ::ApplicationController.class_eval do
13
- alias_method :current_voter, Neutral.config.current_voter_method
14
- helper_method :current_voter
15
- end
16
-
17
13
  require 'neutral/application_controller'
18
14
  end
19
15
 
@@ -0,0 +1,15 @@
1
+ module Neutral
2
+ module Helpers
3
+ module CurrentVoter
4
+ extend ActiveSupport::Concern
5
+
6
+ def current_voter
7
+ send Neutral.config.current_voter_method
8
+ end
9
+
10
+ included do
11
+ helper_method :current_voter
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Neutral
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/neutral.rb CHANGED
@@ -24,6 +24,7 @@ module Neutral
24
24
 
25
25
  module Helpers
26
26
  autoload :Routes, 'neutral/helpers/routes'
27
+ autoload :CurrentVoter, 'neutral/helpers/current_voter'
27
28
  autoload :ActionViewExtension, 'neutral/helpers/action_view_extension'
28
29
  end
29
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neutral
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Tóth
@@ -277,6 +277,7 @@ files:
277
277
  - lib/neutral/engine.rb
278
278
  - lib/neutral/errors.rb
279
279
  - lib/neutral/helpers/action_view_extension.rb
280
+ - lib/neutral/helpers/current_voter.rb
280
281
  - lib/neutral/helpers/routes.rb
281
282
  - lib/neutral/icons/collection.rb
282
283
  - lib/neutral/icons/set.rb