jekyll-github-metadata 2.0.0 → 2.0.1

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: 36d8bc2d3f2c09462d4b9f58e2b2b0b20b832a6f
4
- data.tar.gz: 8944c7a5339f8995dc0fc08a1f5c888dbda019de
3
+ metadata.gz: 2d8d2ce4921cd07e0f03e12cf2f8d954c5341c9f
4
+ data.tar.gz: 4daa57199bffc02ec016dab312dee3f821c1e2b7
5
5
  SHA512:
6
- metadata.gz: 1b08ec39f71edc7f798d33ba35a3695b2361092c0b55719e13e3f2bb05656d5a402a6c2e8cbde4187ba54d30b960aea39617153f546262575393bf08f3296af8
7
- data.tar.gz: cbf03c38175bd52c30104b763e34955295fe5c2f589b2b1fd1d4b89308e6601c880b192dd6805427247e98f7a682b23ff8be1636873456ea8be341e9e7316667
6
+ metadata.gz: b2ffe6ce3c2c7c9f0d095bd5871798eead7c5f0b1807d42868f35acdff72613f5829832f6fc81c11a3a3c1d4146c315f785fed9f5dd213735603edd3cf460edf
7
+ data.tar.gz: bc2cfcd61f6a865769843ba6c97f4fd16fd5dcd7300f5b429829ee038f4a92656a241aba40dafbfab2d60694a3f8934494f528541482fb0ac2ec7066d01e0391
@@ -72,15 +72,24 @@ module Jekyll
72
72
  end
73
73
  end
74
74
 
75
+ def git_exe_path
76
+ ENV["PATH"].to_s.split(File::PATH_SEPARATOR).map { |path| File.join(path, "git") }.find { |path| File.exist?(path) }
77
+ end
78
+
79
+ def git_remotes
80
+ return [] if git_exe_path.nil?
81
+ `#{git_exe_path} remote --verbose`.to_s.strip.split("\n")
82
+ end
83
+
75
84
  def git_remote_url
76
- `git remote --verbose`.split("\n").grep(%r{\Aorigin\t}).map do |remote|
85
+ git_remotes.grep(%r{\Aorigin\t}).map do |remote|
77
86
  remote.sub(/\Aorigin\t(.*) \([a-z]+\)/, "\\1")
78
87
  end.uniq.first || ""
79
88
  end
80
89
 
81
90
  def nwo_from_git_origin_remote
82
91
  return unless Jekyll.env == "development"
83
- matches = git_remote_url.match %r{github.com(:|/)([\w-]+)/([\w-]+)}
92
+ matches = git_remote_url.chomp(".git").match %r{github.com(:|/)([\w-]+)/([\w\.-]+)}
84
93
  matches[2..3].join("/") if matches
85
94
  end
86
95
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module GitHubMetadata
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
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: 2.0.0
4
+ version: 2.0.1
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-05-26 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit