jekyll-hardlinks 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll/static_file.rb +15 -1
- metadata +24 -38
- data/.gitignore +0 -8
- data/.travis.yml +0 -7
- data/CODE_OF_CONDUCT.md +0 -7
- data/Gemfile +0 -4
- data/Rakefile +0 -10
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/jekyll-hardlinks.gemspec +0 -33
- data/lib/jekyll/hardlinks/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01e0765ee7fd1bc6c93713ca5e9af4a37c1fd2729264407aa23c1bfacb73ad46
|
4
|
+
data.tar.gz: 2448c5c778bcd8ba36217baeae48ef5133acea3772877487e9ea32eaeb46d99f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd8b521bb79112e43c416c794a27a8b97f4c4b7c8248fe21332171229fae066d9b48c7ecbbbac94b35334c9312f2e2503d28e55c0a14112092066f1924a5462
|
7
|
+
data.tar.gz: 56d5b178d51475ace8a780385bffb43825b2fec57837ddd7d66ca17b35e44b8e34315d0fb50924c46e7df1d3d59856f80763503ae76827abb828ec412d1e4a64
|
data/lib/jekyll/static_file.rb
CHANGED
@@ -6,12 +6,26 @@ module Jekyll
|
|
6
6
|
# the file
|
7
7
|
def write(dest)
|
8
8
|
dest_path = destination(dest)
|
9
|
-
|
9
|
+
|
10
|
+
# If the file exists but it's not a hardlink, we remove it and
|
11
|
+
# replace it with one. This is useful when migrating from a site
|
12
|
+
# already built without this plugin.
|
13
|
+
if File.exist? dest_path
|
14
|
+
return if hardlink? dest_path
|
15
|
+
FileUtils.rm dest_path
|
16
|
+
end
|
10
17
|
|
11
18
|
self.class.mtimes[path] = mtime
|
12
19
|
|
13
20
|
FileUtils.mkdir_p(File.dirname(dest_path))
|
14
21
|
FileUtils.ln(path, dest_path)
|
15
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# Verifies the path has hardlinks
|
27
|
+
def hardlink?(path)
|
28
|
+
File.stat(path).nlink > 1
|
29
|
+
end
|
16
30
|
end
|
17
31
|
end
|
metadata
CHANGED
@@ -1,89 +1,75 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-hardlinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: jekyll
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
19
|
+
version: '4'
|
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: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
26
|
+
version: '4'
|
41
27
|
description: Jekyll copies static files and duplicates storage use. Hard links point
|
42
28
|
to the same file instead of making copies, thus saving storage.
|
43
29
|
email:
|
44
30
|
- f@sutty.nl
|
45
31
|
executables: []
|
46
32
|
extensions: []
|
47
|
-
extra_rdoc_files:
|
33
|
+
extra_rdoc_files:
|
34
|
+
- README.md
|
35
|
+
- LICENSE.txt
|
48
36
|
files:
|
49
|
-
- ".gitignore"
|
50
|
-
- ".travis.yml"
|
51
|
-
- CODE_OF_CONDUCT.md
|
52
|
-
- Gemfile
|
53
37
|
- LICENSE.txt
|
54
38
|
- README.md
|
55
|
-
- Rakefile
|
56
|
-
- bin/console
|
57
|
-
- bin/setup
|
58
|
-
- jekyll-hardlinks.gemspec
|
59
39
|
- lib/jekyll-hardlinks.rb
|
60
|
-
- lib/jekyll/hardlinks/version.rb
|
61
40
|
- lib/jekyll/static_file.rb
|
62
41
|
homepage: https://0xacab.org/sutty/jekyll/jekyll-hardlinks
|
63
42
|
licenses:
|
64
43
|
- GPL-3.0
|
65
44
|
metadata:
|
66
|
-
|
45
|
+
bug_tracker_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks/issues
|
67
46
|
homepage_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks
|
68
47
|
source_code_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks
|
69
|
-
changelog_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks
|
48
|
+
changelog_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks/-/blob/master/CHANGELOG.md
|
49
|
+
documentation_uri: https://rubydoc.info/gems/jekyll-hardlinks
|
70
50
|
post_install_message:
|
71
|
-
rdoc_options:
|
51
|
+
rdoc_options:
|
52
|
+
- "--title"
|
53
|
+
- jekyll-hardlinks - Saves space by using hard links for static files
|
54
|
+
- "--main"
|
55
|
+
- README.md
|
56
|
+
- "--line-numbers"
|
57
|
+
- "--inline-source"
|
58
|
+
- "--quiet"
|
72
59
|
require_paths:
|
73
60
|
- lib
|
74
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
62
|
requirements:
|
76
|
-
- - "
|
63
|
+
- - "~>"
|
77
64
|
- !ruby/object:Gem::Version
|
78
|
-
version: '
|
65
|
+
version: '2'
|
79
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
67
|
requirements:
|
81
68
|
- - ">="
|
82
69
|
- !ruby/object:Gem::Version
|
83
70
|
version: '0'
|
84
71
|
requirements: []
|
85
|
-
|
86
|
-
rubygems_version: 2.7.6.2
|
72
|
+
rubygems_version: 3.0.3
|
87
73
|
signing_key:
|
88
74
|
specification_version: 4
|
89
75
|
summary: Saves space by using hard links for static files
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "jekyll/hardlinks"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/jekyll-hardlinks.gemspec
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
lib = File.expand_path('lib', __dir__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'jekyll/hardlinks/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'jekyll-hardlinks'
|
7
|
-
spec.version = Jekyll::Hardlinks::VERSION
|
8
|
-
spec.authors = ['f']
|
9
|
-
spec.email = ['f@sutty.nl']
|
10
|
-
|
11
|
-
spec.summary = 'Saves space by using hard links for static files'
|
12
|
-
spec.description = 'Jekyll copies static files and duplicates storage use. Hard links point to the same file instead of making copies, thus saving storage.'
|
13
|
-
spec.homepage = 'https://0xacab.org/sutty/jekyll/jekyll-hardlinks'
|
14
|
-
spec.license = 'GPL-3.0'
|
15
|
-
|
16
|
-
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
17
|
-
|
18
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
-
spec.metadata['source_code_uri'] = spec.homepage
|
20
|
-
spec.metadata['changelog_uri'] = spec.homepage
|
21
|
-
|
22
|
-
# Specify which files should be added to the gem when it is released.
|
23
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
25
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
-
end
|
27
|
-
spec.bindir = 'exe'
|
28
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
-
spec.require_paths = ['lib']
|
30
|
-
|
31
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
32
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
33
|
-
end
|