jekyll-last-modified-at 0.3.4 → 1.0.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
  SHA1:
3
- metadata.gz: 4b01b654d3738194925784d2a726d08a20defe8b
4
- data.tar.gz: 37b5003bf897617cd81841e7db8005f24a14fa8c
3
+ metadata.gz: a22dca0c755e55f0fd29e1ff571e96efbc5325ac
4
+ data.tar.gz: d359cdcfbb95062ad00d75b3f840a48723c0227f
5
5
  SHA512:
6
- metadata.gz: 6dfa628947bf66a8b0b82863186509cbfcb558a92e1a374b8acdeeba5f03f2221820b0685d35e8f7001329d86ecb46be4dbe56ec68bd9715dc75ba710ea7c8f4
7
- data.tar.gz: 3c01c64b16530663a40e6387151a6803bb7cd4b83e6a00e15136beff2f025d315b346731442cb7594c02c683317af8493b05455a7461f848d3a4e6f2b0044fba
6
+ metadata.gz: f2e24298d5d6109d28ed181549fd360af2da99244a7ba8c135c55020f966edeecb8c157b4c077421f6ffd4ca5930c587e65e386f52d504f39a1c59446921400f
7
+ data.tar.gz: df70710583e0d16fefd0292d0af54dd63349e820d74baab16148896674d521c29b9df0fa1197dd40dfe6974f5526f0b1886238894e75d3b9ed36f8246a71608b
@@ -4,10 +4,10 @@ module Jekyll
4
4
  autoload :VERSION, 'jekyll-last-modified-at/version'
5
5
  autoload :Executor, 'jekyll-last-modified-at/executor'
6
6
  autoload :Determinator, 'jekyll-last-modified-at/determinator'
7
- autoload :Generator, 'jekyll-last-modified-at/generator'
8
7
  autoload :Tag, 'jekyll-last-modified-at/tag'
8
+ autoload :Hook, 'jekyll-last-modified-at/hook'
9
9
 
10
- Generator ; Tag
10
+ Tag ; Hook
11
11
 
12
12
  PATH_CACHE = {}
13
13
  end
@@ -1,14 +1,30 @@
1
- require 'open3'
1
+ require 'posix/spawn'
2
2
 
3
3
  module Jekyll
4
4
  module LastModifiedAt
5
5
  module Executor
6
+ extend POSIX::Spawn
7
+
6
8
  def self.sh(*args)
7
- Open3.popen2e(*args) do |stdin, stdout_stderr, wait_thr|
8
- exit_status = wait_thr.value # wait for it...
9
- output = stdout_stderr.read
10
- output ? output.strip : nil
9
+ r, w = IO.pipe
10
+ e, eo = IO.pipe
11
+ pid = spawn(*args, {
12
+ :out => w, r => :close,
13
+ :err => eo, e => :close
14
+ })
15
+
16
+ if pid > 0
17
+ w.close
18
+ eo.close
19
+ out = r.read
20
+ err = e.read
21
+ ::Process.waitpid(pid)
22
+ if out
23
+ "#{out} #{err}".strip
24
+ end
11
25
  end
26
+ ensure
27
+ [r, w, e, eo].each{ |io| io.close rescue nil }
12
28
  end
13
29
  end
14
30
  end
@@ -0,0 +1,15 @@
1
+ module Jekyll
2
+ module LastModifiedAt
3
+ module Hook
4
+ def self.add_determinator_proc
5
+ proc { |item|
6
+ item.data['last_modified_at'] = Determinator.new(item.site.source, item.path)
7
+ }
8
+ end
9
+
10
+ Jekyll::Hooks.register :posts, :post_init, &Hook.add_determinator_proc
11
+ Jekyll::Hooks.register :pages, :post_init, &Hook.add_determinator_proc
12
+ Jekyll::Hooks.register :documents, :post_init, &Hook.add_determinator_proc
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module LastModifiedAt
3
- VERSION = "0.3.4"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-last-modified-at
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-12 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 3.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: posix-spawn
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.9
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.9
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: redcarpet
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description:
70
98
  email:
71
99
  executables: []
@@ -75,7 +103,7 @@ files:
75
103
  - lib/jekyll-last-modified-at.rb
76
104
  - lib/jekyll-last-modified-at/determinator.rb
77
105
  - lib/jekyll-last-modified-at/executor.rb
78
- - lib/jekyll-last-modified-at/generator.rb
106
+ - lib/jekyll-last-modified-at/hook.rb
79
107
  - lib/jekyll-last-modified-at/tag.rb
80
108
  - lib/jekyll-last-modified-at/version.rb
81
109
  homepage: https://github.com/gjtorikian/jekyll-last-modified-at
@@ -98,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
126
  version: '0'
99
127
  requirements: []
100
128
  rubyforge_project:
101
- rubygems_version: 2.2.2
129
+ rubygems_version: 2.4.5.1
102
130
  signing_key:
103
131
  specification_version: 4
104
132
  summary: A liquid tag for Jekyll to indicate the last time a file was modified.
@@ -1,15 +0,0 @@
1
- module Jekyll
2
- module LastModifiedAt
3
- class Generator < Jekyll::Generator
4
-
5
- def generate(site)
6
- %w(posts pages docs_to_write).each do |type|
7
- site.send(type).each do |item|
8
- item.data['last_modified_at'] = Determinator.new(site.source, item.path)
9
- end
10
- end
11
- end
12
-
13
- end
14
- end
15
- end