jekyll-hardlinks 0.1.0 → 0.2.0
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/README.md +2 -2
 - data/lib/jekyll/static_file.rb +22 -2
 - metadata +26 -40
 - 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: 7504da2189fb3f8b93a566070c7050a6018499bd02e492bf67644bea4421b20d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7ed4d75490fdd602be7317ba49f894b667cb401f2d997266d3f162f23ccd2f07
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b6520877b559881e52c8c58389444fda1d9943545455f21d7b45df7f7e1c1ae0cef223ee49f295ee554c67777d31051066a9536dbaee104e078101732bc63803
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 10d0f22b7fd62d38695b846b114278a80598164a3571ae2c6c1072b9c21ee182eaba4eb93df387b910328b02bd536516c2b9c4034c2e7283c5d8cc764ed3817a
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -4,8 +4,8 @@ Jekyll copies static files and duplicates storage use. Hard links point 
     | 
|
| 
       4 
4 
     | 
    
         
             
            to the same file instead of making copies, thus saving storage.
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            **This plugin only works on file systems that support hard links.**  It
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            cross-filesystem hard links aren't possible.
         
     | 
| 
      
 7 
     | 
    
         
            +
            will fallback to copying files if you're generating the site in another
         
     | 
| 
      
 8 
     | 
    
         
            +
            filesystem, since cross-filesystem hard links aren't possible.
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
            ## Installation
         
     | 
| 
       11 
11 
     | 
    
         | 
    
        data/lib/jekyll/static_file.rb
    CHANGED
    
    | 
         @@ -6,12 +6,32 @@ 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, 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 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 23 
     | 
    
         
            +
                    FileUtils.ln(path, dest_path)
         
     | 
| 
      
 24 
     | 
    
         
            +
                  rescue Errno::EXDEV
         
     | 
| 
      
 25 
     | 
    
         
            +
                    Jekyll.logger.warn 'Jekyll::StaticFile', "Cross-device link found, copying to #{dest_path} instead"
         
     | 
| 
      
 26 
     | 
    
         
            +
                    copy_file(dest_path)
         
     | 
| 
      
 27 
     | 
    
         
            +
                  end
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                private
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                # Verifies the files are the same by checking their inode
         
     | 
| 
      
 33 
     | 
    
         
            +
                def hardlink?(dest_path, path)
         
     | 
| 
      
 34 
     | 
    
         
            +
                  File.stat(path).ino == File.stat(dest_path).ino
         
     | 
| 
       15 
35 
     | 
    
         
             
                end
         
     | 
| 
       16 
36 
     | 
    
         
             
              end
         
     | 
| 
       17 
37 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,90 +1,76 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: jekyll-hardlinks
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - f
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
       9 
     | 
    
         
            -
            bindir:  
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-04-30 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
         
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
      
 48 
     | 
    
         
            +
              changelog_uri: https://0xacab.org/sutty/jekyll/jekyll-hardlinks/-/blob/master/CHANGELOG.md
         
     | 
| 
      
 49 
     | 
    
         
            +
              documentation_uri: https://rubydoc.info/gems/jekyll-hardlinks
         
     | 
| 
      
 50 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
      
 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.6'
         
     | 
| 
       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 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
      
 72 
     | 
    
         
            +
            rubygems_version: 3.3.8
         
     | 
| 
      
 73 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       88 
74 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       89 
75 
     | 
    
         
             
            summary: Saves space by using hard links for static files
         
     | 
| 
       90 
76 
     | 
    
         
             
            test_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
         
     |