rails-timeago 2.18.0 → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17137c2d5720a32705aa2c5f01886963a72bb56a9d2e77361bd69c541fbb242a
4
- data.tar.gz: 7f313528923a2076a467c18469f12f04b30c636302820c932125e2b05fc1795d
3
+ metadata.gz: 5653983cf12f0fdc7e6a9652e32a0b416c7df3467e10c94e7cffb4a89d7bd46b
4
+ data.tar.gz: 48da15e4a1f7b9d6a9ddbc05574927d560f92eea17b9e578139f9ed17c142f59
5
5
  SHA512:
6
- metadata.gz: a92f094e1d0ec706b85447a330d71e78eb964e27e96682e5ca8e114d24615bbc17ea265a95c4e2ef08b8f1b272b4c690148f8b63a9b3e8a01ea2e78957a9a427
7
- data.tar.gz: 77a2e4463705bc99bfd68c23c4d40e44c33e99fd3462173ccb07ae4c1659dd53db3164a2c2117c76879490df8f076ae54619dbf0bb4e288281c183530d167cb7
6
+ metadata.gz: 9240a67ff85cf0d11264efcfed29846f988a164a45fca5a576e52d94eba0a6d67fe1ce6c63b0bd1d9ea42d856818573036ccfb6fdca0e0bb5c8ed63aaf35e1d5
7
+ data.tar.gz: 7103a15660b81043bdd7a1e1b0aeda93c94ae5c43098b3376794dd86dea26ec96aaf9201091b15d662baa394eee792e4a0ad29f37c7134acdf9f882809d8dfb7
@@ -1,22 +1,9 @@
1
+ ---
1
2
  dist: xenial
2
3
  language: ruby
3
4
  rvm:
4
- - 2.6.5
5
- - 2.5.7
6
- - 2.4.9
7
- - 2.3.8
8
- before_install:
9
- - gem install bundler
10
- jobs:
11
- include:
12
- - stage: Release
13
- script: skip
14
- install: skip
15
- deploy:
16
- provider: rubygems
17
- api_key:
18
- secure: XYbT9MB6DNzKu95OqrA5qIV2rD1L6RLpfCb9s/3YnhKY8tTP1NcitvmXLHtNLAoHldYrb9AmSfNh5wFgFnfoqFkpz4B94SBrkQtGZ9wzIj4otxMgntGsrGd6qLBfnXGG8rctngeJlo0eVKkE/3fJtiXb5mEx72fvxd2+/fYfubY=
19
- gem: rails-timeago
20
- on:
21
- tags: true
22
- repo: jgraichen/rails-timeago
5
+ - 2.7.1
6
+ - 2.6.6
7
+ - 2.5.8
8
+ - 2.4.10
9
+ - 2.3.8
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.19.0
4
+
5
+ * Update jquery-timeago and locales from upstream
6
+ * Reinitialize on ajaxSuccess event too (#34)
7
+
3
8
  ## 2.18.0
4
9
 
5
10
  * Update jquery-timeago and locales from upstream
@@ -19,7 +24,7 @@
19
24
  ## 2.15.0
20
25
 
21
26
  * Update jquery-timeago and locales from upstream
22
- * Remove an use of derpecated "ready" event (compatible with jQuery 3.0) (#40)
27
+ * Remove an use of deprecated "ready" event (compatible with jQuery 3.0) (#40)
23
28
 
24
29
  ## 2.14.0
25
30
 
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gemspec
7
7
 
8
8
  group :development do
9
9
  gem 'rake'
10
+ gem 'rake-release'
10
11
  end
11
12
 
12
13
  group :test do
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # rails-timeago
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rails-timeago.svg)](http://badge.fury.io/rb/rails-timeago)
4
- [![Build Status](https://travis-ci.org/jgraichen/rails-timeago.svg?branch=master)](https://travis-ci.org/jgraichen/rails-timeago)
5
- [![Code Climate](https://codeclimate.com/github/jgraichen/rails-timeago.svg)](https://codeclimate.com/github/jgraichen/rails-timeago)
3
+ [![Gem Version](https://img.shields.io/gem/v/rails-timeago?logo=ruby)](https://rubygems.org/gems/rails-timeago)
4
+ [![Build Status](https://img.shields.io/travis/jgraichen/rails-timeago/master?logo=travis)](https://travis-ci.org/jgraichen/rails-timeago)
6
5
 
7
6
  **rails-timeago** provides a timeago_tag helper to create time tags usable for
8
7
  [jQuery Timeago](https://github.com/rmm5t/jquery-timeago) plugin.
@@ -33,21 +32,23 @@ Use the following to also include all available locale files:
33
32
 
34
33
  //= require rails-timeago-all
35
34
 
35
+ If using a recent Rails with `rails-ujs`, jQuery might not be present anymore. You need to add `jquery-rails` to your `Gemfile` and load it, e.g.:
36
+
37
+ //= require jquery
38
+ //= require rails-timeago
39
+ //= require rails-timeago-all
40
+
36
41
  ## Usage
37
42
 
38
43
  Use the timeago_tag helper like any other regular tag helper:
39
44
 
40
45
  ```erb
41
- <%= timeago_tag Time.zone.now, :nojs => true, :limit => 10.days.ago %>
46
+ <%= timeago_tag Time.zone.now limit: 10.days.ago %>
42
47
  ```
43
48
 
44
49
 
45
50
  ### Available options:
46
51
 
47
- **nojs**
48
- Add time ago in words as time tag content instead of absolute time.
49
- (default: `false`)
50
-
51
52
  **date_only**
52
53
  Only print date as tag content instead of full time.
53
54
  (default: `true`)
@@ -70,13 +71,13 @@ String that will be returned if time is `nil`.
70
71
 
71
72
  **title**
72
73
  A string or block that will be used to create a title attribute for timeago tags. It set to nil or false no title attribute will be set.
73
- (default: `proc { |time, options| I18n.l time, :format => options[:format] }`)
74
+ (default: `proc { |time, options| I18n.l time, format: options[:format] }`)
74
75
 
75
76
  All other options will be given as options to the time tag helper.
76
77
  The above options can be assigned globally as defaults using
77
78
 
78
79
  ```ruby
79
- Rails::Timeago.default_options :limit => proc { 20.days.ago }, :nojs => true
80
+ Rails::Timeago.default_options limit: proc { 20.days.ago }
80
81
  ```
81
82
 
82
83
  A global limit should always be given as a block that will be evaluated each time the rails `timeago_tag` helper is called. That avoids the limit becoming smaller the longer the application runs.
@@ -86,7 +87,7 @@ A global limit should always be given as a block that will be evaluated each tim
86
87
  **rails-timeago 2** ships with a modified version of jQuery timeago that allows to include all locale files at once and set the locale via an option or per element via the `lang` attribute:
87
88
 
88
89
  ```erb
89
- <%= timeago_tag Time.zone.now, :lang => :de %>
90
+ <%= timeago_tag Time.zone.now, lang: :de %>
90
91
  ```
91
92
 
92
93
  The following snippet will print a script tag that set the jQuery timeago locale according to your `I18n.locale`:
@@ -112,8 +113,6 @@ Do not forget to require the needed locale files by either require `rails-timeag
112
113
 
113
114
  **rails-timeago** includes locale files for the following locales taken from [jQuery Timeago](https://github.com/rmm5t/jquery-timeago).
114
115
 
115
- > de cy pl mk zh-CN bs en-short it fi es uk lt zh-TW sk hy ca pt el sv ar no fa fr pt-br tr he bg ko uz cz sl hu id hr ru nl fr-short da ja ro th
116
-
117
116
  Your customized jQuery locale files must be changed to work with **rails-timeago 2**. Instead of defining your locale strings as `jQuery.timeago.settings.strings` you need to define them like this:
118
117
 
119
118
  ```js
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/gem_tasks'
4
+ require 'rake/release'
5
5
  require 'rspec/core/rake_task'
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec)
@@ -17,6 +17,7 @@
17
17
  //= require locales/jquery.timeago.dv.js
18
18
  //= require locales/jquery.timeago.el.js
19
19
  //= require locales/jquery.timeago.en-short.js
20
+ //= require locales/jquery.timeago.eo.js
20
21
  //= require locales/jquery.timeago.es-short.js
21
22
  //= require locales/jquery.timeago.es.js
22
23
  //= require locales/jquery.timeago.et.js
@@ -37,6 +38,7 @@
37
38
  //= require locales/jquery.timeago.it.js
38
39
  //= require locales/jquery.timeago.ja.js
39
40
  //= require locales/jquery.timeago.jv.js
41
+ //= require locales/jquery.timeago.ka.js
40
42
  //= require locales/jquery.timeago.ko.js
41
43
  //= require locales/jquery.timeago.ky.js
42
44
  //= require locales/jquery.timeago.lt.js
@@ -8,5 +8,5 @@
8
8
  $('time[data-time-ago]').timeago();
9
9
  };
10
10
  $(fn);
11
- $(document).on('turbolinks:load page:load ajax:success', fn);
11
+ $(document).on('turbolinks:load page:load ajax:success ajaxSuccess', fn);
12
12
  })(jQuery);
@@ -4,7 +4,7 @@ module Rails
4
4
  module Timeago
5
5
  module VERSION
6
6
  MAJOR = 2
7
- MINOR = 18
7
+ MINOR = 19
8
8
  PATCH = 0
9
9
  STAGE = nil
10
10
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.').freeze
@@ -53,7 +53,7 @@
53
53
  prefixFromNow: null,
54
54
  suffixAgo: "ago",
55
55
  suffixFromNow: "from now",
56
- inPast: 'any moment now',
56
+ inPast: "any moment now",
57
57
  seconds: "less than a minute",
58
58
  minute: "about a minute",
59
59
  minutes: "%d minutes",
@@ -0,0 +1,30 @@
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
+ // English (Template) -> Esperanto
11
+ jQuery.timeago.settings.strings["eo"] = {
12
+ prefixAgo: "antaŭ",
13
+ prefixFromNow: null,
14
+ suffixAgo: null,
15
+ suffixFromNow: "de nun",
16
+ seconds: "malpli ol minuto",
17
+ minute: "ĉirkaŭ uno minuto",
18
+ minutes: "%d minutoj",
19
+ hour: "ĉirkaŭ uno horo",
20
+ hours: "ĉirkaŭ %d horojn",
21
+ day: "ĉirkaŭ tago",
22
+ days: "%d tagoj",
23
+ month: "ĉirkaŭ unu monato",
24
+ months: "%d monatoj",
25
+ year: "ĉirkaŭ unu jaro",
26
+ years: "%d jaroj",
27
+ wordSeparator: " ",
28
+ numbers: []
29
+ };
30
+ }));
@@ -7,7 +7,7 @@
7
7
  factory(jQuery);
8
8
  }
9
9
  }(function (jQuery) {
10
- // persion shortened
10
+ // persian shortened
11
11
  jQuery.timeago.settings.strings["fa-short"] = {
12
12
  prefixAgo: null,
13
13
  prefixFromNow: null,
@@ -0,0 +1,30 @@
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
+ // English (Template)
11
+ jQuery.timeago.settings.strings["ka"] = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "ის წინ",
15
+ suffixFromNow: null,
16
+ seconds: "რამდენიმე წამ",
17
+ minute: "1 წუთ",
18
+ minutes: "%d წუთ",
19
+ hour: "1 საათ",
20
+ hours: "%d საათ",
21
+ day: "1 დღ",
22
+ days: "%d დღ",
23
+ month: "1 თვ",
24
+ months: "%d თვ",
25
+ year: "1 წლ",
26
+ years: "%d წლ",
27
+ wordSeparator: "",
28
+ };
29
+ })
30
+ );
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-timeago
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-03 00:00:00.000000000 Z
11
+ date: 2020-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -82,6 +82,7 @@ files:
82
82
  - vendor/assets/javascripts/locales/jquery.timeago.dv.js
83
83
  - vendor/assets/javascripts/locales/jquery.timeago.el.js
84
84
  - vendor/assets/javascripts/locales/jquery.timeago.en-short.js
85
+ - vendor/assets/javascripts/locales/jquery.timeago.eo.js
85
86
  - vendor/assets/javascripts/locales/jquery.timeago.es-short.js
86
87
  - vendor/assets/javascripts/locales/jquery.timeago.es.js
87
88
  - vendor/assets/javascripts/locales/jquery.timeago.et.js
@@ -102,6 +103,7 @@ files:
102
103
  - vendor/assets/javascripts/locales/jquery.timeago.it.js
103
104
  - vendor/assets/javascripts/locales/jquery.timeago.ja.js
104
105
  - vendor/assets/javascripts/locales/jquery.timeago.jv.js
106
+ - vendor/assets/javascripts/locales/jquery.timeago.ka.js
105
107
  - vendor/assets/javascripts/locales/jquery.timeago.ko.js
106
108
  - vendor/assets/javascripts/locales/jquery.timeago.ky.js
107
109
  - vendor/assets/javascripts/locales/jquery.timeago.lt.js
@@ -152,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
154
  - !ruby/object:Gem::Version
153
155
  version: '0'
154
156
  requirements: []
155
- rubygems_version: 3.0.3
157
+ rubygems_version: 3.1.2
156
158
  signing_key:
157
159
  specification_version: 4
158
160
  summary: A Rails Helper to create time tags usable for jQuery Timeago plugin