rails-timeago 2.16.0 → 2.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +53 -0
  3. data/.travis.yml +20 -8
  4. data/CHANGELOG.md +8 -0
  5. data/Gemfile +3 -5
  6. data/Rakefile +14 -12
  7. data/lib/assets/javascripts/rails-timeago-all.js +4 -0
  8. data/lib/rails-timeago.rb +21 -17
  9. data/lib/rails-timeago/helper.rb +13 -10
  10. data/lib/rails-timeago/version.rb +4 -2
  11. data/rails-timeago.gemspec +13 -11
  12. data/spec/rails-timeago_spec.rb +2 -0
  13. data/spec/spec_helper.rb +2 -0
  14. data/spec/support/stub.rb +11 -9
  15. data/spec/timeago/helper_spec.rb +27 -25
  16. data/vendor/assets/javascripts/jquery.timeago.js +1 -1
  17. data/vendor/assets/javascripts/locales/jquery.timeago.af.js +30 -20
  18. data/vendor/assets/javascripts/locales/jquery.timeago.am.js +30 -0
  19. data/vendor/assets/javascripts/locales/jquery.timeago.ar.js +12 -4
  20. data/vendor/assets/javascripts/locales/jquery.timeago.az-short.js +30 -20
  21. data/vendor/assets/javascripts/locales/jquery.timeago.az.js +30 -20
  22. data/vendor/assets/javascripts/locales/jquery.timeago.be.js +43 -0
  23. data/vendor/assets/javascripts/locales/jquery.timeago.bg.js +28 -18
  24. data/vendor/assets/javascripts/locales/jquery.timeago.bs.js +13 -7
  25. data/vendor/assets/javascripts/locales/jquery.timeago.ca.js +30 -20
  26. data/vendor/assets/javascripts/locales/jquery.timeago.cs.js +34 -24
  27. data/vendor/assets/javascripts/locales/jquery.timeago.cy.js +30 -20
  28. data/vendor/assets/javascripts/locales/jquery.timeago.da.js +28 -18
  29. data/vendor/assets/javascripts/locales/jquery.timeago.de-short.js +30 -20
  30. data/vendor/assets/javascripts/locales/jquery.timeago.de.js +28 -18
  31. data/vendor/assets/javascripts/locales/jquery.timeago.dv.js +32 -22
  32. data/vendor/assets/javascripts/locales/jquery.timeago.el.js +28 -18
  33. data/vendor/assets/javascripts/locales/jquery.timeago.en-short.js +30 -20
  34. data/vendor/assets/javascripts/locales/jquery.timeago.es-short.js +31 -20
  35. data/vendor/assets/javascripts/locales/jquery.timeago.es.js +29 -18
  36. data/vendor/assets/javascripts/locales/jquery.timeago.et.js +28 -18
  37. data/vendor/assets/javascripts/locales/jquery.timeago.eu.js +28 -17
  38. data/vendor/assets/javascripts/locales/jquery.timeago.fa-short.js +30 -20
  39. data/vendor/assets/javascripts/locales/jquery.timeago.fa.js +32 -22
  40. data/vendor/assets/javascripts/locales/jquery.timeago.fi.js +38 -28
  41. data/vendor/assets/javascripts/locales/jquery.timeago.fr-short.js +26 -16
  42. data/vendor/assets/javascripts/locales/jquery.timeago.fr.js +27 -17
  43. data/vendor/assets/javascripts/locales/jquery.timeago.gl.js +28 -18
  44. data/vendor/assets/javascripts/locales/jquery.timeago.he.js +26 -16
  45. data/vendor/assets/javascripts/locales/jquery.timeago.hr.js +53 -48
  46. data/vendor/assets/javascripts/locales/jquery.timeago.hu.js +28 -18
  47. data/vendor/assets/javascripts/locales/jquery.timeago.hy.js +28 -18
  48. data/vendor/assets/javascripts/locales/jquery.timeago.id.js +29 -18
  49. data/vendor/assets/javascripts/locales/jquery.timeago.is.js +29 -19
  50. data/vendor/assets/javascripts/locales/jquery.timeago.it-short.js +30 -20
  51. data/vendor/assets/javascripts/locales/jquery.timeago.it.js +28 -16
  52. data/vendor/assets/javascripts/locales/jquery.timeago.ja.js +29 -19
  53. data/vendor/assets/javascripts/locales/jquery.timeago.jv.js +28 -18
  54. data/vendor/assets/javascripts/locales/jquery.timeago.ko.js +31 -20
  55. data/vendor/assets/javascripts/locales/jquery.timeago.ky.js +11 -3
  56. data/vendor/assets/javascripts/locales/jquery.timeago.lt.js +30 -20
  57. data/vendor/assets/javascripts/locales/jquery.timeago.lv.js +30 -20
  58. data/vendor/assets/javascripts/locales/jquery.timeago.mk.js +30 -20
  59. data/vendor/assets/javascripts/locales/jquery.timeago.nl.js +30 -20
  60. data/vendor/assets/javascripts/locales/jquery.timeago.no.js +28 -18
  61. data/vendor/assets/javascripts/locales/jquery.timeago.pl.js +11 -3
  62. data/vendor/assets/javascripts/locales/jquery.timeago.pt-br-short.js +30 -20
  63. data/vendor/assets/javascripts/locales/jquery.timeago.pt-br.js +28 -18
  64. data/vendor/assets/javascripts/locales/jquery.timeago.pt-short.js +30 -20
  65. data/vendor/assets/javascripts/locales/jquery.timeago.pt.js +26 -16
  66. data/vendor/assets/javascripts/locales/jquery.timeago.ro.js +29 -18
  67. data/vendor/assets/javascripts/locales/jquery.timeago.rs.js +53 -48
  68. data/vendor/assets/javascripts/locales/jquery.timeago.ru.js +11 -3
  69. data/vendor/assets/javascripts/locales/jquery.timeago.rw.js +30 -20
  70. data/vendor/assets/javascripts/locales/jquery.timeago.si.js +28 -18
  71. data/vendor/assets/javascripts/locales/jquery.timeago.sk.js +34 -24
  72. data/vendor/assets/javascripts/locales/jquery.timeago.sl.js +45 -39
  73. data/vendor/assets/javascripts/locales/jquery.timeago.sq.js +26 -0
  74. data/vendor/assets/javascripts/locales/jquery.timeago.sr.js +53 -48
  75. data/vendor/assets/javascripts/locales/jquery.timeago.sv.js +28 -18
  76. data/vendor/assets/javascripts/locales/jquery.timeago.th.js +30 -20
  77. data/vendor/assets/javascripts/locales/jquery.timeago.tr-short.js +30 -20
  78. data/vendor/assets/javascripts/locales/jquery.timeago.tr.js +26 -16
  79. data/vendor/assets/javascripts/locales/jquery.timeago.uk.js +11 -3
  80. data/vendor/assets/javascripts/locales/jquery.timeago.ur.js +30 -0
  81. data/vendor/assets/javascripts/locales/jquery.timeago.uz.js +29 -19
  82. data/vendor/assets/javascripts/locales/jquery.timeago.vi.js +30 -20
  83. data/vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js +31 -20
  84. data/vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js +30 -20
  85. metadata +8 -4
@@ -1,20 +1,30 @@
1
- // Portuguese Brasil shortened
2
- jQuery.timeago.settings.strings["pt-br-short"] = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1M",
15
- months: "%dM",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Portuguese Brasil shortened
11
+ jQuery.timeago.settings.strings["pt-br-short"] = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1M",
24
+ months: "%dM",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: []
29
+ };
30
+ }));
@@ -1,18 +1,28 @@
1
- // Brazilian Portuguese
2
- jQuery.timeago.settings.strings["pt-br"] = {
3
- prefixAgo: "há",
4
- prefixFromNow: "em",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "alguns segundos",
8
- minute: "um minuto",
9
- minutes: "%d minutos",
10
- hour: "uma hora",
11
- hours: "%d horas",
12
- day: "um dia",
13
- days: "%d dias",
14
- month: "um mês",
15
- months: "%d meses",
16
- year: "um ano",
17
- years: "%d anos"
18
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Brazilian Portuguese
11
+ jQuery.timeago.settings.strings["pt-br"] = {
12
+ prefixAgo: "",
13
+ prefixFromNow: "em",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "alguns segundos",
17
+ minute: "um minuto",
18
+ minutes: "%d minutos",
19
+ hour: "uma hora",
20
+ hours: "%d horas",
21
+ day: "um dia",
22
+ days: "%d dias",
23
+ month: "um mês",
24
+ months: "%d meses",
25
+ year: "um ano",
26
+ years: "%d anos"
27
+ };
28
+ }));
@@ -1,20 +1,30 @@
1
- // Portuguese shortened
2
- jQuery.timeago.settings.strings["pt-short"] = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1M",
15
- months: "%dM",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Portuguese shortened
11
+ jQuery.timeago.settings.strings["pt-short"] = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1M",
24
+ months: "%dM",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: []
29
+ };
30
+ }));
@@ -1,16 +1,26 @@
1
- // Portuguese
2
- jQuery.timeago.settings.strings["pt"] = {
3
- suffixAgo: "atrás",
4
- suffixFromNow: "a partir de agora",
5
- seconds: "menos de um minuto",
6
- minute: "cerca de um minuto",
7
- minutes: "%d minutos",
8
- hour: "cerca de uma hora",
9
- hours: "cerca de %d horas",
10
- day: "um dia",
11
- days: "%d dias",
12
- month: "cerca de um mês",
13
- months: "%d meses",
14
- year: "cerca de um ano",
15
- years: "%d anos"
16
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Portuguese
11
+ jQuery.timeago.settings.strings["pt"] = {
12
+ suffixAgo: "atrás",
13
+ suffixFromNow: "a partir de agora",
14
+ seconds: "menos de um minuto",
15
+ minute: "cerca de um minuto",
16
+ minutes: "%d minutos",
17
+ hour: "cerca de uma hora",
18
+ hours: "cerca de %d horas",
19
+ day: "um dia",
20
+ days: "%d dias",
21
+ month: "cerca de um mês",
22
+ months: "%d meses",
23
+ year: "cerca de um ano",
24
+ years: "%d anos"
25
+ };
26
+ }));
@@ -1,18 +1,29 @@
1
- // Romanian
2
- jQuery.timeago.settings.strings["ro"] = {
3
- prefixAgo: "acum",
4
- prefixFromNow: "in timp de",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "mai putin de un minut",
8
- minute: "un minut",
9
- minutes: "%d minute",
10
- hour: "o ora",
11
- hours: "%d ore",
12
- day: "o zi",
13
- days: "%d zile",
14
- month: "o luna",
15
- months: "%d luni",
16
- year: "un an",
17
- years: "%d ani"
18
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Romanian
11
+ jQuery.timeago.settings.strings["ro"] = {
12
+ prefixAgo: "acum",
13
+ prefixFromNow: "in timp de",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "mai putin de un minut",
17
+ minute: "un minut",
18
+ minutes: "%d minute",
19
+ hour: "o ora",
20
+ hours: "%d ore",
21
+ day: "o zi",
22
+ days: "%d zile",
23
+ month: "o luna",
24
+ months: "%d luni",
25
+ year: "un an",
26
+ years: "%d ani"
27
+ };
28
+ }));
29
+
@@ -1,49 +1,54 @@
1
- // Serbian
2
- (function () {
3
- var numpf;
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Serbian
11
+ var numpf = function (n, f, s, t) {
12
+ var n10;
13
+ n10 = n % 10;
14
+ if (n10 === 1 && (n === 1 || n > 20)) {
15
+ return f;
16
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
17
+ return s;
18
+ } else {
19
+ return t;
20
+ }
21
+ };
4
22
 
5
- numpf = function (n, f, s, t) {
6
- var n10;
7
- n10 = n % 10;
8
- if (n10 === 1 && (n === 1 || n > 20)) {
9
- return f;
10
- } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
11
- return s;
12
- } else {
13
- return t;
14
- }
15
- };
16
-
17
- jQuery.timeago.settings.strings["rs"] = {
18
- prefixAgo: "pre",
19
- prefixFromNow: "za",
20
- suffixAgo: null,
21
- suffixFromNow: null,
22
- second: "sekund",
23
- seconds: function (value) {
24
- return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
25
- },
26
- minute: "oko minut",
27
- minutes: function (value) {
28
- return numpf(value, "%d minut", "%d minuta", "%d minuta");
29
- },
30
- hour: "oko jedan sat",
31
- hours: function (value) {
32
- return numpf(value, "%d sat", "%d sata", "%d sati");
33
- },
34
- day: "jedan dan",
35
- days: function (value) {
36
- return numpf(value, "%d dan", "%d dana", "%d dana");
37
- },
38
- month: "mesec dana",
39
- months: function (value) {
40
- return numpf(value, "%d mesec", "%d meseca", "%d meseci");
41
- },
42
- year: "godinu dana",
43
- years: function (value) {
44
- return numpf(value, "%d godinu", "%d godine", "%d godina");
45
- },
46
- wordSeparator: " "
47
- };
48
-
49
- }).call(this);
23
+ jQuery.timeago.settings.strings["rs"] = {
24
+ prefixAgo: "pre",
25
+ prefixFromNow: "za",
26
+ suffixAgo: null,
27
+ suffixFromNow: null,
28
+ second: "sekund",
29
+ seconds: function (value) {
30
+ return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
31
+ },
32
+ minute: "oko minut",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d minut", "%d minuta", "%d minuta");
35
+ },
36
+ hour: "oko jedan sat",
37
+ hours: function (value) {
38
+ return numpf(value, "%d sat", "%d sata", "%d sati");
39
+ },
40
+ day: "jedan dan",
41
+ days: function (value) {
42
+ return numpf(value, "%d dan", "%d dana", "%d dana");
43
+ },
44
+ month: "mesec dana",
45
+ months: function (value) {
46
+ return numpf(value, "%d mesec", "%d meseca", "%d meseci");
47
+ },
48
+ year: "godinu dana",
49
+ years: function (value) {
50
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
51
+ },
52
+ wordSeparator: " "
53
+ };
54
+ }));
@@ -1,5 +1,13 @@
1
- // Russian
2
- (function() {
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Russian
3
11
  function numpf(n, f, s, t) {
4
12
  // f - 1, 21, 31, ...
5
13
  // s - 2-4, 22-24, 32-34 ...
@@ -32,4 +40,4 @@
32
40
  year: "год",
33
41
  years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
34
42
  };
35
- })();
43
+ }));
@@ -1,20 +1,30 @@
1
- // Kinyarwanda
2
- jQuery.timeago.settings.strings["rw"] = {
3
- prefixAgo: "hashize",
4
- prefixFromNow: "mu",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "amasegonda macye",
8
- minute: "umunota",
9
- minutes: "iminota %d",
10
- hour: "isaha",
11
- hours: "amasaha %d",
12
- day: "umunsi",
13
- days: "iminsi %d",
14
- month: "ukwezi",
15
- months: "amezi %d",
16
- year: "umwaka",
17
- years: "imyaka %d",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Kinyarwanda
11
+ jQuery.timeago.settings.strings["rw"] = {
12
+ prefixAgo: "hashize",
13
+ prefixFromNow: "mu",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "amasegonda macye",
17
+ minute: "umunota",
18
+ minutes: "iminota %d",
19
+ hour: "isaha",
20
+ hours: "amasaha %d",
21
+ day: "umunsi",
22
+ days: "iminsi %d",
23
+ month: "ukwezi",
24
+ months: "amezi %d",
25
+ year: "umwaka",
26
+ years: "imyaka %d",
27
+ wordSeparator: " ",
28
+ numbers: []
29
+ };
30
+ }));
@@ -1,18 +1,28 @@
1
- // Sinhalese (SI)
2
- jQuery.timeago.settings.strings["si"] = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "පෙර",
6
- suffixFromNow: "පසුව",
7
- seconds: "තත්පර කිහිපයකට",
8
- minute: "මිනිත්තුවකට පමණ",
9
- minutes: "මිනිත්තු %d කට",
10
- hour: "පැයක් පමණ ",
11
- hours: "පැය %d කට පමණ",
12
- day: "දවසක ට",
13
- days: "දවස් %d කට ",
14
- month: "මාසයක් පමණ",
15
- months: "මාස %d කට",
16
- year: "වසරක් පමණ",
17
- years: "වසරක් %d කට පමණ"
18
- };
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ define(['jquery'], factory);
4
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
+ factory(require('jquery'));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ }(function (jQuery) {
10
+ // Sinhalese (SI)
11
+ jQuery.timeago.settings.strings["si"] = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "පෙර",
15
+ suffixFromNow: "පසුව",
16
+ seconds: "තත්පර කිහිපයකට",
17
+ minute: "මිනිත්තුවකට පමණ",
18
+ minutes: "මිනිත්තු %d කට",
19
+ hour: "පැයක් පමණ ",
20
+ hours: "පැය %d කට පමණ",
21
+ day: "දවසක ට",
22
+ days: "දවස් %d කට ",
23
+ month: "මාසයක් පමණ",
24
+ months: "මාස %d කට",
25
+ year: "වසරක් පමණ",
26
+ years: "වසරක් %d කට පමණ"
27
+ };
28
+ }));