jekyll-git-authors 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: 962f274c866f991682c026c110fce361df5fbb1a138a41ba469ac7be6efc580d
4
- data.tar.gz: 8554f452c67fb539b3c02ce4e2ff0193c7518950176c2258d95c34bc97b7d412
3
+ metadata.gz: 56f16a9833a6d2c0ea29b3af6e0ede1455154b8d0e8216018c68f058e37d10a4
4
+ data.tar.gz: 5e069b91a4fc9179d3b6b7b0f3aee15ab72a23365e2c2a07b340ff6b57fcc2d3
5
5
  SHA512:
6
- metadata.gz: f41aa87099c2b994b1cf66a57fd15a1716c21f72e434611494b7b2cca3fb5786b3844c65e2c8cb111806c8f5a36d6edc9f22d01296f32326d5052651159ea7dd
7
- data.tar.gz: 8b1d6dfab838638a2e2f7fc455684fb72e92c203a067fe61d864d6f669915a81ec575254c6afc6cac44430b7b8011978f48a07ef546b356f1a328f7e6f5ada0b
6
+ metadata.gz: 6db8590b31df33735fb64dcb05679c555f153e9f33017b6a7ae76dc843e923a0f1ab4f46d8dff2d8526ac894da9506abe5aa71f8aee074a1e1e39ed72cd8ff16
7
+ data.tar.gz: 8c179ba6c81ab872ab7660a8f7e1c0b063e8c211f115e947a96136af406d6bbd12c73412ea29665eb2c6def510fb1f3f3e0dbddb86c88f84189add4488f1877d
data/README.md CHANGED
@@ -5,7 +5,7 @@ Be sure to also have [jekyll-email-protect](https://github.com/vwochnik/jekyll-e
5
5
 
6
6
  ## Installation
7
7
 
8
- This plugin is available as a [rubygem]().
8
+ This plugin is available as a [rubygem](https://rubygems.org/gems/jekyll-git-authors).
9
9
 
10
10
  Add this line to your application's `Gemfile`:
11
11
 
@@ -72,7 +72,7 @@ module Git
72
72
  # Create instance of Git::Submodules and execute expected command.
73
73
  # We receive array of absolute paths of all submodules
74
74
  def self.submodules
75
- Submodules.new(execute('submodule foreach --recursive pwd'))
75
+ Submodules.new(execute('submodule foreach pwd'))
76
76
  end
77
77
 
78
78
  # Create instance of Git::Log and pass it output from git log command
@@ -104,31 +104,43 @@ module Jekyll
104
104
  def generate(site)
105
105
  puts "\nGenerating authors"
106
106
 
107
- repositories = Git.submodules
107
+ repositories = Git.submodules.extract_path
108
108
 
109
109
  # For each submodule we go into directory of that submodule
110
+ # delete the submodule dir from page path
110
111
  # before executing Git#log, then go back where we were.
111
112
  site.pages.each do |page|
112
- if page.path =~ /\.md/
113
+ file = page.path
114
+ if file =~ /\.md/
113
115
  repositories.each do |repository|
114
- original_dir = Dir.pwd
115
- Dir.chdir repository
116
- p "Going into #{repository}"
116
+ if file =~ /^#{repository}/
117
+ original_dir = Dir.pwd
118
+ Dir.chdir repository
117
119
 
118
- author_md = Git.log(file).author_email
119
- author_md = author_md.sort
120
- author_md = author_md.map { |a, e| Markdown.mailto(a, e) }
120
+ file.sub!(repository, '.')
121
121
 
122
- output = author_md.join ', '
123
- output = "Authors: #{output}"
124
- output = Markdown.center output
122
+ author_md = Git.log(file).author_email
123
+ author_md = author_md.sort
124
+ author_md = author_md.map { |a, e| Markdown.mailto(a, e) }
125
125
 
126
- page.content += output
126
+ output = author_md.join ', '
127
+ output = "Authors: #{output}"
128
+ output = Markdown.center output
127
129
 
128
- p "Adding Authors into #{page.path}"
130
+ page.content += output
129
131
 
130
- Dir.chdir original_dir
131
- p "Going back to #{original_dir}"
132
+ Dir.chdir original_dir
133
+ else
134
+ author_md = Git.log(file).author_email
135
+ author_md = author_md.sort
136
+ author_md = author_md.map { |a, e| Markdown.mailto(a, e) }
137
+
138
+ output = author_md.join ', '
139
+ output = "Authors: #{output}"
140
+ output = Markdown.center output
141
+
142
+ page.content += output
143
+ end
132
144
  end
133
145
  end
134
146
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllGitAuthors
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-git-authors
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
  - jackorp