actionpack 3.2.6 → 3.2.7.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.
- data/CHANGELOG.md +16 -0
- data/lib/action_controller/caching.rb +3 -0
- data/lib/action_controller/metal/params_wrapper.rb +2 -1
- data/lib/action_dispatch/routing/mapper.rb +1 -1
- data/lib/action_pack/version.rb +2 -2
- data/lib/action_view/asset_paths.rb +7 -1
- data/lib/action_view/helpers/controller_helper.rb +4 -2
- data/lib/action_view/helpers/form_options_helper.rb +5 -5
- data/lib/action_view/helpers/number_helper.rb +159 -90
- metadata +26 -18
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## Rails 3.2.7 (unreleased) ##
|
2
|
+
|
3
|
+
* Bump Journey requirements to 1.0.4
|
4
|
+
|
5
|
+
* Add support for optional root segments containing slashes
|
6
|
+
|
7
|
+
* Fixed bug creating invalid HTML in select options
|
8
|
+
|
9
|
+
* Show in log correct wrapped keys
|
10
|
+
|
11
|
+
* Fix NumberHelper options wrapping to prevent verbatim blocks being rendered instead of line continuations.
|
12
|
+
|
13
|
+
* ActionController::Metal doesn't have logger method, check it and then delegate
|
14
|
+
|
15
|
+
* ActionController::Caching depends on RackDelegation and AbstractController::Callbacks
|
16
|
+
|
1
17
|
## Rails 3.2.6 (Jun 12, 2012) ##
|
2
18
|
|
3
19
|
* nil is removed from array parameter values
|
@@ -194,7 +194,8 @@ module ActionController
|
|
194
194
|
def process_action(*args)
|
195
195
|
if _wrapper_enabled?
|
196
196
|
wrapped_hash = _wrap_parameters request.request_parameters
|
197
|
-
|
197
|
+
wrapped_keys = request.request_parameters.keys
|
198
|
+
wrapped_filtered_hash = _wrap_parameters request.filtered_parameters.slice(*wrapped_keys)
|
198
199
|
|
199
200
|
# This will make the wrapped hash accessible from controller and view
|
200
201
|
request.parameters.merge! wrapped_hash
|
@@ -238,7 +238,7 @@ module ActionDispatch
|
|
238
238
|
# for root cases, where the latter is the correct one.
|
239
239
|
def self.normalize_path(path)
|
240
240
|
path = Journey::Router::Utils.normalize_path(path)
|
241
|
-
path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[
|
241
|
+
path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^)]+\)$}
|
242
242
|
path
|
243
243
|
end
|
244
244
|
|
data/lib/action_pack/version.rb
CHANGED
@@ -33,7 +33,13 @@ module ActionView
|
|
33
33
|
# Return the filesystem path for the source
|
34
34
|
def compute_source_path(source, dir, ext)
|
35
35
|
source = rewrite_extension(source, dir, ext) if ext
|
36
|
-
|
36
|
+
|
37
|
+
sources = []
|
38
|
+
sources << config.assets_dir
|
39
|
+
sources << dir unless source[0] == ?/
|
40
|
+
sources << source
|
41
|
+
|
42
|
+
File.join(sources)
|
37
43
|
end
|
38
44
|
|
39
45
|
def is_uri?(path)
|
@@ -10,14 +10,16 @@ module ActionView
|
|
10
10
|
delegate :request_forgery_protection_token, :params, :session, :cookies, :response, :headers,
|
11
11
|
:flash, :action_name, :controller_name, :controller_path, :to => :controller
|
12
12
|
|
13
|
-
delegate :logger, :to => :controller, :allow_nil => true
|
14
|
-
|
15
13
|
def assign_controller(controller)
|
16
14
|
if @_controller = controller
|
17
15
|
@_request = controller.request if controller.respond_to?(:request)
|
18
16
|
@_config = controller.config.inheritable_copy if controller.respond_to?(:config)
|
19
17
|
end
|
20
18
|
end
|
19
|
+
|
20
|
+
def logger
|
21
|
+
controller.logger if controller.respond_to?(:logger)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -134,7 +134,7 @@ module ActionView
|
|
134
134
|
#
|
135
135
|
# ==== Gotcha
|
136
136
|
#
|
137
|
-
# The HTML specification says when +multiple+ parameter passed to select and all options got deselected
|
137
|
+
# The HTML specification says when +multiple+ parameter passed to select and all options got deselected
|
138
138
|
# web browsers do not send any value to server. Unfortunately this introduces a gotcha:
|
139
139
|
# if an +User+ model has many +roles+ and have +role_ids+ accessor, and in the form that edits roles of the user
|
140
140
|
# the user deselects all roles from +role_ids+ multiple select box, no +role_ids+ parameter is sent. So,
|
@@ -336,7 +336,7 @@ module ActionView
|
|
336
336
|
|
337
337
|
end
|
338
338
|
|
339
|
-
# Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning
|
339
|
+
# Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning
|
340
340
|
# the result of a call to the +value_method+ as the option value and the +text_method+ as the option text.
|
341
341
|
# Example:
|
342
342
|
# options_from_collection_for_select(@people, 'id', 'name')
|
@@ -616,11 +616,11 @@ module ActionView
|
|
616
616
|
private
|
617
617
|
def add_options(option_tags, options, value = nil)
|
618
618
|
if options[:include_blank]
|
619
|
-
option_tags =
|
619
|
+
option_tags = content_tag_string('option', options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, :value => '') + "\n" + option_tags
|
620
620
|
end
|
621
621
|
if value.blank? && options[:prompt]
|
622
622
|
prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select')
|
623
|
-
option_tags =
|
623
|
+
option_tags = content_tag_string('option', prompt, :value => '') + "\n" + option_tags
|
624
624
|
end
|
625
625
|
option_tags
|
626
626
|
end
|
@@ -630,7 +630,7 @@ module ActionView
|
|
630
630
|
add_default_name_and_id(html_options)
|
631
631
|
select = content_tag("select", add_options(option_tags, options, value(object)), html_options)
|
632
632
|
if html_options["multiple"]
|
633
|
-
tag("input", :disabled => html_options["disabled"], :name => html_options["name"], :type => "hidden", :value => "") + select
|
633
|
+
tag("input", :disabled => html_options["disabled"], :name => html_options["name"], :type => "hidden", :value => "") + select
|
634
634
|
else
|
635
635
|
select
|
636
636
|
end
|
@@ -29,17 +29,20 @@ module ActionView
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
# Formats a +number+ into a US phone number (e.g., (555)
|
33
|
-
# in the +options+ hash.
|
32
|
+
# Formats a +number+ into a US phone number (e.g., (555)
|
33
|
+
# 123-9876). You can customize the format in the +options+ hash.
|
34
34
|
#
|
35
35
|
# ==== Options
|
36
36
|
#
|
37
|
-
# * <tt>:area_code</tt>
|
38
|
-
# * <tt>:delimiter</tt>
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
# * <tt>:
|
37
|
+
# * <tt>:area_code</tt> - Adds parentheses around the area code.
|
38
|
+
# * <tt>:delimiter</tt> - Specifies the delimiter to use
|
39
|
+
# (defaults to "-").
|
40
|
+
# * <tt>:extension</tt> - Specifies an extension to add to the
|
41
|
+
# end of the generated number.
|
42
|
+
# * <tt>:country_code</tt> - Sets the country code for the phone
|
43
|
+
# number.
|
44
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
45
|
+
# the argument is invalid.
|
43
46
|
#
|
44
47
|
# ==== Examples
|
45
48
|
#
|
@@ -86,24 +89,31 @@ module ActionView
|
|
86
89
|
ERB::Util.html_escape(str.join)
|
87
90
|
end
|
88
91
|
|
89
|
-
# Formats a +number+ into a currency string (e.g., $13.65). You
|
90
|
-
# in the +options+ hash.
|
92
|
+
# Formats a +number+ into a currency string (e.g., $13.65). You
|
93
|
+
# can customize the format in the +options+ hash.
|
91
94
|
#
|
92
95
|
# ==== Options
|
93
96
|
#
|
94
|
-
# * <tt>:locale</tt>
|
95
|
-
#
|
96
|
-
# * <tt>:
|
97
|
-
#
|
98
|
-
# * <tt>:
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
# * <tt>:
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
97
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
98
|
+
# (defaults to current locale).
|
99
|
+
# * <tt>:precision</tt> - Sets the level of precision (defaults
|
100
|
+
# to 2).
|
101
|
+
# * <tt>:unit</tt> - Sets the denomination of the currency
|
102
|
+
# (defaults to "$").
|
103
|
+
# * <tt>:separator</tt> - Sets the separator between the units
|
104
|
+
# (defaults to ".").
|
105
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
106
|
+
# to ",").
|
107
|
+
# * <tt>:format</tt> - Sets the format for non-negative numbers
|
108
|
+
# (defaults to "%u%n"). Fields are <tt>%u</tt> for the
|
109
|
+
# currency, and <tt>%n</tt> for the number.
|
110
|
+
# * <tt>:negative_format</tt> - Sets the format for negative
|
111
|
+
# numbers (defaults to prepending an hyphen to the formatted
|
112
|
+
# number given by <tt>:format</tt>). Accepts the same fields
|
113
|
+
# than <tt>:format</tt>, except <tt>%n</tt> is here the
|
114
|
+
# absolute value of the number.
|
115
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
116
|
+
# the argument is invalid.
|
107
117
|
#
|
108
118
|
# ==== Examples
|
109
119
|
#
|
@@ -156,21 +166,27 @@ module ActionView
|
|
156
166
|
|
157
167
|
end
|
158
168
|
|
159
|
-
# Formats a +number+ as a percentage string (e.g., 65%). You can
|
169
|
+
# Formats a +number+ as a percentage string (e.g., 65%). You can
|
170
|
+
# customize the format in the +options+ hash.
|
160
171
|
#
|
161
172
|
# ==== Options
|
162
173
|
#
|
163
|
-
# * <tt>:locale</tt>
|
164
|
-
#
|
165
|
-
# * <tt>:precision</tt>
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# * <tt>:
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
175
|
+
# (defaults to current locale).
|
176
|
+
# * <tt>:precision</tt> - Sets the precision of the number
|
177
|
+
# (defaults to 3).
|
178
|
+
# * <tt>:significant</tt> - If +true+, precision will be the #
|
179
|
+
# of significant_digits. If +false+, the # of fractional
|
180
|
+
# digits (defaults to +false+).
|
181
|
+
# * <tt>:separator</tt> - Sets the separator between the
|
182
|
+
# fractional and integer digits (defaults to ".").
|
183
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
184
|
+
# to "").
|
185
|
+
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
186
|
+
# insignificant zeros after the decimal separator (defaults to
|
187
|
+
# +false+).
|
188
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
189
|
+
# the argument is invalid.
|
174
190
|
#
|
175
191
|
# ==== Examples
|
176
192
|
#
|
@@ -205,15 +221,20 @@ module ActionView
|
|
205
221
|
end
|
206
222
|
end
|
207
223
|
|
208
|
-
# Formats a +number+ with grouped thousands using +delimiter+
|
209
|
-
# customize the format in the +options+
|
224
|
+
# Formats a +number+ with grouped thousands using +delimiter+
|
225
|
+
# (e.g., 12,324). You can customize the format in the +options+
|
226
|
+
# hash.
|
210
227
|
#
|
211
228
|
# ==== Options
|
212
229
|
#
|
213
|
-
# * <tt>:locale</tt>
|
214
|
-
#
|
215
|
-
# * <tt>:
|
216
|
-
#
|
230
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
231
|
+
# (defaults to current locale).
|
232
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
233
|
+
# to ",").
|
234
|
+
# * <tt>:separator</tt> - Sets the separator between the
|
235
|
+
# fractional and integer digits (defaults to ".").
|
236
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
237
|
+
# the argument is invalid.
|
217
238
|
#
|
218
239
|
# ==== Examples
|
219
240
|
#
|
@@ -251,23 +272,32 @@ module ActionView
|
|
251
272
|
|
252
273
|
end
|
253
274
|
|
254
|
-
# Formats a +number+ with the specified level of
|
255
|
-
#
|
275
|
+
# Formats a +number+ with the specified level of
|
276
|
+
# <tt>:precision</tt> (e.g., 112.32 has a precision of 2 if
|
277
|
+
# +:significant+ is +false+, and 5 if +:significant+ is +true+).
|
256
278
|
# You can customize the format in the +options+ hash.
|
257
279
|
#
|
258
280
|
# ==== Options
|
259
|
-
#
|
260
|
-
# * <tt>:
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
281
|
+
#
|
282
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
283
|
+
# (defaults to current locale).
|
284
|
+
# * <tt>:precision</tt> - Sets the precision of the number
|
285
|
+
# (defaults to 3).
|
286
|
+
# * <tt>:significant</tt> - If +true+, precision will be the #
|
287
|
+
# of significant_digits. If +false+, the # of fractional
|
288
|
+
# digits (defaults to +false+).
|
289
|
+
# * <tt>:separator</tt> - Sets the separator between the
|
290
|
+
# fractional and integer digits (defaults to ".").
|
291
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
292
|
+
# to "").
|
293
|
+
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
294
|
+
# insignificant zeros after the decimal separator (defaults to
|
295
|
+
# +false+).
|
296
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
297
|
+
# the argument is invalid.
|
269
298
|
#
|
270
299
|
# ==== Examples
|
300
|
+
#
|
271
301
|
# number_with_precision(111.2345) # => 111.235
|
272
302
|
# number_with_precision(111.2345, :precision => 2) # => 111.23
|
273
303
|
# number_with_precision(13, :precision => 5) # => 13.00000
|
@@ -330,23 +360,37 @@ module ActionView
|
|
330
360
|
|
331
361
|
STORAGE_UNITS = [:byte, :kb, :mb, :gb, :tb].freeze
|
332
362
|
|
333
|
-
# Formats the bytes in +number+ into a more understandable
|
334
|
-
# (e.g., giving it 1500 yields 1.5 KB). This
|
335
|
-
# reporting file sizes to users. You can
|
336
|
-
# format in the +options+ hash.
|
363
|
+
# Formats the bytes in +number+ into a more understandable
|
364
|
+
# representation (e.g., giving it 1500 yields 1.5 KB). This
|
365
|
+
# method is useful for reporting file sizes to users. You can
|
366
|
+
# customize the format in the +options+ hash.
|
337
367
|
#
|
338
|
-
# See <tt>number_to_human</tt> if you want to pretty-print a
|
368
|
+
# See <tt>number_to_human</tt> if you want to pretty-print a
|
369
|
+
# generic number.
|
339
370
|
#
|
340
371
|
# ==== Options
|
341
|
-
#
|
342
|
-
# * <tt>:
|
343
|
-
#
|
344
|
-
# * <tt>:
|
345
|
-
#
|
346
|
-
# * <tt>:
|
347
|
-
#
|
348
|
-
#
|
372
|
+
#
|
373
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
374
|
+
# (defaults to current locale).
|
375
|
+
# * <tt>:precision</tt> - Sets the precision of the number
|
376
|
+
# (defaults to 3).
|
377
|
+
# * <tt>:significant</tt> - If +true+, precision will be the #
|
378
|
+
# of significant_digits. If +false+, the # of fractional
|
379
|
+
# digits (defaults to +true+)
|
380
|
+
# * <tt>:separator</tt> - Sets the separator between the
|
381
|
+
# fractional and integer digits (defaults to ".").
|
382
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
383
|
+
# to "").
|
384
|
+
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
385
|
+
# insignificant zeros after the decimal separator (defaults to
|
386
|
+
# +true+)
|
387
|
+
# * <tt>:prefix</tt> - If +:si+ formats the number using the SI
|
388
|
+
# prefix (defaults to :binary)
|
389
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
390
|
+
# the argument is invalid.
|
391
|
+
#
|
349
392
|
# ==== Examples
|
393
|
+
#
|
350
394
|
# number_to_human_size(123) # => 123 Bytes
|
351
395
|
# number_to_human_size(1234) # => 1.21 KB
|
352
396
|
# number_to_human_size(12345) # => 12.1 KB
|
@@ -357,8 +401,10 @@ module ActionView
|
|
357
401
|
# number_to_human_size(483989, :precision => 2) # => 470 KB
|
358
402
|
# number_to_human_size(1234567, :precision => 2, :separator => ',') # => 1,2 MB
|
359
403
|
#
|
360
|
-
# Non-significant zeros after the fractional separator are
|
361
|
-
#
|
404
|
+
# Non-significant zeros after the fractional separator are
|
405
|
+
# stripped out by default (set
|
406
|
+
# <tt>:strip_insignificant_zeros</tt> to +false+ to change
|
407
|
+
# that):
|
362
408
|
# number_to_human_size(1234567890123, :precision => 5) # => "1.1229 TB"
|
363
409
|
# number_to_human_size(524288000, :precision => 5) # => "500 MB"
|
364
410
|
def number_to_human_size(number, options = {})
|
@@ -406,33 +452,55 @@ module ActionView
|
|
406
452
|
DECIMAL_UNITS = {0 => :unit, 1 => :ten, 2 => :hundred, 3 => :thousand, 6 => :million, 9 => :billion, 12 => :trillion, 15 => :quadrillion,
|
407
453
|
-1 => :deci, -2 => :centi, -3 => :mili, -6 => :micro, -9 => :nano, -12 => :pico, -15 => :femto}.freeze
|
408
454
|
|
409
|
-
# Pretty prints (formats and approximates) a number in a way it
|
410
|
-
# (eg.: 1200000000 becomes "1.2
|
411
|
-
#
|
455
|
+
# Pretty prints (formats and approximates) a number in a way it
|
456
|
+
# is more readable by humans (eg.: 1200000000 becomes "1.2
|
457
|
+
# Billion"). This is useful for numbers that can get very large
|
458
|
+
# (and too hard to read).
|
412
459
|
#
|
413
|
-
# See <tt>number_to_human_size</tt> if you want to print a file
|
460
|
+
# See <tt>number_to_human_size</tt> if you want to print a file
|
461
|
+
# size.
|
414
462
|
#
|
415
|
-
# You can also define you own unit-quantifier names if you want
|
416
|
-
# (eg.: 1500 becomes "1.5
|
417
|
-
#
|
463
|
+
# You can also define you own unit-quantifier names if you want
|
464
|
+
# to use other decimal units (eg.: 1500 becomes "1.5
|
465
|
+
# kilometers", 0.150 becomes "150 milliliters", etc). You may
|
466
|
+
# define a wide range of unit quantifiers, even fractional ones
|
467
|
+
# (centi, deci, mili, etc).
|
418
468
|
#
|
419
469
|
# ==== Options
|
420
|
-
# * <tt>:locale</tt> - Sets the locale to be used for formatting (defaults to current locale).
|
421
|
-
# * <tt>:precision</tt> - Sets the precision of the number (defaults to 3).
|
422
|
-
# * <tt>:significant</tt> - If +true+, precision will be the # of significant_digits. If +false+, the # of fractional digits (defaults to +true+)
|
423
|
-
# * <tt>:separator</tt> - Sets the separator between the fractional and integer digits (defaults to ".").
|
424
|
-
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults to "").
|
425
|
-
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes insignificant zeros after the decimal separator (defaults to +true+)
|
426
|
-
# * <tt>:units</tt> - A Hash of unit quantifier names. Or a string containing an i18n scope where to find this hash. It might have the following keys:
|
427
|
-
# * *integers*: <tt>:unit</tt>, <tt>:ten</tt>, <tt>:hundred</tt>, <tt>:thousand</tt>, <tt>:million</tt>, <tt>:billion</tt>, <tt>:trillion</tt>, <tt>:quadrillion</tt>
|
428
|
-
# * *fractionals*: <tt>:deci</tt>, <tt>:centi</tt>, <tt>:mili</tt>, <tt>:micro</tt>, <tt>:nano</tt>, <tt>:pico</tt>, <tt>:femto</tt>
|
429
|
-
# * <tt>:format</tt> - Sets the format of the output string (defaults to "%n %u"). The field types are:
|
430
|
-
# %u The quantifier (ex.: 'thousand')
|
431
|
-
# %n The number
|
432
|
-
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when the argument is invalid.
|
433
470
|
#
|
471
|
+
# * <tt>:locale</tt> - Sets the locale to be used for formatting
|
472
|
+
# (defaults to current locale).
|
473
|
+
# * <tt>:precision</tt> - Sets the precision of the number
|
474
|
+
# (defaults to 3).
|
475
|
+
# * <tt>:significant</tt> - If +true+, precision will be the #
|
476
|
+
# of significant_digits. If +false+, the # of fractional
|
477
|
+
# digits (defaults to +true+)
|
478
|
+
# * <tt>:separator</tt> - Sets the separator between the
|
479
|
+
# fractional and integer digits (defaults to ".").
|
480
|
+
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
|
481
|
+
# to "").
|
482
|
+
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
483
|
+
# insignificant zeros after the decimal separator (defaults to
|
484
|
+
# +true+)
|
485
|
+
# * <tt>:units</tt> - A Hash of unit quantifier names. Or a
|
486
|
+
# string containing an i18n scope where to find this hash. It
|
487
|
+
# might have the following keys:
|
488
|
+
# * *integers*: <tt>:unit</tt>, <tt>:ten</tt>,
|
489
|
+
# *<tt>:hundred</tt>, <tt>:thousand</tt>, <tt>:million</tt>,
|
490
|
+
# *<tt>:billion</tt>, <tt>:trillion</tt>,
|
491
|
+
# *<tt>:quadrillion</tt>
|
492
|
+
# * *fractionals*: <tt>:deci</tt>, <tt>:centi</tt>,
|
493
|
+
# *<tt>:mili</tt>, <tt>:micro</tt>, <tt>:nano</tt>,
|
494
|
+
# *<tt>:pico</tt>, <tt>:femto</tt>
|
495
|
+
# * <tt>:format</tt> - Sets the format of the output string
|
496
|
+
# (defaults to "%n %u"). The field types are:
|
497
|
+
# * %u - The quantifier (ex.: 'thousand')
|
498
|
+
# * %n - The number
|
499
|
+
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
500
|
+
# the argument is invalid.
|
434
501
|
#
|
435
502
|
# ==== Examples
|
503
|
+
#
|
436
504
|
# number_to_human(123) # => "123"
|
437
505
|
# number_to_human(1234) # => "1.23 Thousand"
|
438
506
|
# number_to_human(12345) # => "12.3 Thousand"
|
@@ -449,8 +517,9 @@ module ActionView
|
|
449
517
|
# :separator => ',',
|
450
518
|
# :significant => false) # => "1,2 Million"
|
451
519
|
#
|
452
|
-
#
|
453
|
-
# <tt>:strip_insignificant_zeros</tt> to
|
520
|
+
# Non-significant zeros after the decimal separator are stripped
|
521
|
+
# out by default (set <tt>:strip_insignificant_zeros</tt> to
|
522
|
+
# +false+ to change that):
|
454
523
|
# number_to_human(12345012345, :significant_digits => 6) # => "12.345 Billion"
|
455
524
|
# number_to_human(500000000, :precision => 5) # => "500 Million"
|
456
525
|
#
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 2249827423
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
|
9
|
+
- 7
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.2.7.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Heinemeier Hansson
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-
|
20
|
+
date: 2012-07-23 00:00:00 Z
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: activesupport
|
@@ -25,12 +27,14 @@ dependencies:
|
|
25
27
|
requirements:
|
26
28
|
- - "="
|
27
29
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
30
|
+
hash: 2249827423
|
29
31
|
segments:
|
30
32
|
- 3
|
31
33
|
- 2
|
32
|
-
-
|
33
|
-
|
34
|
+
- 7
|
35
|
+
- rc
|
36
|
+
- 1
|
37
|
+
version: 3.2.7.rc1
|
34
38
|
type: :runtime
|
35
39
|
version_requirements: *id001
|
36
40
|
- !ruby/object:Gem::Dependency
|
@@ -41,12 +45,14 @@ dependencies:
|
|
41
45
|
requirements:
|
42
46
|
- - "="
|
43
47
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
48
|
+
hash: 2249827423
|
45
49
|
segments:
|
46
50
|
- 3
|
47
51
|
- 2
|
48
|
-
-
|
49
|
-
|
52
|
+
- 7
|
53
|
+
- rc
|
54
|
+
- 1
|
55
|
+
version: 3.2.7.rc1
|
50
56
|
type: :runtime
|
51
57
|
version_requirements: *id002
|
52
58
|
- !ruby/object:Gem::Dependency
|
@@ -120,12 +126,12 @@ dependencies:
|
|
120
126
|
requirements:
|
121
127
|
- - ~>
|
122
128
|
- !ruby/object:Gem::Version
|
123
|
-
hash:
|
129
|
+
hash: 31
|
124
130
|
segments:
|
125
131
|
- 1
|
126
132
|
- 0
|
127
|
-
-
|
128
|
-
version: 1.0.
|
133
|
+
- 4
|
134
|
+
version: 1.0.4
|
129
135
|
type: :runtime
|
130
136
|
version_requirements: *id007
|
131
137
|
- !ruby/object:Gem::Dependency
|
@@ -398,12 +404,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
398
404
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
399
405
|
none: false
|
400
406
|
requirements:
|
401
|
-
- - "
|
407
|
+
- - ">"
|
402
408
|
- !ruby/object:Gem::Version
|
403
|
-
hash:
|
409
|
+
hash: 25
|
404
410
|
segments:
|
405
|
-
-
|
406
|
-
|
411
|
+
- 1
|
412
|
+
- 3
|
413
|
+
- 1
|
414
|
+
version: 1.3.1
|
407
415
|
requirements:
|
408
416
|
- none
|
409
417
|
rubyforge_project:
|