reduced the number of warnings in unit tests (still very high though)
This commit is contained in:
parent
259a7028e3
commit
befa8c91b2
3 changed files with 15 additions and 26 deletions
|
@ -64,11 +64,11 @@ class URIChunk < Chunk::Abstract
|
|||
|
||||
end
|
||||
|
||||
def self.pattern
|
||||
def URIChunk.pattern
|
||||
INTERNET_URI_REGEXP
|
||||
end
|
||||
|
||||
attr_reader :uri, :scheme, :user, :host, :port, :path, :query, :fragment, :link_text
|
||||
attr_reader :user, :host, :port, :path, :query, :fragment, :link_text
|
||||
|
||||
def self.apply_to(content)
|
||||
content.gsub!( self.pattern ) do |matched_text|
|
||||
|
@ -172,7 +172,7 @@ class LocalURIChunk < URIChunk
|
|||
LOCAL_URI_REGEXP = Regexp.new(TEXTILE_SYNTAX_PREFIX + LOCAL_URI, Regexp::EXTENDED, 'N')
|
||||
end
|
||||
|
||||
def self.pattern
|
||||
def LocalURIChunk.pattern
|
||||
LOCAL_URI_REGEXP
|
||||
end
|
||||
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
$: << File.dirname(__FILE__) + "../../libraries"
|
||||
|
||||
require "diff"
|
||||
|
||||
require "wiki_content"
|
||||
require "chunks/wiki"
|
||||
|
||||
require "date"
|
||||
require "author"
|
||||
require "page"
|
||||
require 'diff'
|
||||
require 'wiki_content'
|
||||
require 'chunks/wiki'
|
||||
require 'date'
|
||||
require 'author'
|
||||
require 'page'
|
||||
|
||||
class Revision
|
||||
attr_accessor :page, :number, :content, :created_at, :author
|
||||
|
@ -17,11 +13,6 @@ class Revision
|
|||
self.content = content
|
||||
end
|
||||
|
||||
# Ensure that the wiki content is parsed when ever it is updated.
|
||||
def content=(content)
|
||||
@content = content
|
||||
end
|
||||
|
||||
def created_on
|
||||
Date.new(@created_at.year, @created_at.mon, @created_at.day)
|
||||
end
|
||||
|
|
|
@ -5,12 +5,16 @@ require "wiki_words"
|
|||
require "zip/zip"
|
||||
|
||||
class Web
|
||||
attr_accessor :pages, :name, :address, :password
|
||||
attr_accessor :markup, :color, :safe_mode, :additional_style, :published, :brackets_only, :count_pages
|
||||
attr_accessor :name, :address, :password, :markup, :color, :safe_mode, :pages
|
||||
attr_accessor :additional_style, :published, :brackets_only, :count_pages
|
||||
|
||||
def initialize(name, address, password = nil)
|
||||
@name, @address, @password, @safe_mode = name, address, password, false
|
||||
@pages = {}
|
||||
|
||||
# assign default values
|
||||
@color = '008B26'
|
||||
@markup = :textile
|
||||
end
|
||||
|
||||
def add_page(page)
|
||||
|
@ -70,12 +74,6 @@ class Web
|
|||
select.each { |page| page.revisions.each { |revision| revision.clear_display_cache } }
|
||||
end
|
||||
|
||||
# Default values
|
||||
def markup() @markup || :textile end
|
||||
def color() @color || "008B26" end
|
||||
def brackets_only() @brackets_only || false end
|
||||
def count_pages() @count_pages || false end
|
||||
|
||||
private
|
||||
# Returns an array of all the wiki words in any current revision
|
||||
def wiki_words
|
||||
|
|
Loading…
Reference in a new issue