Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Allow specifing the desired wiki
Browse files Browse the repository at this point in the history
git-svn-id: svn://78.47.249.61/ruby-mediawiki/trunk@58 ba9c31aa-a806-0410-9a81-9f13d15ee83b
  • Loading branch information
neingeist committed Apr 8, 2006
1 parent bad4c8c commit 7a1d7fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/mediawiki/article.rb
Expand Up @@ -74,7 +74,7 @@ def xhtml_reload
# Reload Article#text,
# should be done by Article#initialize.
def reload
puts "Loading #{@wiki.article_url(full_name, @section)}&action=edit"
#puts "Loading #{@wiki.article_url(full_name, @section)}&action=edit"
parse @wiki.browser.get_content("#{@wiki.article_url(full_name, @section)}&action=edit")
end

Expand Down
8 changes: 4 additions & 4 deletions lib/mediawiki/dotfile.rb
Expand Up @@ -10,18 +10,18 @@ module MediaWiki
# MEDIAWIKI_RC or defaults to ~/.mediawikirc .
#
# A configured wiki can be chosen with the MEDIAWIKI_WIKI
# environment variable, or defaults to the wiki pointed
# by default.
# environment variable, by the option mywiki or defaults
# to the wiki pointed by default.
#
# A robot may set [myrealm] to retrieve a second result
# output: a section with this name in the current wiki's
# configuration file for configuration of specific robot
# tasks.
def MediaWiki.dotfile(myrealm=nil)
def MediaWiki.dotfile(myrealm=nil,mywiki=nil)
filename = ENV['MEDIAWIKI_RC'] || "#{ENV['HOME']}/.mediawikirc"
dotfile = YAML::load(File.new(filename))

wikiconf = dotfile[ENV['MEDIAWIKI_WIKI'] || dotfile['default']]
wikiconf = dotfile[mywiki] || dotfile[ENV['MEDIAWIKI_WIKI'] || dotfile['default']]
wiki = Wiki.new(wikiconf['url'], wikiconf['user'], wikiconf['password'])

if myrealm
Expand Down

0 comments on commit 7a1d7fb

Please sign in to comment.