actionview 4.2.11 → 5.0.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionview might be problematic. Click here for more details.

Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +304 -184
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +2 -3
  5. data/lib/action_view.rb +1 -1
  6. data/lib/action_view/base.rb +14 -2
  7. data/lib/action_view/dependency_tracker.rb +51 -18
  8. data/lib/action_view/digestor.rb +83 -81
  9. data/lib/action_view/flows.rb +4 -5
  10. data/lib/action_view/gem_version.rb +3 -3
  11. data/lib/action_view/helpers/asset_tag_helper.rb +15 -5
  12. data/lib/action_view/helpers/asset_url_helper.rb +51 -12
  13. data/lib/action_view/helpers/atom_feed_helper.rb +6 -5
  14. data/lib/action_view/helpers/cache_helper.rb +62 -21
  15. data/lib/action_view/helpers/capture_helper.rb +5 -4
  16. data/lib/action_view/helpers/controller_helper.rb +11 -2
  17. data/lib/action_view/helpers/date_helper.rb +59 -13
  18. data/lib/action_view/helpers/debug_helper.rb +1 -1
  19. data/lib/action_view/helpers/form_helper.rb +74 -72
  20. data/lib/action_view/helpers/form_options_helper.rb +79 -39
  21. data/lib/action_view/helpers/form_tag_helper.rb +74 -44
  22. data/lib/action_view/helpers/javascript_helper.rb +4 -4
  23. data/lib/action_view/helpers/number_helper.rb +28 -13
  24. data/lib/action_view/helpers/output_safety_helper.rb +32 -2
  25. data/lib/action_view/helpers/record_tag_helper.rb +12 -99
  26. data/lib/action_view/helpers/rendering_helper.rb +2 -2
  27. data/lib/action_view/helpers/sanitize_helper.rb +1 -2
  28. data/lib/action_view/helpers/tag_helper.rb +19 -11
  29. data/lib/action_view/helpers/tags/base.rb +45 -29
  30. data/lib/action_view/helpers/tags/collection_check_boxes.rb +4 -28
  31. data/lib/action_view/helpers/tags/collection_helpers.rb +32 -0
  32. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +1 -9
  33. data/lib/action_view/helpers/tags/datetime_field.rb +1 -1
  34. data/lib/action_view/helpers/tags/label.rb +1 -1
  35. data/lib/action_view/helpers/tags/placeholderable.rb +1 -1
  36. data/lib/action_view/helpers/tags/search_field.rb +12 -9
  37. data/lib/action_view/helpers/tags/text_field.rb +0 -1
  38. data/lib/action_view/helpers/tags/translator.rb +1 -1
  39. data/lib/action_view/helpers/text_helper.rb +27 -11
  40. data/lib/action_view/helpers/translation_helper.rb +56 -26
  41. data/lib/action_view/helpers/url_helper.rb +108 -79
  42. data/lib/action_view/layouts.rb +11 -10
  43. data/lib/action_view/log_subscriber.rb +35 -1
  44. data/lib/action_view/lookup_context.rb +69 -48
  45. data/lib/action_view/model_naming.rb +1 -1
  46. data/lib/action_view/path_set.rb +9 -0
  47. data/lib/action_view/railtie.rb +18 -3
  48. data/lib/action_view/record_identifier.rb +45 -19
  49. data/lib/action_view/renderer/abstract_renderer.rb +7 -3
  50. data/lib/action_view/renderer/partial_renderer.rb +38 -37
  51. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +49 -0
  52. data/lib/action_view/renderer/renderer.rb +2 -6
  53. data/lib/action_view/renderer/streaming_template_renderer.rb +1 -1
  54. data/lib/action_view/renderer/template_renderer.rb +11 -10
  55. data/lib/action_view/rendering.rb +15 -7
  56. data/lib/action_view/routing_url_for.rb +18 -6
  57. data/lib/action_view/tasks/{dependencies.rake → cache_digests.rake} +2 -2
  58. data/lib/action_view/template.rb +36 -12
  59. data/lib/action_view/template/error.rb +20 -9
  60. data/lib/action_view/template/handlers.rb +6 -4
  61. data/lib/action_view/template/handlers/html.rb +9 -0
  62. data/lib/action_view/template/handlers/raw.rb +1 -3
  63. data/lib/action_view/template/resolver.rb +49 -42
  64. data/lib/action_view/template/types.rb +14 -16
  65. data/lib/action_view/test_case.rb +15 -9
  66. data/lib/action_view/testing/resolvers.rb +1 -2
  67. data/lib/action_view/view_paths.rb +6 -24
  68. metadata +16 -20
@@ -24,11 +24,11 @@ module ActionView
24
24
  def initialize
25
25
  super
26
26
  self.class.controller_path = ""
27
- @request = ActionController::TestRequest.new
28
- @response = ActionController::TestResponse.new
27
+ @request = ActionController::TestRequest.create
28
+ @response = ActionDispatch::TestResponse.new
29
29
 
30
30
  @request.env.delete('PATH_INFO')
31
- @params = {}
31
+ @params = ActionController::Parameters.new
32
32
  end
33
33
  end
34
34
 
@@ -153,6 +153,7 @@ module ActionView
153
153
 
154
154
  included do
155
155
  setup :setup_with_controller
156
+ ActiveSupport.run_load_hooks(:action_view_test_case, self)
156
157
  end
157
158
 
158
159
  private
@@ -204,7 +205,7 @@ module ActionView
204
205
  def view
205
206
  @view ||= begin
206
207
  view = @controller.view_context
207
- view.singleton_class.send :include, _helpers
208
+ view.singleton_class.include(_helpers)
208
209
  view.extend(Locals)
209
210
  view.rendered_views = self.rendered_views
210
211
  view.output_buffer = self.output_buffer
@@ -241,8 +242,7 @@ module ActionView
241
242
  :@view,
242
243
  :@view_context_class,
243
244
  :@_subscribers,
244
- :@html_document,
245
- :@html_scanner_document
245
+ :@html_document
246
246
  ]
247
247
 
248
248
  def _user_defined_ivars
@@ -264,9 +264,15 @@ module ActionView
264
264
  end
265
265
 
266
266
  def method_missing(selector, *args)
267
- if @controller.respond_to?(:_routes) &&
268
- ( @controller._routes.named_routes.route_defined?(selector) ||
269
- @controller._routes.mounted_helpers.method_defined?(selector) )
267
+ begin
268
+ routes = @controller.respond_to?(:_routes) && @controller._routes
269
+ rescue
270
+ # Dont call routes, if there is an error on _routes call
271
+ end
272
+
273
+ if routes &&
274
+ ( routes.named_routes.route_defined?(selector) ||
275
+ routes.mounted_helpers.method_defined?(selector) )
270
276
  @controller.__send__(selector, *args)
271
277
  else
272
278
  super
@@ -46,9 +46,8 @@ module ActionView #:nodoc:
46
46
  class NullResolver < PathResolver
47
47
  def query(path, exts, formats, _)
48
48
  handler, format, variant = extract_handler_and_format_and_variant(path, formats)
49
- [ActionView::Template.new("Template generated by Null Resolver", path, handler, :virtual_path => path, :format => format, :variant => variant)]
49
+ [ActionView::Template.new("Template generated by Null Resolver", path.virtual, handler, :virtual_path => path.virtual, :format => format, :variant => variant)]
50
50
  end
51
51
  end
52
-
53
52
  end
54
53
 
@@ -1,5 +1,3 @@
1
- require 'action_view/base'
2
-
3
1
  module ActionView
4
2
  module ViewPaths
5
3
  extend ActiveSupport::Concern
@@ -10,20 +8,15 @@ module ActionView
10
8
  self._view_paths.freeze
11
9
  end
12
10
 
13
- delegate :template_exists?, :view_paths, :formats, :formats=,
11
+ delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=,
14
12
  :locale, :locale=, :to => :lookup_context
15
13
 
16
14
  module ClassMethods
17
15
  def _prefixes # :nodoc:
18
16
  @_prefixes ||= begin
19
- deprecated_prefixes = handle_deprecated_parent_prefixes
20
- if deprecated_prefixes
21
- deprecated_prefixes
22
- else
23
- return local_prefixes if superclass.abstract?
17
+ return local_prefixes if superclass.abstract?
24
18
 
25
- local_prefixes + superclass._prefixes
26
- end
19
+ local_prefixes + superclass._prefixes
27
20
  end
28
21
  end
29
22
 
@@ -34,17 +27,6 @@ module ActionView
34
27
  def local_prefixes
35
28
  [controller_path]
36
29
  end
37
-
38
- def handle_deprecated_parent_prefixes # TODO: remove in 4.3/5.0.
39
- return unless respond_to?(:parent_prefixes)
40
-
41
- ActiveSupport::Deprecation.warn(<<-MSG.squish)
42
- Overriding `ActionController::Base::parent_prefixes` is deprecated,
43
- override `.local_prefixes` instead.
44
- MSG
45
-
46
- local_prefixes + parent_prefixes
47
- end
48
30
  end
49
31
 
50
32
  # The prefixes used in render "foo" shortcuts.
@@ -52,9 +34,9 @@ module ActionView
52
34
  self.class._prefixes
53
35
  end
54
36
 
55
- # LookupContext is the object responsible to hold all information required to lookup
56
- # templates, i.e. view paths and details. Check ActionView::LookupContext for more
57
- # information.
37
+ # <tt>LookupContext</tt> is the object responsible for holding all
38
+ # information required for looking up templates, i.e. view paths and
39
+ # details. Check <tt>ActionView::LookupContext</tt> for more information.
58
40
  def lookup_context
59
41
  @_lookup_context ||=
60
42
  ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.11
4
+ version: 5.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.11
19
+ version: 5.0.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.11
26
+ version: 5.0.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,48 +78,42 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.0'
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: 1.0.5
81
+ version: '2.0'
85
82
  type: :runtime
86
83
  prerelease: false
87
84
  version_requirements: !ruby/object:Gem::Requirement
88
85
  requirements:
89
86
  - - "~>"
90
87
  - !ruby/object:Gem::Version
91
- version: '1.0'
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 1.0.5
88
+ version: '2.0'
95
89
  - !ruby/object:Gem::Dependency
96
90
  name: actionpack
97
91
  requirement: !ruby/object:Gem::Requirement
98
92
  requirements:
99
93
  - - '='
100
94
  - !ruby/object:Gem::Version
101
- version: 4.2.11
95
+ version: 5.0.7
102
96
  type: :development
103
97
  prerelease: false
104
98
  version_requirements: !ruby/object:Gem::Requirement
105
99
  requirements:
106
100
  - - '='
107
101
  - !ruby/object:Gem::Version
108
- version: 4.2.11
102
+ version: 5.0.7
109
103
  - !ruby/object:Gem::Dependency
110
104
  name: activemodel
111
105
  requirement: !ruby/object:Gem::Requirement
112
106
  requirements:
113
107
  - - '='
114
108
  - !ruby/object:Gem::Version
115
- version: 4.2.11
109
+ version: 5.0.7
116
110
  type: :development
117
111
  prerelease: false
118
112
  version_requirements: !ruby/object:Gem::Requirement
119
113
  requirements:
120
114
  - - '='
121
115
  - !ruby/object:Gem::Version
122
- version: 4.2.11
116
+ version: 5.0.7
123
117
  description: Simple, battle-tested conventions and helpers for building web pages.
124
118
  email: david@loudthinking.com
125
119
  executables: []
@@ -207,17 +201,19 @@ files:
207
201
  - lib/action_view/record_identifier.rb
208
202
  - lib/action_view/renderer/abstract_renderer.rb
209
203
  - lib/action_view/renderer/partial_renderer.rb
204
+ - lib/action_view/renderer/partial_renderer/collection_caching.rb
210
205
  - lib/action_view/renderer/renderer.rb
211
206
  - lib/action_view/renderer/streaming_template_renderer.rb
212
207
  - lib/action_view/renderer/template_renderer.rb
213
208
  - lib/action_view/rendering.rb
214
209
  - lib/action_view/routing_url_for.rb
215
- - lib/action_view/tasks/dependencies.rake
210
+ - lib/action_view/tasks/cache_digests.rake
216
211
  - lib/action_view/template.rb
217
212
  - lib/action_view/template/error.rb
218
213
  - lib/action_view/template/handlers.rb
219
214
  - lib/action_view/template/handlers/builder.rb
220
215
  - lib/action_view/template/handlers/erb.rb
216
+ - lib/action_view/template/handlers/html.rb
221
217
  - lib/action_view/template/handlers/raw.rb
222
218
  - lib/action_view/template/html.rb
223
219
  - lib/action_view/template/resolver.rb
@@ -227,7 +223,7 @@ files:
227
223
  - lib/action_view/testing/resolvers.rb
228
224
  - lib/action_view/version.rb
229
225
  - lib/action_view/view_paths.rb
230
- homepage: http://www.rubyonrails.org
226
+ homepage: http://rubyonrails.org
231
227
  licenses:
232
228
  - MIT
233
229
  metadata: {}
@@ -239,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
235
  requirements:
240
236
  - - ">="
241
237
  - !ruby/object:Gem::Version
242
- version: 1.9.3
238
+ version: 2.2.2
243
239
  required_rubygems_version: !ruby/object:Gem::Requirement
244
240
  requirements:
245
241
  - - ">="
@@ -248,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
244
  requirements:
249
245
  - none
250
246
  rubyforge_project:
251
- rubygems_version: 2.7.6
247
+ rubygems_version: 2.6.14
252
248
  signing_key:
253
249
  specification_version: 4
254
250
  summary: Rendering framework putting the V in MVC (part of Rails).