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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19ad06f15553f22b78e77f182ba857181dbc2eb8
4
- data.tar.gz: 2aa9841812c6d4d0f731bbb8ef15de6904b45454
3
+ metadata.gz: e6690dd05a4827a44c3299e6ab3ff0f9dc008379
4
+ data.tar.gz: cd2d422eaa587d037a5fc71717201c2f1e2b3018
5
5
  SHA512:
6
- metadata.gz: 9a07686e7c7e5085071122186ec7f88b0b687de47593edfe5655a84c73b5b86ec4a02f7e82bae56f9ee4d8bd61b9d215bdd49d2fd60e6dfc2a65b6f13ee03b65
7
- data.tar.gz: 97125bca25ce2e56f0de941aa9daa19a236eb8d93b90cc24ba0afda6dee1b23e4d54848c09ce782d4cb882be8ae2fd9fb80fe3dc775dcf0143bcd58845c03814
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
- * 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
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 on any Ruby project.
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 (recommended)**
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 appraisal rake
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 "bundler/setup"
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 "ERROR! #{e}"
47
+ puts "Error! #{e}"
47
48
  end
48
49
  end
@@ -8,7 +8,11 @@ end
8
8
 
9
9
  module Jekyll
10
10
  module Timeago
11
- include Jekyll::Timeago::Core
11
+ extend self
12
+
13
+ def timeago(from, to = Date.today, options = {})
14
+ Core.timeago(from, to, options)
15
+ end
12
16
  end
13
17
  end
14
18
 
@@ -6,10 +6,10 @@ module Jekyll
6
6
  extend self
7
7
 
8
8
  DAYS_PER = {
9
- :days => 1,
10
- :weeks => 7,
11
- :months => 30,
12
- :years => 365
9
+ days: 1,
10
+ weeks: 7,
11
+ months: 30,
12
+ years: 365
13
13
  }
14
14
 
15
15
  # Max level of detail
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Timeago
3
- VERSION = "0.10.0"
3
+ VERSION = "0.10.1"
4
4
  end
5
5
  end
data/lib/locales/fr.yml CHANGED
@@ -1,17 +1,17 @@
1
1
  fr:
2
2
  today: "aujourd'hui"
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"
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'
@@ -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'
@@ -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 1`).to match("ERROR!")
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
@@ -23,6 +23,6 @@ RSpec.configure do |config|
23
23
  end
24
24
 
25
25
  def timeago(from, to = Date.today, options = {})
26
- Jekyll::Timeago::Core.timeago(from, to, options)
26
+ Jekyll::Timeago.timeago(from, to, options)
27
27
  end
28
28
  end
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.0
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-24 00:00:00.000000000 Z
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.6.13
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.