padrino-helpers 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +1 -1
  3. data/lib/padrino-helpers.rb +3 -5
  4. data/lib/padrino-helpers/asset_tag_helpers.rb +32 -40
  5. data/lib/padrino-helpers/breadcrumb_helpers.rb +21 -39
  6. data/lib/padrino-helpers/form_builder/abstract_form_builder.rb +121 -118
  7. data/lib/padrino-helpers/form_builder/standard_form_builder.rb +6 -9
  8. data/lib/padrino-helpers/form_helpers.rb +190 -193
  9. data/lib/padrino-helpers/format_helpers.rb +29 -42
  10. data/lib/padrino-helpers/locale/cs.yml +14 -14
  11. data/lib/padrino-helpers/locale/da.yml +1 -1
  12. data/lib/padrino-helpers/locale/de.yml +1 -1
  13. data/lib/padrino-helpers/locale/en.yml +16 -16
  14. data/lib/padrino-helpers/locale/es.yml +16 -16
  15. data/lib/padrino-helpers/locale/fr.yml +1 -2
  16. data/lib/padrino-helpers/locale/hu.yml +16 -16
  17. data/lib/padrino-helpers/locale/it.yml +2 -2
  18. data/lib/padrino-helpers/locale/ja.yml +16 -16
  19. data/lib/padrino-helpers/locale/lv.yml +16 -16
  20. data/lib/padrino-helpers/locale/nl.yml +1 -1
  21. data/lib/padrino-helpers/locale/no.yml +1 -1
  22. data/lib/padrino-helpers/locale/pl.yml +7 -7
  23. data/lib/padrino-helpers/locale/pt_br.yml +16 -16
  24. data/lib/padrino-helpers/locale/ro.yml +16 -16
  25. data/lib/padrino-helpers/locale/ru.yml +16 -16
  26. data/lib/padrino-helpers/locale/sv.yml +16 -16
  27. data/lib/padrino-helpers/locale/tr.yml +16 -16
  28. data/lib/padrino-helpers/locale/uk.yml +16 -16
  29. data/lib/padrino-helpers/locale/zh_cn.yml +16 -16
  30. data/lib/padrino-helpers/locale/zh_tw.yml +16 -16
  31. data/lib/padrino-helpers/number_helpers.rb +10 -15
  32. data/lib/padrino-helpers/output_helpers.rb +49 -57
  33. data/lib/padrino-helpers/output_helpers/abstract_handler.rb +16 -18
  34. data/lib/padrino-helpers/output_helpers/erb_handler.rb +11 -12
  35. data/lib/padrino-helpers/output_helpers/haml_handler.rb +9 -9
  36. data/lib/padrino-helpers/output_helpers/slim_handler.rb +11 -13
  37. data/lib/padrino-helpers/render_helpers.rb +5 -6
  38. data/lib/padrino-helpers/tag_helpers.rb +18 -21
  39. data/lib/padrino-helpers/translation_helpers.rb +4 -6
  40. data/test/fixtures/markup_app/app.rb +7 -3
  41. data/test/fixtures/render_app/app.rb +1 -0
  42. data/test/test_asset_tag_helpers.rb +1 -1
  43. data/test/test_form_builder.rb +5 -6
  44. data/test/test_form_helpers.rb +24 -12
  45. data/test/test_format_helpers.rb +3 -3
  46. data/test/test_number_helpers.rb +4 -0
  47. data/test/test_output_helpers.rb +1 -1
  48. data/test/test_render_helpers.rb +1 -1
  49. data/test/test_tag_helpers.rb +1 -1
  50. metadata +9 -15
@@ -1,52 +1,52 @@
1
1
  hu:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
6
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
7
  separator: ","
8
- # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
8
+ # Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
9
  delimiter: "."
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
10
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
11
  precision: 2
12
12
 
13
- # Used in number_to_currency()
13
+ # Used in number_to_currency().
14
14
  currency:
15
15
  format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
16
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
17
  format: "%n %u"
18
18
  unit: "Ft"
19
- # These three are to override number.format and are optional
19
+ # These three are to override number.format and are optional.
20
20
  separator: ","
21
21
  delimiter: "."
22
22
  precision: 2
23
23
 
24
- # Used in number_to_percentage()
24
+ # Used in number_to_percentage().
25
25
  percentage:
26
26
  format:
27
- # These three are to override number.format and are optional
27
+ # These three are to override number.format and are optional.
28
28
  # separator:
29
29
  delimiter: ""
30
30
  # precision:
31
31
 
32
- # Used in number_to_precision()
32
+ # Used in number_to_precision().
33
33
  precision:
34
34
  format:
35
- # These three are to override number.format and are optional
35
+ # These three are to override number.format and are optional.
36
36
  # separator:
37
37
  delimiter: ""
38
38
  # precision:
39
39
 
40
- # Used in number_to_human_size()
40
+ # Used in number_to_human_size().
41
41
  human:
42
42
  format:
43
- # These three are to override number.format and are optional
43
+ # These three are to override number.format and are optional.
44
44
  # separator:
45
45
  delimiter: ""
46
46
  precision: 1
47
47
  storage_units:
48
48
  # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
49
+ # %u is the storage unit, %n is the number (default: 2 MB).
50
50
  format: "%n %u"
51
51
  units:
52
52
  byte:
@@ -57,7 +57,7 @@ hu:
57
57
  gb: "GB"
58
58
  tb: "TB"
59
59
 
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
60
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
61
  datetime:
62
62
  distance_in_words:
63
63
  half_a_minute: "fél perc"
@@ -26,13 +26,13 @@ it:
26
26
 
27
27
  human:
28
28
  format:
29
- # These three are to override number.format and are optional
29
+ # These three are to override number.format and are optional.
30
30
  # separator:
31
31
  delimiter: ""
32
32
  precision: 1
33
33
  storage_units:
34
34
  # Storage units output formatting.
35
- # %u is the storage unit, %n is the number (default: 2 MB)
35
+ # %u is the storage unit, %n is the number (default: 2 MB).
36
36
  format: "%n %u"
37
37
  units:
38
38
  byte:
@@ -1,52 +1,52 @@
1
1
  ja:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
6
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
7
  separator: "."
8
- # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
8
+ # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
9
  delimiter: ","
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
10
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
11
  precision: 2
12
12
 
13
- # Used in number_to_currency()
13
+ # Used in number_to_currency().
14
14
  currency:
15
15
  format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
16
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
17
  format: "%u%n"
18
18
  unit: "¥"
19
- # These three are to override number.format and are optional
19
+ # These three are to override number.format and are optional.
20
20
  separator: "."
21
21
  delimiter: ","
22
22
  precision: 2
23
23
 
24
- # Used in number_to_percentage()
24
+ # Used in number_to_percentage().
25
25
  percentage:
26
26
  format:
27
- # These three are to override number.format and are optional
27
+ # These three are to override number.format and are optional.
28
28
  # separator:
29
29
  delimiter: ""
30
30
  # precision:
31
31
 
32
- # Used in number_to_precision()
32
+ # Used in number_to_precision().
33
33
  precision:
34
34
  format:
35
- # These three are to override number.format and are optional
35
+ # These three are to override number.format and are optional.
36
36
  # separator:
37
37
  delimiter: ""
38
38
  # precision:
39
39
 
40
- # Used in number_to_human_size()
40
+ # Used in number_to_human_size().
41
41
  human:
42
42
  format:
43
- # These three are to override number.format and are optional
43
+ # These three are to override number.format and are optional.
44
44
  # separator:
45
45
  delimiter: ""
46
46
  precision: 1
47
47
  storage_units:
48
48
  # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
49
+ # %u is the storage unit, %n is the number (default: 2 MB).
50
50
  format: "%n %u"
51
51
  units:
52
52
  byte:
@@ -57,7 +57,7 @@ ja:
57
57
  gb: "GB"
58
58
  tb: "TB"
59
59
 
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
60
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
61
  datetime:
62
62
  distance_in_words:
63
63
  half_a_minute: "30秒"
@@ -1,52 +1,52 @@
1
1
  lv:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
6
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
7
  separator: ","
8
- # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
8
+ # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
9
  delimiter: "."
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
10
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
11
  precision: 2
12
12
 
13
- # Used in number_to_currency()
13
+ # Used in number_to_currency().
14
14
  currency:
15
15
  format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
16
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
17
  format: "%u %n"
18
18
  unit: "LVL"
19
- # These three are to override number.format and are optional
19
+ # These three are to override number.format and are optional.
20
20
  separator: ","
21
21
  delimiter: "."
22
22
  precision: 2
23
23
 
24
- # Used in number_to_percentage()
24
+ # Used in number_to_percentage().
25
25
  percentage:
26
26
  format:
27
- # These three are to override number.format and are optional
27
+ # These three are to override number.format and are optional.
28
28
  # separator:
29
29
  delimiter: ""
30
30
  # precision:
31
31
 
32
- # Used in number_to_precision()
32
+ # Used in number_to_precision().
33
33
  precision:
34
34
  format:
35
- # These three are to override number.format and are optional
35
+ # These three are to override number.format and are optional.
36
36
  # separator:
37
37
  delimiter: ""
38
38
  # precision:
39
39
 
40
- # Used in number_to_human_size()
40
+ # Used in number_to_human_size().
41
41
  human:
42
42
  format:
43
- # These three are to override number.format and are optional
43
+ # These three are to override number.format and are optional.
44
44
  # separator:
45
45
  delimiter: ""
46
46
  precision: 1
47
47
  storage_units:
48
48
  # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
49
+ # %u is the storage unit, %n is the number (default: 2 MB).
50
50
  format: "%n %u"
51
51
  units:
52
52
  byte:
@@ -57,7 +57,7 @@ lv:
57
57
  gb: "GB"
58
58
  tb: "TB"
59
59
 
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
60
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
61
  datetime:
62
62
  distance_in_words:
63
63
  half_a_minute: "pusminūte"
@@ -23,7 +23,7 @@ nl:
23
23
  precision: 1
24
24
  storage_units:
25
25
  # Storage units output formatting.
26
- # %u is the storage unit, %n is the number (default: 2 MB)
26
+ # %u is the storage unit, %n is the number (default: 2 MB).
27
27
  format: "%n %u"
28
28
  units:
29
29
  byte:
@@ -23,7 +23,7 @@
23
23
  precision: 1
24
24
  storage_units:
25
25
  # Storage units output formatting.
26
- # %u is the storage unit, %n is the number (default: 2 MB)
26
+ # %u is the storage unit, %n is the number (default: 2 MB).
27
27
  format: "%n %u"
28
28
  units:
29
29
  byte:
@@ -1,13 +1,13 @@
1
1
  pl:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
6
  separator: ","
7
7
  delimiter: " "
8
8
  precision: 2
9
9
 
10
- # Used in number_to_currency()
10
+ # Used in number_to_currency().
11
11
  currency:
12
12
  format:
13
13
  format: "%n %u"
@@ -16,17 +16,17 @@ pl:
16
16
  delimiter: " "
17
17
  precision: 2
18
18
 
19
- # Used in number_to_percentage()
19
+ # Used in number_to_percentage().
20
20
  percentage:
21
21
  format:
22
22
  delimiter: ""
23
23
 
24
- # Used in number_to_precision()
24
+ # Used in number_to_precision().
25
25
  precision:
26
26
  format:
27
27
  delimiter: ""
28
28
 
29
- # Used in number_to_human_size()
29
+ # Used in number_to_human_size().
30
30
  human:
31
31
  format:
32
32
  delimiter: ""
@@ -42,7 +42,7 @@ pl:
42
42
  gb: "GB"
43
43
  tb: "TB"
44
44
 
45
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
45
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
46
46
  datetime:
47
47
  distance_in_words:
48
48
  half_a_minute: "pół minuty"
@@ -1,52 +1,52 @@
1
1
  pt_br:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
6
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
7
  separator: ","
8
- # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
8
+ # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
9
  delimiter: "."
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
10
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
11
  precision: 3
12
12
 
13
- # Used in number_to_currency()
13
+ # Used in number_to_currency().
14
14
  currency:
15
15
  format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
16
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
17
  format: "%u%n"
18
18
  unit: "R$"
19
- # These three are to override number.format and are optional
19
+ # These three are to override number.format and are optional.
20
20
  separator: ","
21
21
  delimiter: "."
22
22
  precision: 2
23
23
 
24
- # Used in number_to_percentage()
24
+ # Used in number_to_percentage().
25
25
  percentage:
26
26
  format:
27
- # These three are to override number.format and are optional
27
+ # These three are to override number.format and are optional.
28
28
  # separator:
29
29
  delimiter: ""
30
30
  # precision:
31
31
 
32
- # Used in number_to_precision()
32
+ # Used in number_to_precision().
33
33
  precision:
34
34
  format:
35
- # These three are to override number.format and are optional
35
+ # These three are to override number.format and are optional.
36
36
  # separator:
37
37
  delimiter: ""
38
38
  # precision:
39
39
 
40
- # Used in number_to_human_size()
40
+ # Used in number_to_human_size().
41
41
  human:
42
42
  format:
43
- # These three are to override number.format and are optional
43
+ # These three are to override number.format and are optional.
44
44
  # separator:
45
45
  delimiter: ""
46
46
  precision: 1
47
47
  storage_units:
48
48
  # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
49
+ # %u is the storage unit, %n is the number (default: 2 MB).
50
50
  format: "%n %u"
51
51
  units:
52
52
  byte:
@@ -57,7 +57,7 @@ pt_br:
57
57
  gb: "GB"
58
58
  tb: "TB"
59
59
 
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
60
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
61
  datetime:
62
62
  distance_in_words:
63
63
  half_a_minute: "meio minuto"
@@ -1,52 +1,52 @@
1
1
  ro:
2
2
  number:
3
- # Used in number_with_delimiter()
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
3
+ # Used in number_with_delimiter().
4
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
5
  format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
6
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
7
  separator: ","
8
- # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
8
+ # Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
9
  delimiter: "."
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
10
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
11
  precision: 2
12
12
 
13
- # Used in number_to_currency()
13
+ # Used in number_to_currency().
14
14
  currency:
15
15
  format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
16
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
17
  format: "%n %u"
18
18
  unit: "lei"
19
- # These three are to override number.format and are optional
19
+ # These three are to override number.format and are optional.
20
20
  separator: ","
21
21
  delimiter: "."
22
22
  precision: 2
23
23
 
24
- # Used in number_to_percentage()
24
+ # Used in number_to_percentage().
25
25
  percentage:
26
26
  format:
27
- # These three are to override number.format and are optional
27
+ # These three are to override number.format and are optional.
28
28
  # separator:
29
29
  delimiter: ""
30
30
  # precision:
31
31
 
32
- # Used in number_to_precision()
32
+ # Used in number_to_precision().
33
33
  precision:
34
34
  format:
35
- # These three are to override number.format and are optional
35
+ # These three are to override number.format and are optional.
36
36
  # separator:
37
37
  delimiter: ""
38
38
  # precision:
39
39
 
40
- # Used in number_to_human_size()
40
+ # Used in number_to_human_size().
41
41
  human:
42
42
  format:
43
- # These three are to override number.format and are optional
43
+ # These three are to override number.format and are optional.
44
44
  # separator:
45
45
  delimiter: ""
46
46
  precision: 1
47
47
  storage_units:
48
48
  # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
49
+ # %u is the storage unit, %n is the number (default: 2 MB).
50
50
  format: "%n %u"
51
51
  units:
52
52
  byte:
@@ -57,7 +57,7 @@ ro:
57
57
  gb: "GB"
58
58
  tb: "TB"
59
59
 
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
60
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
61
  datetime:
62
62
  distance_in_words:
63
63
  half_a_minute: "jumătate de minut"