jekyll-timeago 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -14
- data/bin/jekyll-timeago +5 -4
- data/lib/jekyll-timeago.rb +5 -1
- data/lib/jekyll-timeago/core.rb +4 -4
- data/lib/jekyll-timeago/version.rb +1 -1
- data/lib/locales/fr.yml +15 -15
- data/lib/locales/it.yml +17 -0
- data/spec/jekyll-timeago_spec.rb +8 -8
- data/spec/spec_helper.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6690dd05a4827a44c3299e6ab3ff0f9dc008379
|
4
|
+
data.tar.gz: cd2d422eaa587d037a5fc71717201c2f1e2b3018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e78eff967fed89807fe9a2c2d64c0f6278a19ca069f5320c6198e1dafee198087e2cdbf53c05f8884b0652634116295d48b345dfa9d40800b93563d453d026
|
7
|
+
data.tar.gz: 8228448f9792aa740956386bcad762465eb799375a24fffc0dae8a2698ac8082eabc7317d84d41ca15096eee50e889a3fe9efe81cf386e96e886f0935dada702
|
data/README.md
CHANGED
@@ -8,16 +8,16 @@
|
|
8
8
|
|
9
9
|
Main features:
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
- Compute distance of dates, in words, ie: `1 week and 2 days ago`, `5 months ago`, `in 1 year`
|
12
|
+
- Future times
|
13
|
+
- Out of the box support for `Jekyll` (`v1`, `v2` and `v3`) projects, available as a Liquid Filter and as a Liquid Tag
|
14
|
+
- Localization (i18n)
|
15
|
+
- Level of detail
|
16
|
+
- Command line utility
|
17
17
|
|
18
|
-
In fact, `jekyll-timeago` started as an extension for [Liquid](https://github.com/Shopify/liquid) template engine, to be used in Jekyll and Octopress backed sites. But actually, you can use it easily
|
18
|
+
In fact, `jekyll-timeago` started as an extension for the [Liquid](https://github.com/Shopify/liquid) template engine, to be used in Jekyll and Octopress backed sites. But actually, you can use it easily in any Ruby project.
|
19
19
|
|
20
|
-
Read more about the Jekyll integration [in this section](#jekyll-integration).
|
20
|
+
Read more about the `Jekyll` integration [in this section](#jekyll-integration).
|
21
21
|
|
22
22
|
## Installation
|
23
23
|
|
@@ -118,6 +118,7 @@ If you want to contribute and support more languages by default, please feel fre
|
|
118
118
|
## CLI
|
119
119
|
|
120
120
|
```
|
121
|
+
> jekyll-timeago --help
|
121
122
|
> jekyll-timeago 2016-1-1
|
122
123
|
2 years and 6 months ago
|
123
124
|
> jekyll-timeago 2016-1-1 --locale fr
|
@@ -138,7 +139,7 @@ Starts a custom IRB session with the `#timeago` method included:
|
|
138
139
|
|
139
140
|
You have different options to install and use `jekyll-timeago` into your Jekyll project:
|
140
141
|
|
141
|
-
**Via Jekyll plugin system
|
142
|
+
- **Via Jekyll plugin system**
|
142
143
|
|
143
144
|
Install the `gem` to your system:
|
144
145
|
|
@@ -153,7 +154,7 @@ gems:
|
|
153
154
|
- jekyll-timeago
|
154
155
|
```
|
155
156
|
|
156
|
-
**Via Bundler**
|
157
|
+
- **Via Bundler**
|
157
158
|
|
158
159
|
Add this gem to your `Gemfile` and run `bundle install`:
|
159
160
|
|
@@ -183,7 +184,7 @@ end
|
|
183
184
|
|
184
185
|
In your `_config.yml` file:
|
185
186
|
|
186
|
-
```
|
187
|
+
```yaml
|
187
188
|
jekyll_timeago:
|
188
189
|
depth: 2
|
189
190
|
translations_path: '/path_to_your_translations/*.yaml'
|
@@ -210,11 +211,9 @@ Any kind of feedback, bug report, idea or enhancement are really appreciated.
|
|
210
211
|
To contribute, just fork the repo, hack on it and send a pull request. Don't forget to add specs for behaviour changes and run the test suite:
|
211
212
|
|
212
213
|
```
|
213
|
-
> bundle exec
|
214
|
+
> bundle exec rake
|
214
215
|
```
|
215
216
|
|
216
|
-
We use the `Appraisal` gem to ensure compatibility with different Jekyll versions. Check out current supported versions [here](Appraisals).
|
217
|
-
|
218
217
|
## License
|
219
218
|
|
220
219
|
Copyright (c) Marc Anguera. Jekyll-Timeago is released under the [MIT](LICENSE) License.
|
data/bin/jekyll-timeago
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mini_i18n"
|
4
4
|
require_relative "../lib/jekyll-timeago"
|
5
|
-
include Jekyll::Timeago
|
6
5
|
|
7
6
|
help_message = <<END
|
8
7
|
Usage:
|
@@ -25,6 +24,8 @@ elsif ARGV.include?("--version") || ARGV.include?("-v")
|
|
25
24
|
puts "v#{Jekyll::Timeago::VERSION}"
|
26
25
|
elsif ARGV.include?("--console") || ARGV.include?("-c")
|
27
26
|
require "irb"
|
27
|
+
include Jekyll::Timeago
|
28
|
+
|
28
29
|
ARGV.clear
|
29
30
|
IRB.start
|
30
31
|
else
|
@@ -41,8 +42,8 @@ else
|
|
41
42
|
end
|
42
43
|
|
43
44
|
begin
|
44
|
-
puts timeago *ARGV
|
45
|
+
puts Jekyll::Timeago.timeago *ARGV
|
45
46
|
rescue ArgumentError => e
|
46
|
-
puts "
|
47
|
+
puts "Error! #{e}"
|
47
48
|
end
|
48
49
|
end
|
data/lib/jekyll-timeago.rb
CHANGED
data/lib/jekyll-timeago/core.rb
CHANGED
data/lib/locales/fr.yml
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
fr:
|
2
2
|
today: "aujourd'hui"
|
3
|
-
yesterday:
|
4
|
-
tomorrow:
|
5
|
-
and:
|
6
|
-
suffix:
|
7
|
-
prefix:
|
8
|
-
suffix_future:
|
9
|
-
prefix_future:
|
10
|
-
years:
|
11
|
-
year:
|
12
|
-
months:
|
13
|
-
month:
|
14
|
-
weeks:
|
15
|
-
week:
|
16
|
-
days:
|
17
|
-
day:
|
3
|
+
yesterday: 'hier'
|
4
|
+
tomorrow: 'demain'
|
5
|
+
and: 'et'
|
6
|
+
suffix: ''
|
7
|
+
prefix: 'il y a environ'
|
8
|
+
suffix_future: ''
|
9
|
+
prefix_future: 'dans'
|
10
|
+
years: 'années'
|
11
|
+
year: 'année'
|
12
|
+
months: 'mois'
|
13
|
+
month: 'mois'
|
14
|
+
weeks: 'semaines'
|
15
|
+
week: 'semaine'
|
16
|
+
days: 'jours'
|
17
|
+
day: 'jour'
|
data/lib/locales/it.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
it:
|
2
|
+
today: 'oggi'
|
3
|
+
yesterday: 'ieri'
|
4
|
+
tomorrow: 'domani'
|
5
|
+
and: 'e'
|
6
|
+
suffix: 'fa'
|
7
|
+
prefix: ''
|
8
|
+
suffix_future: ''
|
9
|
+
prefix_future: 'fra'
|
10
|
+
years: 'anni'
|
11
|
+
year: 'anno'
|
12
|
+
months: 'mesi'
|
13
|
+
month: 'mese'
|
14
|
+
weeks: 'settimane'
|
15
|
+
week: 'settimana'
|
16
|
+
days: 'giorni'
|
17
|
+
day: 'giorno'
|
data/spec/jekyll-timeago_spec.rb
CHANGED
@@ -76,26 +76,26 @@ describe Jekyll::Timeago do
|
|
76
76
|
|
77
77
|
context 'CLI' do
|
78
78
|
it 'prints help message if called with no params or --help' do
|
79
|
-
expect(`jekyll-timeago`).to match("Usage")
|
80
|
-
expect(`jekyll-timeago --help`).to match("Usage")
|
79
|
+
expect(`bin/jekyll-timeago`).to match("Usage")
|
80
|
+
expect(`bin/jekyll-timeago --help`).to match("Usage")
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'prints current version' do
|
84
|
-
expect(`jekyll-timeago -v`).to match("v#{Jekyll::Timeago::VERSION}")
|
85
|
-
expect(`jekyll-timeago --version`).to match("v#{Jekyll::Timeago::VERSION}")
|
84
|
+
expect(`bin/jekyll-timeago -v`).to match("v#{Jekyll::Timeago::VERSION}")
|
85
|
+
expect(`bin/jekyll-timeago --version`).to match("v#{Jekyll::Timeago::VERSION}")
|
86
86
|
end
|
87
87
|
|
88
88
|
it 'computes distance of dates' do
|
89
|
-
expect(`jekyll-timeago 2016-1-1 2016-1-5`).to match("4 days ago")
|
89
|
+
expect(`bin/jekyll-timeago 2016-1-1 2016-1-5`).to match("4 days ago")
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'prints error with invalid date' do
|
93
|
-
expect(`jekyll-timeago
|
93
|
+
expect(`bin/jekyll-timeago 0`).to match("Error!")
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'with custom locale' do
|
97
|
-
expect(`jekyll-timeago 2016-1-1 2016-1-5 -l fr`).to match("il y a environ 4 jours")
|
98
|
-
expect(`jekyll-timeago 2016-1-1 2016-1-5 --locale fr`).to match("il y a environ 4 jours")
|
97
|
+
expect(`bin/jekyll-timeago 2016-1-1 2016-1-5 -l fr`).to match("il y a environ 4 jours")
|
98
|
+
expect(`bin/jekyll-timeago 2016-1-1 2016-1-5 --locale fr`).to match("il y a environ 4 jours")
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-timeago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_i18n
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- lib/locales/en.yml
|
137
137
|
- lib/locales/es.yml
|
138
138
|
- lib/locales/fr.yml
|
139
|
+
- lib/locales/it.yml
|
139
140
|
- lib/locales/pt.yml
|
140
141
|
- spec/jekyll-timeago_spec.rb
|
141
142
|
- spec/source/_config.yml
|
@@ -162,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
163
|
version: '0'
|
163
164
|
requirements: []
|
164
165
|
rubyforge_project:
|
165
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.5.1
|
166
167
|
signing_key:
|
167
168
|
specification_version: 4
|
168
169
|
summary: A date helper to compute distance of dates in words.
|