Class: Wiki2Go::ReadWriteWikiConfig

Inherits:
Config
  • Object
show all
Defined in:
lib/Wiki2Go/ReadWriteWikiConfig.rb

Overview

Base class for read/write wikis (authenticated users can write, everybody can read)

Instance Attribute Summary

Attributes inherited from Config

#allow_dynamic_pages, #amazon_affiliate, #blacklist_when_no_checksum, #blog_style, #checksum_required, #checksum_salt, #debug, #default_page, #default_web, #delete_spam, #editor, #generate_html, #group, #maximum_urls, #multi_wiki, #pages_in_recent_changes, #pages_in_rss, #port, #root_directory, #server, #site_admin, #site_directory, #subsite, #user

Instance Method Summary collapse

Methods inherited from Config

#accept_edit?, #accept_page?, #accept_user?, #add_processor, #banned_urls, #banned_users, #blacklist_user, #chonqed_urls, #close, #commit_to_repository, #default_wiki, #enable_dot_graphics, #enable_syntax_highlighting, #errorlog, #greylist, #instant_commit_to_repository, #log, #logfile, #logger, #preprocess, #redirect_to_html?, #save, #static_web, #storage, #update_from_repository, #use_repository

Constructor Details

#initialize(directory) ⇒ ReadWriteWikiConfig

Returns a new instance of ReadWriteWikiConfig.


10
11
12
13
# File 'lib/Wiki2Go/ReadWriteWikiConfig.rb', line 10

def initialize(directory)
  super(directory)
  @generate_html = true 
end

Instance Method Details

#editable?(web) ⇒ Boolean

Wiki is editable if user is authenticated

Returns:

  • (Boolean)

16
17
18
# File 'lib/Wiki2Go/ReadWriteWikiConfig.rb', line 16

def editable?(web)
  web.secure?
end

#redirect_url?(web, url) ⇒ Boolean

Never redirect URLs, we trust our authenticated writers

Returns:

  • (Boolean)

21
22
23
# File 'lib/Wiki2Go/ReadWriteWikiConfig.rb', line 21

def redirect_url?(web,url)
  false
end