jekyll-github-metadata 2.9.4 → 2.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
- SHA1:
3
- metadata.gz: ef3543499922abbc5abd53b23c0adb1fb8374286
4
- data.tar.gz: bcfa24ec3833c456271b3fec85f2d221afb79dea
2
+ SHA256:
3
+ metadata.gz: 7bd19cc5c1797ac829abde53d1008003675fcabaf6d4e2370f76342faea43ee5
4
+ data.tar.gz: e2d6401feb3be9354eb7829b187e864aecce0c615e9f1f0f3e384888e8d1f382
5
5
  SHA512:
6
- metadata.gz: f44010f8c0794a577de8277656c9e0c990359e9b84aeedae95edba8acb01a9adc16a139a171fdf9abcea42b432cef21b03b74f5128c420b6ad65f3541ca95000
7
- data.tar.gz: 83c76bdf1226e68ae7394acd3383afe0f1ad183771a0e464d74ad099d7813fe7f7ded80431af065da30232f5b153e22ed864ce6629142f98c0a705c7b44ba856
6
+ metadata.gz: df04b9684967e06a748632a32ebaed6238e9e7102fc66709de61b834445cabcd0eeba12772fe0928101ffa108b00d028fdbf6bc3f69020713b96aea686ac38f7
7
+ data.tar.gz: a9b2d3f6cfb0bc2e620d7b4ffcd6da85db038425ba0649f8af06d058fe87079acb5efe8e3005c455e527c29b9de2f9ce0fc4cebf26deccd620eaff9fd245ece0
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "jekyll"
3
4
  require "octokit"
4
- require "liquid"
5
- require "logger"
6
5
 
7
- if defined?(Jekyll) && Jekyll.respond_to?(:env) && Jekyll.env == "development"
6
+ if Jekyll.env == "development"
8
7
  begin
9
8
  require "dotenv"
10
9
  Dotenv.load
@@ -14,12 +13,6 @@ if defined?(Jekyll) && Jekyll.respond_to?(:env) && Jekyll.env == "development"
14
13
  end
15
14
 
16
15
  module Jekyll
17
- unless const_defined? :Errors
18
- module Errors
19
- FatalException = Class.new(::RuntimeError) unless const_defined? :FatalException
20
- end
21
- end
22
-
23
16
  module GitHubMetadata
24
17
  autoload :Client, "jekyll-github-metadata/client"
25
18
  autoload :EditLinkTag, "jekyll-github-metadata/edit-link-tag"
@@ -47,15 +40,11 @@ module Jekyll
47
40
  end
48
41
 
49
42
  def environment
50
- Jekyll.respond_to?(:env) ? Jekyll.env : (Pages.env || "development")
43
+ Jekyll.env
51
44
  end
52
45
 
53
46
  def logger
54
- @logger ||= if Jekyll.respond_to?(:logger)
55
- Jekyll.logger
56
- else
57
- Logger.new($stdout)
58
- end
47
+ @logger ||= Jekyll.logger
59
48
  end
60
49
 
61
50
  def log(severity, message)
@@ -32,14 +32,14 @@ module Jekyll
32
32
  super.sort
33
33
  end
34
34
 
35
- def_delegator :"Jekyll::GitHubMetadata::Pages", :env, :environment
36
- def_delegator :"Jekyll::GitHubMetadata::Pages", :env, :pages_env
37
- def_delegator :"Jekyll::GitHubMetadata::Pages", :github_hostname, :hostname
38
- def_delegator :"Jekyll::GitHubMetadata::Pages", :pages_hostname, :pages_hostname
39
- def_delegator :"Jekyll::GitHubMetadata::Pages", :api_url, :api_url
40
- def_delegator :"Jekyll::GitHubMetadata::Pages", :help_url, :help_url
35
+ def_delegator Jekyll::GitHubMetadata::Pages, :env, :environment
36
+ def_delegator Jekyll::GitHubMetadata::Pages, :env, :pages_env
37
+ def_delegator Jekyll::GitHubMetadata::Pages, :github_hostname, :hostname
38
+ def_delegator Jekyll::GitHubMetadata::Pages, :pages_hostname, :pages_hostname
39
+ def_delegator Jekyll::GitHubMetadata::Pages, :api_url, :api_url
40
+ def_delegator Jekyll::GitHubMetadata::Pages, :help_url, :help_url
41
41
 
42
- private def_delegator :"Jekyll::GitHubMetadata", :repository
42
+ private def_delegator Jekyll::GitHubMetadata, :repository
43
43
 
44
44
  def_delegator :repository, :owner_public_repositories, :public_repositories
45
45
  def_delegator :repository, :organization_public_members, :organization_members
@@ -53,7 +53,7 @@ module Jekyll
53
53
  end
54
54
 
55
55
  def github_url
56
- if dotcom?
56
+ if dotcom? || github_hostname == "github.com"
57
57
  "https://github.com".freeze
58
58
  else
59
59
  "#{scheme}://#{github_hostname}"
@@ -45,16 +45,12 @@ module Jekyll
45
45
  repo if repo && repo.is_a?(String) && repo.include?("/")
46
46
  end
47
47
 
48
- def git_exe_path
49
- ENV["PATH"].to_s
50
- .split(File::PATH_SEPARATOR)
51
- .map { |path| File.join(path, "git") }
52
- .find { |path| File.exist?(path) }
53
- end
54
-
55
48
  def git_remotes
56
- return [] if git_exe_path.nil?
57
- `#{git_exe_path} remote --verbose`.to_s.strip.split("\n")
49
+ _process, output = Jekyll::Utils::Exec.run("git", "remote", "--verbose")
50
+ output.to_s.strip.split("\n")
51
+ rescue Errno::ENOENT => e
52
+ Jekyll.logger.warn "Not Installed:", e.message
53
+ []
58
54
  end
59
55
 
60
56
  def git_remote_url
@@ -65,9 +61,14 @@ module Jekyll
65
61
 
66
62
  def nwo_from_git_origin_remote
67
63
  return unless Jekyll.env == "development" || Jekyll.env == "test"
68
- matches = git_remote_url.chomp(".git").match %r!github.com(:|/)([\w-]+)/([\w\.-]+)!
64
+ matches = git_remote_url.chomp(".git").match github_remote_regex
69
65
  matches[2..3].join("/") if matches
70
66
  end
67
+
68
+ def github_remote_regex
69
+ github_host_regex = Regexp.escape(Jekyll::GitHubMetadata::Pages.github_hostname)
70
+ %r!#{github_host_regex}(:|/)([\w-]+)/([\w\.-]+)!
71
+ end
71
72
  end
72
73
  end
73
74
  end
@@ -6,8 +6,8 @@ module Jekyll
6
6
  class SiteGitHubMunger
7
7
  extend Forwardable
8
8
 
9
- def_delegators :"Jekyll::GitHubMetadata", :site
10
- private def_delegator :"Jekyll::GitHubMetadata", :repository
9
+ def_delegators Jekyll::GitHubMetadata, :site, :repository
10
+ private :repository
11
11
 
12
12
  def initialize(site)
13
13
  Jekyll::GitHubMetadata.site = site
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module GitHubMetadata
5
- VERSION = "2.9.4".freeze
5
+ VERSION = "2.10.0".freeze
6
6
  end
7
7
  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.9.4
4
+ version: 2.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: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2019-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.1'
19
+ version: '3.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.1'
26
+ version: '3.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: octokit
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,20 +100,34 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: pry
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: rubocop
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '0.51'
123
+ version: 0.57.2
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '0.51'
130
+ version: 0.57.2
117
131
  description:
118
132
  email:
119
133
  - parkrmoore@gmail.com
@@ -152,8 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
166
  - !ruby/object:Gem::Version
153
167
  version: '0'
154
168
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.6.11
169
+ rubygems_version: 3.0.1
157
170
  signing_key:
158
171
  specification_version: 4
159
172
  summary: The site.github namespace