actionpack 3.2.13 → 3.2.14.rc1

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.

@@ -2,8 +2,8 @@ module ActionPack
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- TINY = 13
6
- PRE = nil
5
+ TINY = 14
6
+ PRE = "rc1"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
@@ -43,7 +43,7 @@ module ActionView
43
43
  end
44
44
 
45
45
  def is_uri?(path)
46
- path =~ %r{^[-a-z]+://|^(?:cid|data):|^//}
46
+ path =~ %r{^[-a-z]+://|^(?:cid|data):|^//}i
47
47
  end
48
48
 
49
49
  private
@@ -112,7 +112,7 @@ module ActionView
112
112
  # english it would read better as about 80 years.
113
113
  minutes_with_offset = distance_in_minutes - minute_offset_for_leap_year
114
114
  remainder = (minutes_with_offset % 525600)
115
- distance_in_years = (minutes_with_offset / 525600)
115
+ distance_in_years = (minutes_with_offset.div 525600)
116
116
  if remainder < 131400
117
117
  locale.t(:about_x_years, :count => distance_in_years)
118
118
  elsif remainder < 394200
@@ -1196,27 +1196,26 @@ module ActionView
1196
1196
 
1197
1197
  def add_default_name_and_id(options)
1198
1198
  if options.has_key?("index")
1199
- options["name"] ||= tag_name_with_index(options["index"])
1199
+ options["name"] ||= tag_name_with_index(options["index"], options["multiple"])
1200
1200
  options["id"] = options.fetch("id"){ tag_id_with_index(options["index"]) }
1201
1201
  options.delete("index")
1202
1202
  elsif defined?(@auto_index)
1203
- options["name"] ||= tag_name_with_index(@auto_index)
1203
+ options["name"] ||= tag_name_with_index(@auto_index, options["multiple"])
1204
1204
  options["id"] = options.fetch("id"){ tag_id_with_index(@auto_index) }
1205
1205
  else
1206
- options["name"] ||= tag_name
1206
+ options["name"] ||= tag_name(options["multiple"])
1207
1207
  options["id"] = options.fetch("id"){ tag_id }
1208
1208
  end
1209
1209
 
1210
- options["name"] += "[]" if options["multiple"] && !options["name"].ends_with?("[]")
1211
1210
  options["id"] = [options.delete('namespace'), options["id"]].compact.join("_").presence
1212
1211
  end
1213
1212
 
1214
- def tag_name
1215
- "#{@object_name}[#{sanitized_method_name}]"
1213
+ def tag_name(multiple = false)
1214
+ "#{@object_name}[#{sanitized_method_name}]#{"[]" if multiple}"
1216
1215
  end
1217
1216
 
1218
- def tag_name_with_index(index)
1219
- "#{@object_name}[#{index}][#{sanitized_method_name}]"
1217
+ def tag_name_with_index(index, multiple = false)
1218
+ "#{@object_name}[#{index}][#{sanitized_method_name}]#{"[]" if multiple}"
1220
1219
  end
1221
1220
 
1222
1221
  def tag_id
@@ -360,7 +360,7 @@ module ActionView
360
360
 
361
361
  end
362
362
 
363
- STORAGE_UNITS = [:byte, :kb, :mb, :gb, :tb].freeze
363
+ STORAGE_UNITS = [:byte, :kb, :mb, :gb, :tb]
364
364
 
365
365
  # Formats the bytes in +number+ into a more understandable
366
366
  # representation (e.g., giving it 1500 yields 1.5 KB). This
@@ -452,7 +452,7 @@ module ActionView
452
452
  end
453
453
 
454
454
  DECIMAL_UNITS = {0 => :unit, 1 => :ten, 2 => :hundred, 3 => :thousand, 6 => :million, 9 => :billion, 12 => :trillion, 15 => :quadrillion,
455
- -1 => :deci, -2 => :centi, -3 => :mili, -6 => :micro, -9 => :nano, -12 => :pico, -15 => :femto}.freeze
455
+ -1 => :deci, -2 => :centi, -3 => :mili, -6 => :micro, -9 => :nano, -12 => :pico, -15 => :femto}
456
456
 
457
457
  # Pretty prints (formats and approximates) a number in a way it
458
458
  # is more readable by humans (eg.: 1200000000 becomes "1.2
@@ -593,7 +593,7 @@ module ActionView
593
593
 
594
594
  unit = case units
595
595
  when Hash
596
- units[DECIMAL_UNITS[display_exponent]]
596
+ units[DECIMAL_UNITS[display_exponent]] || ''
597
597
  when String, Symbol
598
598
  I18n.translate(:"#{units}.#{DECIMAL_UNITS[display_exponent]}", :locale => options[:locale], :count => number.to_i)
599
599
  else
@@ -422,7 +422,7 @@ module ActionView
422
422
  if block_given?
423
423
  block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
424
424
  else
425
- name
425
+ ERB::Util.html_escape(name)
426
426
  end
427
427
  else
428
428
  link_to(name, options, html_options)
@@ -44,7 +44,13 @@ module ActionView
44
44
  module Accessors #:nodoc:
45
45
  end
46
46
 
47
- register_detail(:locale) { [I18n.locale, I18n.default_locale].uniq }
47
+ register_detail(:locale) do
48
+ locales = [I18n.locale]
49
+ locales.concat(I18n.fallbacks[I18n.locale]) if I18n.respond_to? :fallbacks
50
+ locales << I18n.default_locale
51
+ locales.uniq!
52
+ locales
53
+ end
48
54
  register_detail(:formats) { Mime::SET.symbols }
49
55
  register_detail(:handlers){ Template::Handlers.extensions }
50
56
 
@@ -97,7 +103,7 @@ module ActionView
97
103
 
98
104
  # Helpers related to template lookup using the lookup context information.
99
105
  module ViewPaths
100
- attr_reader :view_paths
106
+ attr_reader :view_paths, :html_fallback_for_js
101
107
 
102
108
  # Whenever setting view paths, makes a copy so we can manipulate then in
103
109
  # instance objects as we wish.
@@ -194,7 +200,10 @@ module ActionView
194
200
  def formats=(values)
195
201
  if values
196
202
  values.concat(default_formats) if values.delete "*/*"
197
- values << :html if values == [:js]
203
+ if values == [:js]
204
+ values << :html
205
+ @html_fallback_for_js = true
206
+ end
198
207
  end
199
208
  super(values)
200
209
  end
@@ -37,5 +37,11 @@ module ActionView
37
37
  def instrument(name, options={})
38
38
  ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
39
39
  end
40
+
41
+ def prepend_formats(formats)
42
+ formats = Array(formats)
43
+ return if formats.empty? || @lookup_context.html_fallback_for_js
44
+ @lookup_context.formats = formats | @lookup_context.formats
45
+ end
40
46
  end
41
47
  end
@@ -281,6 +281,8 @@ module ActionView
281
281
  @block = block
282
282
  @details = extract_details(options)
283
283
 
284
+ prepend_formats(options[:formats])
285
+
284
286
  if String === partial
285
287
  @object = options[:object]
286
288
  @path = partial
@@ -10,9 +10,10 @@ module ActionView
10
10
  template = determine_template(options)
11
11
  context = @lookup_context
12
12
 
13
+ prepend_formats(template.formats)
14
+
13
15
  unless context.rendered_format
14
- context.formats = template.formats unless template.formats.empty?
15
- context.rendered_format = context.formats.first
16
+ context.rendered_format = template.formats.first || formats.last
16
17
  end
17
18
 
18
19
  render_template(template, options[:layout], options[:locals])
@@ -163,7 +163,7 @@ module Sprockets
163
163
  source
164
164
  elsif source_ext.blank?
165
165
  "#{source}.#{ext}"
166
- elsif exact_match_present?(source)
166
+ elsif File.exists?(source) || exact_match_present?(source)
167
167
  source
168
168
  else
169
169
  "#{source}.#{ext}"
metadata CHANGED
@@ -1,162 +1,197 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
- version: !ruby/object:Gem::Version
4
- version: 3.2.13
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3856246045
5
+ prerelease: 7
6
+ segments:
7
+ - 3
8
+ - 2
9
+ - 14
10
+ - rc
11
+ - 1
12
+ version: 3.2.14.rc1
5
13
  platform: ruby
6
- authors:
14
+ authors:
7
15
  - David Heinemeier Hansson
8
16
  autorequire:
9
17
  bindir: bin
10
18
  cert_chain: []
11
- date: 2013-03-18 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: 3.2.13
19
+
20
+ date: 2013-07-12 00:00:00 -03:00
21
+ default_executable:
22
+ dependencies:
23
+ - !ruby/object:Gem::Dependency
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - "="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3856246045
30
+ segments:
31
+ - 3
32
+ - 2
33
+ - 14
34
+ - rc
35
+ - 1
36
+ version: 3.2.14.rc1
20
37
  type: :runtime
38
+ name: activesupport
39
+ version_requirements: *id001
21
40
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 3.2.13
27
- - !ruby/object:Gem::Dependency
28
- name: activemodel
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '='
32
- - !ruby/object:Gem::Version
33
- version: 3.2.13
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - "="
46
+ - !ruby/object:Gem::Version
47
+ hash: 3856246045
48
+ segments:
49
+ - 3
50
+ - 2
51
+ - 14
52
+ - rc
53
+ - 1
54
+ version: 3.2.14.rc1
34
55
  type: :runtime
56
+ name: activemodel
57
+ version_requirements: *id002
35
58
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 3.2.13
41
- - !ruby/object:Gem::Dependency
42
- name: rack-cache
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
59
+ - !ruby/object:Gem::Dependency
60
+ requirement: &id003 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
45
63
  - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '1.2'
64
+ - !ruby/object:Gem::Version
65
+ hash: 11
66
+ segments:
67
+ - 1
68
+ - 2
69
+ version: "1.2"
48
70
  type: :runtime
71
+ name: rack-cache
72
+ version_requirements: *id003
49
73
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.2'
55
- - !ruby/object:Gem::Dependency
56
- name: builder
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
74
+ - !ruby/object:Gem::Dependency
75
+ requirement: &id004 !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
59
78
  - - ~>
60
- - !ruby/object:Gem::Version
79
+ - !ruby/object:Gem::Version
80
+ hash: 7
81
+ segments:
82
+ - 3
83
+ - 0
84
+ - 0
61
85
  version: 3.0.0
62
86
  type: :runtime
87
+ name: builder
88
+ version_requirements: *id004
63
89
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
90
+ - !ruby/object:Gem::Dependency
91
+ requirement: &id005 !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
66
94
  - - ~>
67
- - !ruby/object:Gem::Version
68
- version: 3.0.0
69
- - !ruby/object:Gem::Dependency
70
- name: rack
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
95
+ - !ruby/object:Gem::Version
96
+ hash: 13
97
+ segments:
98
+ - 1
99
+ - 4
100
+ - 5
75
101
  version: 1.4.5
76
102
  type: :runtime
103
+ name: rack
104
+ version_requirements: *id005
77
105
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
106
+ - !ruby/object:Gem::Dependency
107
+ requirement: &id006 !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
80
110
  - - ~>
81
- - !ruby/object:Gem::Version
82
- version: 1.4.5
83
- - !ruby/object:Gem::Dependency
84
- name: rack-test
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
111
+ - !ruby/object:Gem::Version
112
+ hash: 5
113
+ segments:
114
+ - 0
115
+ - 6
116
+ - 1
89
117
  version: 0.6.1
90
118
  type: :runtime
119
+ name: rack-test
120
+ version_requirements: *id006
91
121
  prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
122
+ - !ruby/object:Gem::Dependency
123
+ requirement: &id007 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
94
126
  - - ~>
95
- - !ruby/object:Gem::Version
96
- version: 0.6.1
97
- - !ruby/object:Gem::Dependency
98
- name: journey
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
127
+ - !ruby/object:Gem::Version
128
+ hash: 31
129
+ segments:
130
+ - 1
131
+ - 0
132
+ - 4
103
133
  version: 1.0.4
104
134
  type: :runtime
135
+ name: journey
136
+ version_requirements: *id007
105
137
  prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
138
+ - !ruby/object:Gem::Dependency
139
+ requirement: &id008 !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
108
142
  - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 1.0.4
111
- - !ruby/object:Gem::Dependency
112
- name: sprockets
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
143
+ - !ruby/object:Gem::Version
144
+ hash: 5
145
+ segments:
146
+ - 2
147
+ - 2
148
+ - 1
117
149
  version: 2.2.1
118
150
  type: :runtime
151
+ name: sprockets
152
+ version_requirements: *id008
119
153
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
154
+ - !ruby/object:Gem::Dependency
155
+ requirement: &id009 !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
122
158
  - - ~>
123
- - !ruby/object:Gem::Version
124
- version: 2.2.1
125
- - !ruby/object:Gem::Dependency
126
- name: erubis
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ~>
130
- - !ruby/object:Gem::Version
159
+ - !ruby/object:Gem::Version
160
+ hash: 19
161
+ segments:
162
+ - 2
163
+ - 7
164
+ - 0
131
165
  version: 2.7.0
132
166
  type: :runtime
167
+ name: erubis
168
+ version_requirements: *id009
133
169
  prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ~>
137
- - !ruby/object:Gem::Version
138
- version: 2.7.0
139
- - !ruby/object:Gem::Dependency
140
- name: tzinfo
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
170
+ - !ruby/object:Gem::Dependency
171
+ requirement: &id010 !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
143
174
  - - ~>
144
- - !ruby/object:Gem::Version
175
+ - !ruby/object:Gem::Version
176
+ hash: 41
177
+ segments:
178
+ - 0
179
+ - 3
180
+ - 29
145
181
  version: 0.3.29
146
182
  type: :development
183
+ name: tzinfo
184
+ version_requirements: *id010
147
185
  prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ~>
151
- - !ruby/object:Gem::Version
152
- version: 0.3.29
153
- description: Web apps on Rails. Simple, battle-tested conventions for building and
154
- testing MVC web applications. Works with any Rack-compatible server.
186
+ description: Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.
155
187
  email: david@loudthinking.com
156
188
  executables: []
189
+
157
190
  extensions: []
191
+
158
192
  extra_rdoc_files: []
159
- files:
193
+
194
+ files:
160
195
  - CHANGELOG.md
161
196
  - README.rdoc
162
197
  - MIT-LICENSE
@@ -215,6 +250,7 @@ files:
215
250
  - lib/action_controller/railties/paths.rb
216
251
  - lib/action_controller/record_identifier.rb
217
252
  - lib/action_controller/test_case.rb
253
+ - lib/action_controller/test_case.rb.orig
218
254
  - lib/action_controller/vendor/html-scanner/html/document.rb
219
255
  - lib/action_controller/vendor/html-scanner/html/node.rb
220
256
  - lib/action_controller/vendor/html-scanner/html/sanitizer.rb
@@ -280,6 +316,7 @@ files:
280
316
  - lib/action_dispatch/testing/assertions/tag.rb
281
317
  - lib/action_dispatch/testing/assertions.rb
282
318
  - lib/action_dispatch/testing/integration.rb
319
+ - lib/action_dispatch/testing/integration.rb.orig
283
320
  - lib/action_dispatch/testing/performance_test.rb
284
321
  - lib/action_dispatch/testing/test_process.rb
285
322
  - lib/action_dispatch/testing/test_request.rb
@@ -348,28 +385,43 @@ files:
348
385
  - lib/sprockets/helpers.rb
349
386
  - lib/sprockets/railtie.rb
350
387
  - lib/sprockets/static_compiler.rb
388
+ has_rdoc: true
351
389
  homepage: http://www.rubyonrails.org
352
- licenses: []
353
- metadata: {}
390
+ licenses:
391
+ - MIT
354
392
  post_install_message:
355
393
  rdoc_options: []
356
- require_paths:
394
+
395
+ require_paths:
357
396
  - lib
358
- required_ruby_version: !ruby/object:Gem::Requirement
359
- requirements:
360
- - - '>='
361
- - !ruby/object:Gem::Version
397
+ required_ruby_version: !ruby/object:Gem::Requirement
398
+ none: false
399
+ requirements:
400
+ - - ">="
401
+ - !ruby/object:Gem::Version
402
+ hash: 57
403
+ segments:
404
+ - 1
405
+ - 8
406
+ - 7
362
407
  version: 1.8.7
363
- required_rubygems_version: !ruby/object:Gem::Requirement
364
- requirements:
365
- - - '>='
366
- - !ruby/object:Gem::Version
367
- version: '0'
368
- requirements:
408
+ required_rubygems_version: !ruby/object:Gem::Requirement
409
+ none: false
410
+ requirements:
411
+ - - ">"
412
+ - !ruby/object:Gem::Version
413
+ hash: 25
414
+ segments:
415
+ - 1
416
+ - 3
417
+ - 1
418
+ version: 1.3.1
419
+ requirements:
369
420
  - none
370
421
  rubyforge_project:
371
- rubygems_version: 2.0.2
422
+ rubygems_version: 1.6.2
372
423
  signing_key:
373
- specification_version: 4
424
+ specification_version: 3
374
425
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
375
426
  test_files: []
427
+