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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a3161df29dbe2b1779f02516bd50f4e3d6ee73a18a31c59756c66de8fee0ff7
4
- data.tar.gz: d498293c91c9204f54ad0cc31d72a2c08061869241a69a2f787cd6fc5623bbff
3
+ metadata.gz: 01e0765ee7fd1bc6c93713ca5e9af4a37c1fd2729264407aa23c1bfacb73ad46
4
+ data.tar.gz: 2448c5c778bcd8ba36217baeae48ef5133acea3772877487e9ea32eaeb46d99f
5
5
  SHA512:
6
- metadata.gz: 1872658460aad0d47bf8bf76faef30ec7ef90dd6dbb17614c874492babdc2a7bbc1f48ff6a9ad98dc1590ee4952e7c1b3f08d2ecb0aa625670de57e5df69eab2
7
- data.tar.gz: 6ddeaae29b8d9cde8d8ba0a5ab6701927e9860c1b736d0f171397fd68f88a559e0c2b62b23add7ccb72d7df5bda3ade5f8dcf982c903f3339a3f8d92ebe6bb71
6
+ metadata.gz: dcd8b521bb79112e43c416c794a27a8b97f4c4b7c8248fe21332171229fae066d9b48c7ecbbbac94b35334c9312f2e2503d28e55c0a14112092066f1924a5462
7
+ data.tar.gz: 56d5b178d51475ace8a780385bffb43825b2fec57837ddd7d66ca17b35e44b8e34315d0fb50924c46e7df1d3d59856f80763503ae76827abb828ec412d1e4a64
@@ -6,12 +6,26 @@ module Jekyll
6
6
  # the file
7
7
  def write(dest)
8
8
  dest_path = destination(dest)
9
- return if File.exist? dest_path
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-01 00:00:00.000000000 Z
11
+ date: 2020-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
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: '2.0'
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
- allowed_push_host: https://rubygems.org
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: '0'
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
- rubyforge_project:
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
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.5
7
- before_install: gem install bundler -v 2.0.2
@@ -1,7 +0,0 @@
1
- # Códigos para compartir
2
-
3
- <https://sutty.nl/es/codigo-de-convivencia/>
4
-
5
- # Code of conduct
6
-
7
- <https://sutty.nl/en/code-of-conduct>
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in jekyll-hardlinks.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task :default => :test
@@ -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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -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
@@ -1,5 +0,0 @@
1
- module Jekyll
2
- module Hardlinks
3
- VERSION = "0.1.0"
4
- end
5
- end