jekyll-github-metadata 1.5.0 → 1.6.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: 323ce3849269a24abfb30fa8be2e699236878393
4
- data.tar.gz: 298e45c9450b1ee93659be47ae8622e6a8ed8b82
3
+ metadata.gz: 82921d733fd06cf58bc088ea389ac61b808dc337
4
+ data.tar.gz: 347dce2f5db40a742fb2816caf85f1dd9566ab6e
5
5
  SHA512:
6
- metadata.gz: 95524bb16bb191b15b642732fbbdf05800208685a3938d2d82f5fcf9d4c7afde3554f15c21340a42b849cb33c4f9451e01fc8fb5e07fac9099901c83e43de019
7
- data.tar.gz: b537a8aeef1bef49f97f41d48e0d9a6f22ffe69d5febe9b3abde43e7605891cf1247ad1484438b94ee7586a07b2bf70b7fec3579e0d32d266d1473e9dc87955a
6
+ metadata.gz: 08f87888788f65ef030886fc56992c32660e229867c3fe5682304d70051e082e22b645f14ddade9aacead1df3d379d75f0350ffb9c326c834a7e731c903c9c20
7
+ data.tar.gz: f9b45ba9424471c3f49ca1c02dbe93210560ecd23b1483a28f666ead1e56057dabdd60610625a8fe8351dcac282e46fbb13df5daf57156658ddc4c3c5ff6d7cd
@@ -58,7 +58,7 @@ module Jekyll
58
58
  clear_values!
59
59
 
60
60
  # Environment-Specific
61
- register_value('environment', proc { environment })
61
+ register_value('environment', proc { Pages.env })
62
62
  register_value('hostname', proc { Pages.github_hostname })
63
63
  register_value('pages_env', proc { Pages.env })
64
64
  register_value('pages_hostname', proc { Pages.pages_hostname })
@@ -63,25 +63,25 @@ module Jekyll
63
63
  def show_downloads?
64
64
  !!repo_info["has_downloads"]
65
65
  end
66
-
66
+
67
67
  def organization_repository?
68
68
  memoize_value :@is_organization_repository, Value.new(proc { |c| !!c.organization(owner) })
69
69
  end
70
-
70
+
71
71
  def owner_public_repositories
72
72
  memoize_value :@owner_public_repositories, Value.new(proc { |c| c.list_repos(owner, "type" => "public") })
73
73
  end
74
-
74
+
75
75
  def organization_public_members
76
76
  memoize_value :@organization_public_members, Value.new(proc { |c|
77
77
  c.organization_public_members(owner) if organization_repository?
78
78
  })
79
79
  end
80
-
80
+
81
81
  def contributors
82
82
  memoize_value :@contributors, Value.new(proc { |c| c.contributors(nwo) })
83
83
  end
84
-
84
+
85
85
  def releases
86
86
  memoize_value :@releases, Value.new(proc { |c| c.releases(nwo) })
87
87
  end
@@ -106,6 +106,16 @@ module Jekyll
106
106
  end
107
107
  end
108
108
 
109
+ def url_scheme
110
+ if domain.end_with?(".github.com".freeze)
111
+ "https".freeze
112
+ elsif cname
113
+ "http"
114
+ else
115
+ Pages.scheme
116
+ end
117
+ end
118
+
109
119
  def default_user_domain
110
120
  if github_repo?
111
121
  "#{owner}.#{Pages.github_hostname}".downcase
@@ -141,14 +151,14 @@ module Jekyll
141
151
  URI.join("#{Pages.github_url}/pages/", path).to_s
142
152
  end
143
153
  elsif cname || primary?
144
- "#{Pages.scheme}://#{domain}"
154
+ "#{url_scheme}://#{domain}"
145
155
  else
146
- URI.join("#{Pages.scheme}://#{domain}", name).to_s
156
+ URI.join("#{url_scheme}://#{domain}", name).to_s
147
157
  end
148
158
  end
149
159
 
150
160
  def cname
151
- memoize_value :@cname, Value.new(proc { |c|
161
+ memoize_value :@cname, Value.new(proc { |c|
152
162
  if Pages.custom_domains_enabled?
153
163
  (c.pages(nwo) || {'cname' => nil})['cname']
154
164
  end
@@ -167,9 +177,9 @@ module Jekyll
167
177
  user_domain
168
178
  end
169
179
  end
170
-
180
+
171
181
  private
172
-
182
+
173
183
  def memoize_value(var_name, value)
174
184
  return instance_variable_get(var_name) if instance_variable_defined?(var_name)
175
185
  instance_variable_set(var_name, value.render)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module GitHubMetadata
3
- VERSION = '1.5.0'
3
+ VERSION = '1.6.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.5.0
4
+ version: 1.6.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-02-29 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit