actionview 4.1.11 → 4.1.12.rc1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86a7c35ba27facd8680b7b03bcf198ea5b2a1eac
4
- data.tar.gz: 06b6d3b522b523e76075c83e46830f4e7cb237f8
3
+ metadata.gz: d4579d4bb5091c4a1d706e1d15aab1c43745ee20
4
+ data.tar.gz: a5f867579e0c61369c9f352e65277e6a62259b5e
5
5
  SHA512:
6
- metadata.gz: c03311b012f9dd223a5f02cb6aac490e07c2db849e198695c3eb2a89136778a8f4e03ac92351d3aa8ae07bc74e12a08eba8def121b80f06040cc6df47be04366
7
- data.tar.gz: 23ef5113036fe3ea531192b93b3d2613aa53a1c46d8d9d3f14ad5a30512739824d78e5d7333033b7999a1535bbca098585233e03ef283ac4471ee94c2b2197db
6
+ metadata.gz: 305a2ff2d3a1e51c3b758a8b2ed4b73e93e99e8d9360a72669e3a345d48337a5245f4d16f25604599b95ae83020118fce6b3d577432b6e735485b75d7f7408d3
7
+ data.tar.gz: 8c4e7446a7366f1226f5d4140e21af8903ca4d9326c3b2596f9938941545f108e74c4cc969e426a3bdca17772b80448ee62b5ec7d15a4639eb72748197ab5485
@@ -1,3 +1,28 @@
1
+ ## Rails 4.1.12 (June 22, 2015) ##
2
+
3
+ * `translate` should handle `raise` flag correctly in case of both main and default
4
+ translation is missing.
5
+
6
+ Fixes #19967
7
+
8
+ *Bernard Potocki*
9
+
10
+ * `translate` should accept nils as members of the `:default`
11
+ parameter without raising a translation missing error. Fixes a
12
+ regression introduced 362557e.
13
+
14
+ Fixes #19419
15
+
16
+ *Justin Coyne*
17
+
18
+ * `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
19
+ as input when `precision: 0` is used.
20
+
21
+ Fixes #19227.
22
+
23
+ *Yves Senn*
24
+
25
+
1
26
  ## Rails 4.1.11 (June 16, 2015) ##
2
27
 
3
28
  * No changes.
@@ -7,8 +7,8 @@ module ActionView
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 11
11
- PRE = nil
10
+ TINY = 12
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -111,7 +111,7 @@ module ActionView
111
111
  #
112
112
  # Now all you'll have to do is change that timestamp when the helper method changes.
113
113
  def cache(name = {}, options = nil, &block)
114
- if controller.perform_caching
114
+ if controller.respond_to?(:perform_caching) && controller.perform_caching
115
115
  safe_concat(fragment_for(cache_fragment_name(name, options), options, &block))
116
116
  else
117
117
  yield
@@ -194,7 +194,9 @@ module ActionView
194
194
  def with_output_buffer(buf = nil) #:nodoc:
195
195
  unless buf
196
196
  buf = ActionView::OutputBuffer.new
197
- buf.force_encoding(output_buffer.encoding) if output_buffer
197
+ if output_buffer && output_buffer.respond_to?(:encoding)
198
+ buf.force_encoding(output_buffer.encoding)
199
+ end
198
200
  end
199
201
  self.output_buffer, old_buffer = buf, output_buffer
200
202
  yield
@@ -37,7 +37,7 @@ module ActionView
37
37
  def translate(key, options = {})
38
38
  options = options.dup
39
39
  has_default = options.has_key?(:default)
40
- remaining_defaults = Array(options.delete(:default))
40
+ remaining_defaults = Array(options.delete(:default)).compact
41
41
 
42
42
  if has_default && !remaining_defaults.first.kind_of?(Symbol)
43
43
  options[:default] = remaining_defaults.shift
@@ -48,10 +48,10 @@ module ActionView
48
48
  # Note: `raise_error` refers to us re-raising the error in this method. I18n is forced to raise by default.
49
49
  if options[:raise] == false || (options.key?(:rescue_format) && options[:rescue_format].nil?)
50
50
  raise_error = false
51
- options[:raise] = false
51
+ i18n_raise = false
52
52
  else
53
53
  raise_error = options[:raise] || options[:rescue_format] || ActionView::Base.raise_on_missing_translations
54
- options[:raise] = true
54
+ i18n_raise = true
55
55
  end
56
56
 
57
57
  if html_safe_translation_key?(key)
@@ -61,11 +61,11 @@ module ActionView
61
61
  html_safe_options[name] = ERB::Util.html_escape(value.to_s)
62
62
  end
63
63
  end
64
- translation = I18n.translate(scope_key_by_partial(key), html_safe_options)
64
+ translation = I18n.translate(scope_key_by_partial(key), html_safe_options.merge(raise: i18n_raise))
65
65
 
66
66
  translation.respond_to?(:html_safe) ? translation.html_safe : translation
67
67
  else
68
- I18n.translate(scope_key_by_partial(key), options)
68
+ I18n.translate(scope_key_by_partial(key), options.merge(raise: i18n_raise))
69
69
  end
70
70
  rescue I18n::MissingTranslationData => e
71
71
  if remaining_defaults.present?
@@ -2,20 +2,22 @@ namespace :cache_digests do
2
2
  desc 'Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
3
3
  task :nested_dependencies => :environment do
4
4
  abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
5
- puts JSON.pretty_generate ActionView::Digestor.new(name: template_name, finder: finder).nested_dependencies
5
+ puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).nested_dependencies
6
6
  end
7
7
 
8
8
  desc 'Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
9
9
  task :dependencies => :environment do
10
10
  abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
11
- puts JSON.pretty_generate ActionView::Digestor.new(name: template_name, finder: finder).dependencies
11
+ puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).dependencies
12
12
  end
13
13
 
14
- def template_name
15
- ENV['TEMPLATE'].split('.', 2).first
16
- end
14
+ class CacheDigests
15
+ def self.template_name
16
+ ENV['TEMPLATE'].split('.', 2).first
17
+ end
17
18
 
18
- def finder
19
- ApplicationController.new.lookup_context
19
+ def self.finder
20
+ ApplicationController.new.lookup_context
21
+ end
20
22
  end
21
23
  end
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.1.11
4
+ version: 4.1.12.rc1
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: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-22 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.1.11
19
+ version: 4.1.12.rc1
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.1.11
26
+ version: 4.1.12.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.11
61
+ version: 4.1.12.rc1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.11
68
+ version: 4.1.12.rc1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activemodel
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 4.1.11
75
+ version: 4.1.12.rc1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 4.1.11
82
+ version: 4.1.12.rc1
83
83
  description: Simple, battle-tested conventions and helpers for building web pages.
84
84
  email: david@loudthinking.com
85
85
  executables: []
@@ -207,9 +207,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  version: 1.9.3
208
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
- - - ">="
210
+ - - ">"
211
211
  - !ruby/object:Gem::Version
212
- version: '0'
212
+ version: 1.3.1
213
213
  requirements:
214
214
  - none
215
215
  rubyforge_project: