Class: Jekyll::Gitlab::Letsencrypt::Configuration
- Inherits:
-
Object
- Object
- Jekyll::Gitlab::Letsencrypt::Configuration
- Defined in:
- lib/jekyll/gitlab/letsencrypt/configuration.rb
Constant Summary collapse
- DEFAULT_FILENAME =
'letsencrypt_challenge.html'- DEFAULT_ENDPOINT =
'https://acme-v01.api.letsencrypt.org/'- DEFAULT_BRANCH =
'master'- DEFAULT_LAYOUT =
'null'- DEFAULT_INITIAL_DELAY =
120- DEFAULT_DELAY_TIME =
15- DEFAULT_SCHEME =
'http'- DEFAULT_GITLAB_URL =
'https://gitlab.com'- REQUIRED_KEYS =
%w{gitlab_repo email domain}
Class Method Summary collapse
- .base_path ⇒ Object
- .branch ⇒ Object
- .delay_time ⇒ Object
- .domain ⇒ Object
- .email ⇒ Object
- .endpoint ⇒ Object
- .filename ⇒ Object
- .gitlab_repo ⇒ Object
- .gitlab_url ⇒ Object
- .initial_delay ⇒ Object
- .jekyll_config ⇒ Object
- .layout ⇒ Object
- .personal_access_token ⇒ Object
- .pretty_url? ⇒ Boolean
- .reset! ⇒ Object
- .scheme ⇒ Object
- .valid? ⇒ Boolean
Class Method Details
.base_path ⇒ Object
37 38 39 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 37 def base_path jekyll_config['base_path'] || '' end |
.branch ⇒ Object
61 62 63 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 61 def branch jekyll_config['branch'] || DEFAULT_BRANCH end |
.delay_time ⇒ Object
73 74 75 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 73 def delay_time jekyll_config['delay_time'] || DEFAULT_DELAY_TIME end |
.domain ⇒ Object
57 58 59 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 57 def domain jekyll_config['domain'] end |
.email ⇒ Object
53 54 55 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 53 def email jekyll_config['email'] end |
.endpoint ⇒ Object
25 26 27 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 25 def endpoint jekyll_config['endpoint'] || DEFAULT_ENDPOINT end |
.filename ⇒ Object
65 66 67 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 65 def filename jekyll_config['filename'] || DEFAULT_FILENAME end |
.gitlab_repo ⇒ Object
33 34 35 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 33 def gitlab_repo jekyll_config['gitlab_repo'] end |
.gitlab_url ⇒ Object
29 30 31 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 29 def gitlab_url jekyll_config['gitlab_url'] || DEFAULT_GITLAB_URL end |
.initial_delay ⇒ Object
69 70 71 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 69 def initial_delay jekyll_config['initial_delay'] || DEFAULT_INITIAL_DELAY end |
.jekyll_config ⇒ Object
85 86 87 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 85 def jekyll_config @jekyll_config ||= (Jekyll.configuration({})['gitlab-letsencrypt'] || {}) end |
.layout ⇒ Object
45 46 47 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 45 def layout jekyll_config['layout'] || DEFAULT_LAYOUT end |
.personal_access_token ⇒ Object
49 50 51 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 49 def personal_access_token jekyll_config['personal_access_token'].presence || ENV['GITLAB_TOKEN'].presence end |
.pretty_url? ⇒ Boolean
41 42 43 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 41 def pretty_url? !!jekyll_config['pretty_url'] end |
.reset! ⇒ Object
81 82 83 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 81 def reset! @jekyll_config = nil end |
.scheme ⇒ Object
77 78 79 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 77 def scheme jekyll_config['scheme'] || DEFAULT_SCHEME end |
.valid? ⇒ Boolean
21 22 23 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 21 def valid? REQUIRED_KEYS.all? { |key| jekyll_config.has_key? key } && personal_access_token end |