Permalink
Browse files

Remove Wiki::language, it's unneeded

Add wpen, wpde & wpfr to mediawikirc.sample


git-svn-id: svn://78.47.249.61/ruby-mediawiki/trunk@71 ba9c31aa-a806-0410-9a81-9f13d15ee83b
  • Loading branch information...
astro
astro committed Oct 23, 2007
1 parent f119dae commit 24d958df7c7220a2a199c0c12688a9fe7bf904c4
Showing with 12 additions and 17 deletions.
  1. +4 −9 lib/mediawiki.rb
  2. +1 −7 lib/mediawiki/article.rb
  3. +7 −1 mediawikirc.sample
View
@@ -29,6 +29,9 @@ def self.logger
require 'mediawiki/minibrowser'
module MediaWiki
+ ##
+ # There's no need for any language attribute, the "Special:" prefix
+ # works in any MediaWiki, regardless of localization settings.
class Wiki
##
# The MiniBrowser instance used by this Wiki.
@@ -41,20 +44,13 @@ class Wiki
# to Wiki#initialize
attr_reader :url
-
- ##
- # The language of the wiki (used for special pages)
- # Supported: "fr", "de"
- # Default: "de"
- attr_accessor :language
-
##
# Initialize a new Wiki instance.
# url:: [String] URL-Path to index.php (without index.php), may containt <tt>user:password</tt> combination.
# user:: [String] If not nil, log in with that MediaWiki username (see Wiki#login)
# password:: [String] If not nil, log in with that MediaWiki password (see Wiki#login)
# loglevel:: [Integer] Loglevel, default is to log all messages >= Logger::WARN = 2
- def initialize(url, user = nil, password = nil, loglevel = Logger::WARN, language = "de")
+ def initialize(url, user = nil, password = nil, loglevel = Logger::WARN)
if ENV['MEDIAWIKI_DEBUG']
MediaWiki::logger.level = Logger::DEBUG
else
@@ -63,7 +59,6 @@ def initialize(url, user = nil, password = nil, loglevel = Logger::WARN, languag
@url = URI.parse( url.match(/\/$/) ? url : url + '/' )
@browser = MiniBrowser.new(@url)
- @language = language
login( user, password ) if user and password
end
View
@@ -199,13 +199,7 @@ def unprotect(reason)
##
# "what links here" url for this article
def what_links_here_url(count = nil)
- case @wiki.language
- when "de"
- page = "Spezial:Whatlinkshere"
- else
- page = "Special:Whatlinkshere"
- end
- url = @wiki.article_url("#{page}/#{full_name}")
+ url = @wiki.article_url("Special:Whatlinkshere/#{full_name}")
url << "&limit=#{count}" if count
end
View
@@ -1,4 +1,10 @@
-default: c3d2
+default: wpen
+wpen:
+ url: http://en.wikipedia.org/w/
+wpde:
+ url: http://de.wikipedia.org/w/
+wpfr:
+ url: http://fr.wikipedia.org/w/
c3d2:
url: https://eris:...@wiki.c3d2.de/
user: AstRobot

0 comments on commit 24d958d

Please sign in to comment.