reduced the number of warnings in unit tests (still very high though)

This commit is contained in:
Alexey Verkhovsky 2005-01-21 22:08:47 +00:00
parent 259a7028e3
commit befa8c91b2
3 changed files with 15 additions and 26 deletions

View file

@ -64,11 +64,11 @@ class URIChunk < Chunk::Abstract
end end
def self.pattern def URIChunk.pattern
INTERNET_URI_REGEXP INTERNET_URI_REGEXP
end 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) def self.apply_to(content)
content.gsub!( self.pattern ) do |matched_text| 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') LOCAL_URI_REGEXP = Regexp.new(TEXTILE_SYNTAX_PREFIX + LOCAL_URI, Regexp::EXTENDED, 'N')
end end
def self.pattern def LocalURIChunk.pattern
LOCAL_URI_REGEXP LOCAL_URI_REGEXP
end end

View file

@ -1,13 +1,9 @@
$: << File.dirname(__FILE__) + "../../libraries" require 'diff'
require 'wiki_content'
require "diff" require 'chunks/wiki'
require 'date'
require "wiki_content" require 'author'
require "chunks/wiki" require 'page'
require "date"
require "author"
require "page"
class Revision class Revision
attr_accessor :page, :number, :content, :created_at, :author attr_accessor :page, :number, :content, :created_at, :author
@ -17,11 +13,6 @@ class Revision
self.content = content self.content = content
end end
# Ensure that the wiki content is parsed when ever it is updated.
def content=(content)
@content = content
end
def created_on def created_on
Date.new(@created_at.year, @created_at.mon, @created_at.day) Date.new(@created_at.year, @created_at.mon, @created_at.day)
end end

View file

@ -5,12 +5,16 @@ require "wiki_words"
require "zip/zip" require "zip/zip"
class Web class Web
attr_accessor :pages, :name, :address, :password attr_accessor :name, :address, :password, :markup, :color, :safe_mode, :pages
attr_accessor :markup, :color, :safe_mode, :additional_style, :published, :brackets_only, :count_pages attr_accessor :additional_style, :published, :brackets_only, :count_pages
def initialize(name, address, password = nil) def initialize(name, address, password = nil)
@name, @address, @password, @safe_mode = name, address, password, false @name, @address, @password, @safe_mode = name, address, password, false
@pages = {} @pages = {}
# assign default values
@color = '008B26'
@markup = :textile
end end
def add_page(page) def add_page(page)
@ -69,12 +73,6 @@ class Web
def refresh_revisions def refresh_revisions
select.each { |page| page.revisions.each { |revision| revision.clear_display_cache } } select.each { |page| page.revisions.each { |revision| revision.clear_display_cache } }
end 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 private
# Returns an array of all the wiki words in any current revision # Returns an array of all the wiki words in any current revision