jekyll-github-metadata 1.9.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7cd9c5e21b4f7ce1c90e3d4d3b6393ff009577e
4
- data.tar.gz: 0d448d3e06f022693dcae9f5718b48d8ca925a8b
3
+ metadata.gz: f3e72823f82c2827bf6da1ec2c3b0d18738afe58
4
+ data.tar.gz: fd512a9002386eeeaf838bb6126be9b6cd10dd89
5
5
  SHA512:
6
- metadata.gz: c8017113ef97129215d84632ec14a34dc5c22bd57454cabbec43e4b93de6dc0dbd8356d458b713094ec9b2f60f66dcaf7a85007aed50132e91627080633c2322
7
- data.tar.gz: 49500446912391b8a1299ca37e744051cac19eb53cd3e4ce8d1fb78c12dda4431dc4d32fc2079e1d11e3f52321acb0e5267e07192a19a8e6f6d21189f747b9e0
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."
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module GitHubMetadata
3
- VERSION = '1.9.0'
3
+ VERSION = '1.10.0'
4
4
  end
5
5
  end
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.9.0
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-16 00:00:00.000000000 Z
11
+ date: 2016-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit