actionpack 3.2.18 → 3.2.19

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

Potentially problematic release.


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

@@ -1,3 +1,13 @@
1
+ ## Rails 3.2.19 (Jul 2, 2014) ##
2
+
3
+ * Fix regression when using `ActionView::Helpers::TranslationHelper#translate` with
4
+ `options[:raise]`.
5
+
6
+ This regression was introduced at ec16ba75a5493b9da972eea08bae630eba35b62f.
7
+
8
+ *Shota Fukumori (sora_h)*
9
+
10
+
1
11
  ## Rails 3.2.18 (May 6, 2014) ##
2
12
 
3
13
  * Only accept actions without File::SEPARATOR in the name.
@@ -22,7 +22,7 @@ module ActionController
22
22
  #
23
23
  # ==== Options
24
24
  # * <tt>only</tt> - The callback should be run only for this action
25
- # * <tt>except<tt> - The callback should be run for all actions except this action
25
+ # * <tt>except</tt> - The callback should be run for all actions except this action
26
26
  def force_ssl(options = {})
27
27
  host = options.delete(:host)
28
28
  before_filter(options) do
@@ -2,7 +2,7 @@ module ActionPack
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- TINY = 18
5
+ TINY = 19
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -129,10 +129,10 @@ module ActionView
129
129
  #
130
130
  # number_to_currency(-1234567890.50, :negative_format => "(%u%n)")
131
131
  # # => ($1,234,567,890.50)
132
- # number_to_currency(1234567890.50, :unit => "&pound;", :separator => ",", :delimiter => "")
133
- # # => &pound;1234567890,50
134
- # number_to_currency(1234567890.50, :unit => "&pound;", :separator => ",", :delimiter => "", :format => "%n %u")
135
- # # => 1234567890,50 &pound;
132
+ # number_to_currency(1234567890.50, :unit => "R$", :separator => ",", :delimiter => "")
133
+ # # => R$1234567890,50
134
+ # number_to_currency(1234567890.50, :unit => "R$", :separator => ",", :delimiter => "", :format => "%n %u")
135
+ # # => 1234567890,50 R$
136
136
  def number_to_currency(number, options = {})
137
137
  return unless number
138
138
 
@@ -36,7 +36,13 @@ module ActionView
36
36
  def translate(key, options = {})
37
37
  # If the user has specified rescue_format then pass it all through, otherwise use
38
38
  # raise and do the work ourselves
39
- options[:raise] = true unless options.key?(:raise) || options.key?(:rescue_format)
39
+ if options.key?(:raise) || options.key?(:rescue_format)
40
+ raise_error = options[:raise] || options[:rescue_format]
41
+ else
42
+ raise_error = false
43
+ options[:raise] = true
44
+ end
45
+
40
46
  if html_safe_translation_key?(key)
41
47
  html_safe_options = options.dup
42
48
  options.except(*I18n::RESERVED_KEYS).each do |name, value|
@@ -51,6 +57,8 @@ module ActionView
51
57
  I18n.translate(scope_key_by_partial(key), options)
52
58
  end
53
59
  rescue I18n::MissingTranslationData => e
60
+ raise e if raise_error
61
+
54
62
  keys = I18n.normalize_keys(e.locale, e.key, e.options[:scope])
55
63
  content_tag('span', keys.last.to_s.titleize, :class => 'translation_missing', :title => "translation missing: #{keys.join('.')}")
56
64
  end
@@ -120,13 +120,7 @@ module ActionView
120
120
  def query(path, details, formats)
121
121
  query = build_query(path, details)
122
122
 
123
- # deals with case-insensitive file systems.
124
- sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
125
-
126
- template_paths = Dir[query].reject { |filename|
127
- File.directory?(filename) ||
128
- !sanitizer[File.dirname(filename)].include?(filename)
129
- }
123
+ template_paths = find_template_paths query
130
124
 
131
125
  template_paths.map { |template|
132
126
  handler, format = extract_handler_and_format(template, formats)
@@ -139,6 +133,26 @@ module ActionView
139
133
  }
140
134
  end
141
135
 
136
+ if RUBY_VERSION >= '2.2.0'
137
+ def find_template_paths(query)
138
+ Dir[query].reject { |filename|
139
+ File.directory?(filename) ||
140
+ # deals with case-insensitive file systems.
141
+ !File.fnmatch(query, filename, File::FNM_EXTGLOB)
142
+ }
143
+ end
144
+ else
145
+ def find_template_paths(query)
146
+ # deals with case-insensitive file systems.
147
+ sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
148
+
149
+ Dir[query].reject { |filename|
150
+ File.directory?(filename) ||
151
+ !sanitizer[File.dirname(filename)].include?(filename)
152
+ }
153
+ end
154
+ end
155
+
142
156
  # Helper for building query glob string based on resolver's pattern.
143
157
  def build_query(path, details)
144
158
  query = @pattern.dup
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 18
10
- version: 3.2.18
9
+ - 19
10
+ version: 3.2.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Heinemeier Hansson
@@ -15,44 +15,43 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-05-06 00:00:00 Z
18
+ date: 2014-07-02 00:00:00 -03:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- type: :runtime
22
- name: activesupport
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &id001 !ruby/object:Gem::Requirement
24
23
  none: false
25
24
  requirements:
26
25
  - - "="
27
26
  - !ruby/object:Gem::Version
28
- hash: 43
27
+ hash: 41
29
28
  segments:
30
29
  - 3
31
30
  - 2
32
- - 18
33
- version: 3.2.18
31
+ - 19
32
+ version: 3.2.19
33
+ type: :runtime
34
+ version_requirements: *id001
34
35
  prerelease: false
35
- requirement: *id001
36
+ name: activesupport
36
37
  - !ruby/object:Gem::Dependency
37
- type: :runtime
38
- name: activemodel
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
42
41
  - - "="
43
42
  - !ruby/object:Gem::Version
44
- hash: 43
43
+ hash: 41
45
44
  segments:
46
45
  - 3
47
46
  - 2
48
- - 18
49
- version: 3.2.18
47
+ - 19
48
+ version: 3.2.19
49
+ type: :runtime
50
+ version_requirements: *id002
50
51
  prerelease: false
51
- requirement: *id002
52
+ name: activemodel
52
53
  - !ruby/object:Gem::Dependency
53
- type: :runtime
54
- name: rack-cache
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
56
55
  none: false
57
56
  requirements:
58
57
  - - ~>
@@ -62,12 +61,12 @@ dependencies:
62
61
  - 1
63
62
  - 2
64
63
  version: "1.2"
64
+ type: :runtime
65
+ version_requirements: *id003
65
66
  prerelease: false
66
- requirement: *id003
67
+ name: rack-cache
67
68
  - !ruby/object:Gem::Dependency
68
- type: :runtime
69
- name: builder
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ requirement: &id004 !ruby/object:Gem::Requirement
71
70
  none: false
72
71
  requirements:
73
72
  - - ~>
@@ -78,12 +77,12 @@ dependencies:
78
77
  - 0
79
78
  - 0
80
79
  version: 3.0.0
80
+ type: :runtime
81
+ version_requirements: *id004
81
82
  prerelease: false
82
- requirement: *id004
83
+ name: builder
83
84
  - !ruby/object:Gem::Dependency
84
- type: :runtime
85
- name: rack
86
- version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ requirement: &id005 !ruby/object:Gem::Requirement
87
86
  none: false
88
87
  requirements:
89
88
  - - ~>
@@ -94,12 +93,12 @@ dependencies:
94
93
  - 4
95
94
  - 5
96
95
  version: 1.4.5
96
+ type: :runtime
97
+ version_requirements: *id005
97
98
  prerelease: false
98
- requirement: *id005
99
+ name: rack
99
100
  - !ruby/object:Gem::Dependency
100
- type: :runtime
101
- name: rack-test
102
- version_requirements: &id006 !ruby/object:Gem::Requirement
101
+ requirement: &id006 !ruby/object:Gem::Requirement
103
102
  none: false
104
103
  requirements:
105
104
  - - ~>
@@ -110,12 +109,12 @@ dependencies:
110
109
  - 6
111
110
  - 1
112
111
  version: 0.6.1
112
+ type: :runtime
113
+ version_requirements: *id006
113
114
  prerelease: false
114
- requirement: *id006
115
+ name: rack-test
115
116
  - !ruby/object:Gem::Dependency
116
- type: :runtime
117
- name: journey
118
- version_requirements: &id007 !ruby/object:Gem::Requirement
117
+ requirement: &id007 !ruby/object:Gem::Requirement
119
118
  none: false
120
119
  requirements:
121
120
  - - ~>
@@ -126,12 +125,12 @@ dependencies:
126
125
  - 0
127
126
  - 4
128
127
  version: 1.0.4
128
+ type: :runtime
129
+ version_requirements: *id007
129
130
  prerelease: false
130
- requirement: *id007
131
+ name: journey
131
132
  - !ruby/object:Gem::Dependency
132
- type: :runtime
133
- name: sprockets
134
- version_requirements: &id008 !ruby/object:Gem::Requirement
133
+ requirement: &id008 !ruby/object:Gem::Requirement
135
134
  none: false
136
135
  requirements:
137
136
  - - ~>
@@ -142,12 +141,12 @@ dependencies:
142
141
  - 2
143
142
  - 1
144
143
  version: 2.2.1
144
+ type: :runtime
145
+ version_requirements: *id008
145
146
  prerelease: false
146
- requirement: *id008
147
+ name: sprockets
147
148
  - !ruby/object:Gem::Dependency
148
- type: :runtime
149
- name: erubis
150
- version_requirements: &id009 !ruby/object:Gem::Requirement
149
+ requirement: &id009 !ruby/object:Gem::Requirement
151
150
  none: false
152
151
  requirements:
153
152
  - - ~>
@@ -158,12 +157,12 @@ dependencies:
158
157
  - 7
159
158
  - 0
160
159
  version: 2.7.0
160
+ type: :runtime
161
+ version_requirements: *id009
161
162
  prerelease: false
162
- requirement: *id009
163
+ name: erubis
163
164
  - !ruby/object:Gem::Dependency
164
- type: :development
165
- name: tzinfo
166
- version_requirements: &id010 !ruby/object:Gem::Requirement
165
+ requirement: &id010 !ruby/object:Gem::Requirement
167
166
  none: false
168
167
  requirements:
169
168
  - - ~>
@@ -174,8 +173,10 @@ dependencies:
174
173
  - 3
175
174
  - 29
176
175
  version: 0.3.29
176
+ type: :development
177
+ version_requirements: *id010
177
178
  prerelease: false
178
- requirement: *id010
179
+ name: tzinfo
179
180
  description: Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.
180
181
  email: david@loudthinking.com
181
182
  executables: []
@@ -376,6 +377,7 @@ files:
376
377
  - lib/sprockets/helpers.rb
377
378
  - lib/sprockets/railtie.rb
378
379
  - lib/sprockets/static_compiler.rb
380
+ has_rdoc: true
379
381
  homepage: http://www.rubyonrails.org
380
382
  licenses:
381
383
  - MIT
@@ -407,7 +409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
409
  requirements:
408
410
  - none
409
411
  rubyforge_project:
410
- rubygems_version: 1.8.15
412
+ rubygems_version: 1.6.2
411
413
  signing_key:
412
414
  specification_version: 3
413
415
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).