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
  ru:
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: "%n %u"
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 @@ ru:
57
57
  gb: "Гб"
58
58
  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: "пол минуты"
@@ -1,52 +1,52 @@
1
1
  sv:
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: "kr"
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 @@ sv:
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: "en halv minut"
@@ -1,52 +1,52 @@
1
1
  tr:
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: 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: "%n%u"
18
18
  unit: "TL"
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 @@ tr:
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 saniye"
@@ -1,52 +1,52 @@
1
1
  uk:
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: 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: "%n %u"
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 @@ uk:
57
57
  gb: "Гб"
58
58
  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: "півхвилини"
@@ -1,52 +1,52 @@
1
1
  zh_cn:
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: 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: "RMB"
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 @@ zh_cn:
57
57
  gb: "G"
58
58
  tb: "T"
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: "半分钟"
@@ -1,52 +1,52 @@
1
1
  zh_tw:
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: 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: "NT$"
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 @@ zh_tw:
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: "半分鐘"