Class: Jekyll::GitHubMetadata::Pages
- Inherits:
-
Object
- Object
- Jekyll::GitHubMetadata::Pages
- Defined in:
- lib/jekyll-github-metadata/pages.rb
Constant Summary collapse
- DEFAULTS =
{ 'PAGES_ENV' => 'dotcom'.freeze, 'PAGES_API_URL' => 'https://api.github.com'.freeze, 'PAGES_HELP_URL' => 'https://help.github.com'.freeze, 'PAGES_GITHUB_HOSTNAME' => 'github.com'.freeze, 'PAGES_PAGES_HOSTNAME' => 'github.io'.freeze, 'SSL' => 'false'.freeze, 'SUBDOMAIN_ISOLATION' => 'false'.freeze }.freeze
Class Method Summary collapse
- .api_url ⇒ Object
- .custom_domains_enabled? ⇒ Boolean
- .dotcom? ⇒ Boolean
- .enterprise? ⇒ Boolean
- .env ⇒ Object
- .github_hostname ⇒ Object
- .github_url ⇒ Object
- .help_url ⇒ Object
- .pages_hostname ⇒ Object
- .scheme ⇒ Object
-
.ssl? ⇒ Boolean
Whether the GitHub instance supports HTTPS Note: this will be the same as how sites are served in Enterprise, but may be different from how sites are served on GitHub.com.
- .subdomain_isolation? ⇒ Boolean
- .test? ⇒ Boolean
Class Method Details
.api_url ⇒ Object
51 52 53 |
# File 'lib/jekyll-github-metadata/pages.rb', line 51 def api_url trim_last_slash env_var('PAGES_API_URL', ENV['API_URL']) end |
.custom_domains_enabled? ⇒ Boolean
35 36 37 |
# File 'lib/jekyll-github-metadata/pages.rb', line 35 def custom_domains_enabled? dotcom? || test? end |
.dotcom? ⇒ Boolean
32 |
# File 'lib/jekyll-github-metadata/pages.rb', line 32 def dotcom?; env == 'dotcom' end |
.enterprise? ⇒ Boolean
33 |
# File 'lib/jekyll-github-metadata/pages.rb', line 33 def enterprise?; env == 'enterprise' end |
.env ⇒ Object
39 40 41 |
# File 'lib/jekyll-github-metadata/pages.rb', line 39 def env env_var 'PAGES_ENV' end |
.github_hostname ⇒ Object
59 60 61 |
# File 'lib/jekyll-github-metadata/pages.rb', line 59 def github_hostname trim_last_slash env_var('PAGES_GITHUB_HOSTNAME', ENV['GITHUB_HOSTNAME']) end |
.github_url ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/jekyll-github-metadata/pages.rb', line 43 def github_url if dotcom? "https://github.com".freeze else "#{scheme}://#{github_hostname}" end end |
.help_url ⇒ Object
55 56 57 |
# File 'lib/jekyll-github-metadata/pages.rb', line 55 def help_url trim_last_slash env_var('PAGES_HELP_URL', ENV['HELP_URL']) end |
.pages_hostname ⇒ Object
63 64 65 |
# File 'lib/jekyll-github-metadata/pages.rb', line 63 def pages_hostname trim_last_slash env_var('PAGES_PAGES_HOSTNAME', ENV['PAGES_HOSTNAME']) end |
.scheme ⇒ Object
23 24 25 |
# File 'lib/jekyll-github-metadata/pages.rb', line 23 def scheme ssl? ? "https" : "http" end |
.ssl? ⇒ Boolean
Whether the GitHub instance supports HTTPS Note: this will be the same as how sites are served in Enterprise, but may be different from how sites are served on GitHub.com. See Repository#url_scheme
19 20 21 |
# File 'lib/jekyll-github-metadata/pages.rb', line 19 def ssl? env_var('SSL') == 'true' || test? end |
.subdomain_isolation? ⇒ Boolean
27 28 29 |
# File 'lib/jekyll-github-metadata/pages.rb', line 27 def subdomain_isolation? env_var('SUBDOMAIN_ISOLATION').eql? 'true' end |
.test? ⇒ Boolean
31 |
# File 'lib/jekyll-github-metadata/pages.rb', line 31 def test?; env == 'test' end |