Permalink
Browse files

MediaWiki::Wiki#logger entfernt

MediaWiki::Wiki#namespace_ids hinzugefügt


git-svn-id: svn://78.47.249.61/ruby-mediawiki/trunk@63 ba9c31aa-a806-0410-9a81-9f13d15ee83b
  • Loading branch information...
1 parent c6768b0 commit daea1af5c19caf9887730b1914a74f05291c08c7 astro committed Jun 10, 2006
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/mediawiki.rb
View
@@ -37,10 +37,6 @@ class Wiki
attr_reader :browser
##
- # The Logger used by this Wiki.
- attr_reader :logger
-
- ##
# 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)
@@ -95,6 +91,17 @@ def article(name, section = nil)
end
##
+ # Retrieve all namespaces and their IDs, which could be used for Wiki#allpages
+ # result:: [Hash] String => Fixnum
+ def namespace_ids
+ ids = {}
+ SpecialPage.new( self, 'Special:Allpages', nil, false ).xhtml.each_element('//select[@name=\'namespace\']/option') do | o |
+ ids[o.text] = o.attributes['value'].to_i
+ end
+ ids
+ end
+
+ ##
# Returns the pages listed on "Special:Allpages"
# result:: [Array] of [String] Articlenames
def allpages()

0 comments on commit daea1af

Please sign in to comment.