Class: ClWiki::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cl_wiki/configuration.rb

Overview

noinspection RubyTooManyInstanceVariablesInspection

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Configuration

Returns a new instance of Configuration.



15
16
17
18
19
# File 'lib/cl_wiki/configuration.rb', line 15

def initialize(hash = {})
  default_hash.merge(hash).each do |k, v|
    instance_variable_set(:"@#{k}", v)
  end
end

Instance Attribute Details

#cssHrefObject

Returns the value of attribute cssHref.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def cssHref
  @cssHref
end

#custom_formatter_load_pathObject (readonly)

Returns the value of attribute custom_formatter_load_path.



13
14
15
# File 'lib/cl_wiki/configuration.rb', line 13

def custom_formatter_load_path
  @custom_formatter_load_path
end

#edit_colsObject

Returns the value of attribute edit_cols.



13
14
15
# File 'lib/cl_wiki/configuration.rb', line 13

def edit_cols
  @edit_cols
end

#edit_rowsObject

Returns the value of attribute edit_rows.



13
14
15
# File 'lib/cl_wiki/configuration.rb', line 13

def edit_rows
  @edit_rows
end

#editableObject

Returns the value of attribute editable.



13
14
15
# File 'lib/cl_wiki/configuration.rb', line 13

def editable
  @editable
end

#encryption_defaultObject

Returns the value of attribute encryption_default.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def encryption_default
  @encryption_default
end

#global_editsObject

Returns the value of attribute global_edits.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def global_edits
  @global_edits
end

#ownerObject

Returns the value of attribute owner.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def owner
  @owner
end

#page_update_formatObject

Returns the value of attribute page_update_format.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def page_update_format
  @page_update_format
end

#publishTagObject

Returns the value of attribute publishTag.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def publishTag
  @publishTag
end

#templateObject

Returns the value of attribute template.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def template
  @template
end

#url_prefixObject

Returns the value of attribute url_prefix.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def url_prefix
  @url_prefix
end

#use_authenticationObject

Returns the value of attribute use_authentication.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def use_authentication
  @use_authentication
end

#wiki_pathObject

Returns the value of attribute wiki_path.



10
11
12
# File 'lib/cl_wiki/configuration.rb', line 10

def wiki_path
  @wiki_path
end

Class Method Details

.load(filename = $defaultConfFile) ⇒ Object



58
59
60
# File 'lib/cl_wiki/configuration.rb', line 58

def self.load(filename = $defaultConfFile)
  $wiki_conf = self.new(YAML.safe_load(::File.open(filename)))
end

Instance Method Details

#default_hashObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cl_wiki/configuration.rb', line 21

def default_hash
  {
    url_prefix: '/',
    publishTag: nil,
    useIndexForPageExists: false,
    edit_rows: 25,
    edit_cols: 80,
    custom_formatter_load_path: [],
    use_authentication: false
  }
end

#override_access_log_indexObject



41
42
43
44
# File 'lib/cl_wiki/configuration.rb', line 41

def override_access_log_index
  @orig_access_log_index_value = @access_log_index
  @access_log_index = false
end

#restore_access_log_indexObject



46
47
48
# File 'lib/cl_wiki/configuration.rb', line 46

def restore_access_log_index
  @access_log_index = @orig_access_log_index_value if @orig_access_log_index_value
end