Class: JekyllAuth
- Inherits:
-
Object
show all
- Defined in:
- lib/jekyll-auth.rb,
lib/jekyll_auth/config.rb,
lib/jekyll_auth/helpers.rb,
lib/jekyll_auth/version.rb,
lib/jekyll_auth/commands.rb,
lib/jekyll_auth/auth_site.rb,
lib/jekyll_auth/jekyll_site.rb,
lib/jekyll_auth/config_error.rb
Defined Under Namespace
Modules: Helpers
Classes: AuthSite, Commands, ConfigError, JekyllSite
Constant Summary
collapse
- VERSION =
"2.1.1".freeze
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
14
15
16
|
# File 'lib/jekyll_auth/config.rb', line 14
def self.config
jekyll_config.fetch("jekyll_auth", {})
end
|
.config_file ⇒ Object
4
5
6
|
# File 'lib/jekyll_auth/config.rb', line 4
def self.config_file
File.join(Dir.pwd, "_config.yml")
end
|
.destination ⇒ Object
18
19
20
|
# File 'lib/jekyll_auth/config.rb', line 18
def self.destination
jekyll_config.fetch("destination", File.expand_path("_site", Dir.pwd))
end
|
.jekyll_config ⇒ Object
8
9
10
11
12
|
# File 'lib/jekyll_auth/config.rb', line 8
def self.jekyll_config
@config ||= YAML.safe_load_file(config_file)
rescue StandardError
{}
end
|
.ssl? ⇒ Boolean
27
28
29
|
# File 'lib/jekyll_auth/config.rb', line 27
def self.ssl?
!!config["ssl"]
end
|
.whitelist ⇒ Object
22
23
24
25
|
# File 'lib/jekyll_auth/config.rb', line 22
def self.whitelist
whitelist = config["whitelist"]
Regexp.new(whitelist.join("|")) unless whitelist.nil?
end
|