Module: GollumRails::Core::ClassMethods

Defined in:
lib/gollum_rails/core.rb

Instance Method Summary collapse

Instance Method Details

#format_supported?(format) ⇒ Boolean

Checks if the fileformat is supported

format - String

Returns true or false

Returns:

  • (Boolean)


27
28
29
# File 'lib/gollum_rails/core.rb', line 27

def format_supported?(format)
  Gollum::Markup.formats.include?(format.to_sym)
end

#reset_folderObject

Resets the folder to /



32
33
34
# File 'lib/gollum_rails/core.rb', line 32

def reset_folder
  set_folder(nil)
end

#set_folder(options) ⇒ Object Also known as: folder=

Sets the folder



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/gollum_rails/core.rb', line 37

def set_folder(options)
  if options.is_a? Hash
    return if options.empty?
    base = options[:base]
    options = options[:folder]
  end
  Setup.wiki_options ||= {}
  Setup.wiki_options[:page_file_dir] = options

  Setup.wiki_options[:base_path] = (base || options) || ''
end