Class: Jekyll::Kroki::Config
- Inherits:
-
Object
- Object
- Jekyll::Kroki::Config
- Defined in:
- lib/jekyll/kroki/config.rb
Overview
Reads, validates, and exposes the jekyll-kroki configuration from the Jekyll site config.
Constant Summary collapse
- DEFAULT_KROKI_URL =
"https://kroki.io"- DEFAULT_HTTP_RETRIES =
3- DEFAULT_HTTP_TIMEOUT =
15- DEFAULT_MAX_CONCURRENT_DOCS =
8
Instance Attribute Summary collapse
-
#http_retries ⇒ Object
readonly
Returns the value of attribute http_retries.
-
#http_timeout ⇒ Object
readonly
Returns the value of attribute http_timeout.
-
#kroki_url ⇒ Object
readonly
Returns the value of attribute kroki_url.
-
#max_concurrent_docs ⇒ Object
readonly
Returns the value of attribute max_concurrent_docs.
Instance Method Summary collapse
-
#initialize(site_config) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(site_config) ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jekyll/kroki/config.rb', line 17 def initialize(site_config) kroki_config = site_config.fetch("kroki", {}) @kroki_url = parse_url(kroki_config) @http_retries = parse_integer(kroki_config, "http_retries", DEFAULT_HTTP_RETRIES, min: 0) @http_timeout = parse_integer(kroki_config, "http_timeout", DEFAULT_HTTP_TIMEOUT, min: 0) @max_concurrent_docs = parse_integer(kroki_config, "max_concurrent_docs", DEFAULT_MAX_CONCURRENT_DOCS, min: 1) freeze end |
Instance Attribute Details
#http_retries ⇒ Object (readonly)
Returns the value of attribute http_retries.
12 13 14 |
# File 'lib/jekyll/kroki/config.rb', line 12 def http_retries @http_retries end |
#http_timeout ⇒ Object (readonly)
Returns the value of attribute http_timeout.
12 13 14 |
# File 'lib/jekyll/kroki/config.rb', line 12 def http_timeout @http_timeout end |
#kroki_url ⇒ Object (readonly)
Returns the value of attribute kroki_url.
12 13 14 |
# File 'lib/jekyll/kroki/config.rb', line 12 def kroki_url @kroki_url end |
#max_concurrent_docs ⇒ Object (readonly)
Returns the value of attribute max_concurrent_docs.
12 13 14 |
# File 'lib/jekyll/kroki/config.rb', line 12 def max_concurrent_docs @max_concurrent_docs end |