15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/mediawiki_cli/export.rb', line 15
def batch
pages = []
export ||= to_hash(options.file) if options.file
export ||= options
export.each { |key, value|
case key
when "categories", "namespaces"
pages.push invoke "mw:list:members", [], :categories => export["categories"],
:namespaces => export["namespaces"],
:wiki => parent_options.wiki,
:username => parent_options.username,
:password => parent_options.password,
:file => parent_options.file
when "pages"
pages.push export["pages"]
end
}
return output $mw.export(pages.flatten)
end
|