jekyll-write-and-commit-changes 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll/repository.rb +9 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b5a1bf8bf2edeaeb2d7f307e54c2cbb3793601fe14716a3d8ea25440e632caf
4
- data.tar.gz: 7598273782c9e6afea4d56e2959308b851d98fbfcbef39462ee2dca1cff322b9
3
+ metadata.gz: 4d11364244720840dee84dc75c1b3e0ff4df4d6dda09bbda344bc4b8249f1d05
4
+ data.tar.gz: 0d398ab0f33984e5f20c89114f35ed8ed4eb3b98e26ceb4773430093dfb71509
5
5
  SHA512:
6
- metadata.gz: 867d077d2b392de5722b3ffb3b3578a1368e0e3e270b850e7537909a4ea7254fb0a575bb8bd41c0402f9a7ec8bc81537ca3383b2ca2f023e485f6ae68aa20d55
7
- data.tar.gz: 12621d1d0dfd7a4f261d8f379491aaf7e7cab584b59aaac87f47bffb7ac48780f432da3dc4b6ec90ef14bbb91b7ccc4a2283376f5041d205a173e021752d778c
6
+ metadata.gz: 136a964da322f74fb36f42072accf4f1e2fa4b6a219819432dc7ffbb19e6c1d19dcc2990f26d0de3e8f817258d819e1c7fff2f886837e7aff6999d00ec3652c3
7
+ data.tar.gz: 29c48b360a49e1188ff2524ac10ba1aa67b7e3e4ace6b4f07c5f40a05c8468f4f10c96ba44e0545b0163f1d1ae88dd256737060d347b50162206ac993517a331
@@ -10,7 +10,7 @@ module Jekyll
10
10
  require 'rugged'
11
11
 
12
12
  @site = site
13
- @path = site.path
13
+ @path = site.source
14
14
  @git = Rugged::Repository.new(path)
15
15
  end
16
16
 
@@ -24,7 +24,7 @@ module Jekyll
24
24
  # @return [String] Commit hash
25
25
  def commit(message, author = jekyll_author)
26
26
  site.staged_files.each do |file|
27
- git.index.add(file)
27
+ git.index.add(real_path file)
28
28
  end
29
29
 
30
30
  git.index.write
@@ -39,5 +39,12 @@ module Jekyll
39
39
  def jekyll_author
40
40
  @jekyll_author ||= { name: 'Jekyll', email: 'jekyll@localhost', time: Time.now }
41
41
  end
42
+
43
+ private
44
+
45
+ # Find file's real path, relative to site.
46
+ def real_path(file)
47
+ Pathname.new(file).realpath.relative_path_from(path).to_s
48
+ end
42
49
  end
43
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-write-and-commit-changes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-12 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll