rails_helper 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzgzYmUxNTFkNzE1ZTE0ZjgxNjRlYjEzNjI2NzQxYjhjYzk1ZTMzYw==
4
+ ZjYyZmNiYjM4YmM3NWE1Mzg4ZmNjNDAwOGQwZTY1ZDExYjNhNGFlZQ==
5
5
  data.tar.gz: !binary |-
6
- OTVlYzBjZTI3ZDQ2ZDZiNWQ4NzgzMDg1NjIzMDk2MTk2YmQ0ZGM4Nw==
6
+ YTM1NTJjOWE1MGIwZTI4YjMxZmFkNDJkZjJjNjFiM2U5ODMwYjNmNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NmIyN2YzNzMwODRlZDRhNjM3MzVjMmUyNGIwZDZlODlhMWVkYjEwMjA3ZjM5
10
- ZTlmM2VkOTZkNTc1NWY4MjFiYWEyM2ExOWRhMTM3NTVlMGI4Y2RkNzgzNTY3
11
- Y2U2YjhhNmU5NWZlZmE0MDRlYzY1NjcxYzY5M2VmZjk2MTk4MWE=
9
+ YTY5NzE2M2ZjOTMzZjU4MmMyZDg4OGNkNGY1NjFkNWEwMDUwMzRlNjFjNmI5
10
+ NTRiYzkzYTBmMmI0ZTZiZDFhMDMyOTNiYzc1ODk4NjVmNjg0MjQ4N2FlZGZm
11
+ MzZjMmFlNDU5NGFjOWVmNWM4NjA2MDVjYjhiN2JhNWY1NzE0ZDg=
12
12
  data.tar.gz: !binary |-
13
- OTY5N2FiYWVmNTA5NjBkNDBmZGVkMDA1N2Y0MzRiNjAyMDA5YzhmNmI5NDc5
14
- YTBlM2RmOTQxM2EzYmUyMzk3MDIyYzc5ZDhmN2NmZGNlMDA0YzNhMjFlNDgz
15
- YmY2MzA3MTNiMjZjYTY2Y2E4MTJkNWZhNDExMmY3MjgwM2NkNGI=
13
+ MGM4MmU4ODUzYzIzZGE3OWY3MjU1ZjZlZDk5MDExOThjYzY1ZjU4ZjFhZGNm
14
+ ZWIxZWU1MmE1YTI0MDBjNWNiNmM1ZDMwZDRjOGIxYTQyNzhiOWI1OTI3NmJk
15
+ YzRkMWE5MDdkNTU3ZjU0YjQ2NWIxYTQ1MWFkZWE2ZmU2MzVmZGI=
@@ -1,6 +1,6 @@
1
1
  class Helper < (defined?(ActionView::Base) ? ActionView::Base : Object)
2
2
  def Helper.version
3
- '2.0.0'
3
+ '2.1.0'
4
4
  end
5
5
 
6
6
  def Helper.dependencies
@@ -15,27 +15,35 @@ class Helper < (defined?(ActionView::Base) ? ActionView::Base : Object)
15
15
  controllers, args = args.partition{|arg| ActionController::Base === arg}
16
16
  controller = controllers.first || Helper.current_controller || Helper.mock_controller
17
17
 
18
+ controller_class = controller.send(:class)
19
+
18
20
  helpers = args
19
21
  helpers.push(nil) if helpers.empty?
20
22
 
21
23
  helpers.flatten!
22
24
  helpers.uniq!
23
25
 
24
- helpers.map! do |mod|
26
+ modules = []
27
+
28
+ helpers.each do |mod|
25
29
  case mod
26
30
  when NilClass, :all, 'all'
27
- ::ActionView::Helpers
31
+ controller_class.send(:all_application_helpers).each do |name|
32
+ file_name = name.to_s.underscore + '_helper'
33
+ mod = file_name.camelize.constantize
34
+ modules.push(mod)
35
+ end
28
36
  when Module
29
- mod
37
+ modules.push(mod)
30
38
  else
31
- raise ArgumentError, mod.class.name
39
+ raise(ArgumentError, mod.inspect)
32
40
  end
33
41
  end
34
42
 
35
43
  view_class =
36
44
  Class.new(self) do
37
- helpers.each do |helper|
38
- include helper
45
+ modules.each do |mod|
46
+ include mod
39
47
  end
40
48
  self.helpers = helpers
41
49
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "rails_helper"
6
- spec.version = "2.0.0"
6
+ spec.version = "2.1.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "rails_helper"
9
9
  spec.description = "description: rails_helper kicks the ass"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails_current