Class: JekyllAuth
- Inherits:
-
Object
show all
- Defined in:
- lib/jekyll-auth.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 =
'1.0.0'
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/jekyll-auth.rb', line 28
def self.config
@config ||= begin
config = YAML.safe_load_file(config_file)
config["jekyll_auth"] || {}
rescue
{}
end
end
|
.config_file ⇒ Object
24
25
26
|
# File 'lib/jekyll-auth.rb', line 24
def self.config_file
File.join(Dir.pwd, "_config.yml")
end
|
.ssl? ⇒ Boolean
42
43
44
|
# File 'lib/jekyll-auth.rb', line 42
def self.ssl?
!!JekyllAuth::config["ssl"]
end
|
.whitelist ⇒ Object
37
38
39
40
|
# File 'lib/jekyll-auth.rb', line 37
def self.whitelist
whitelist = JekyllAuth::config["whitelist"]
Regexp.new(whitelist.join("|")) unless whitelist.nil?
end
|