jekyll-github-metadata 1.9.0 → 1.10.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e72823f82c2827bf6da1ec2c3b0d18738afe58
|
4
|
+
data.tar.gz: fd512a9002386eeeaf838bb6126be9b6cd10dd89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd472d10371cb3226d7d49a6f557bc2ec551d0433e606dc4a54ce6ccb2659b5c74c7316f72897e3521b438bcc9079a39ec488bd1a771c7b44e0ca9822f1f815
|
7
|
+
data.tar.gz: 4312ed0311b7b1b2fcd686dee1419e547335d8d38452dc81011ca9c950ff816af462bedd20152c178daf4406d219dcdd910b0452743707bbd58c2fb4e628197e
|
@@ -2,7 +2,7 @@ module Jekyll
|
|
2
2
|
module GitHubMetadata
|
3
3
|
class GHPMetadataGenerator < Jekyll::Generator
|
4
4
|
safe true
|
5
|
-
|
5
|
+
|
6
6
|
def generate(site)
|
7
7
|
Jekyll.logger.debug "Generator:", "Calling GHPMetadataGenerator"
|
8
8
|
initialize_repo! nwo(site)
|
@@ -28,9 +28,22 @@ module Jekyll
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def git_remote_url
|
32
|
+
`git remote --verbose`.split("\n").grep(%r{\Aorigin\t}).map do |remote|
|
33
|
+
remote.sub(/\Aorigin\t(.*) \([a-z]+\)/, "\\1")
|
34
|
+
end.uniq.first
|
35
|
+
end
|
36
|
+
|
37
|
+
def git_nwo
|
38
|
+
return unless Jekyll.env == "development"
|
39
|
+
matches = git_remote_url.match %r{github.com(:|/)([\w-]+)/([\w-]+)}
|
40
|
+
matches[2..3].join("/") if matches
|
41
|
+
end
|
42
|
+
|
31
43
|
def nwo(site)
|
32
44
|
ENV['PAGES_REPO_NWO'] || \
|
33
45
|
site.config['repository'] || \
|
46
|
+
git_nwo || \
|
34
47
|
proc {
|
35
48
|
raise GitHubMetadata::NoRepositoryError, "No repo name found. "
|
36
49
|
"Specify using PAGES_REPO_NWO or 'repository' in your configuration."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-github-metadata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|