Comments (8)
I don't know. We should figure that our probably.
from mediawiki-butt-ruby.
Branch: extension
from mediawiki-butt-ruby.
@xbony2 We should finish up the two extensions we started supporting, because I'd really like to be able to interact with the new Tilesheets API and the upcoming OreDict API.
from mediawiki-butt-ruby.
@elifoster I don't think we really have to finish this for 2.0.0. We're both waiting on 2.0.0 features that aren't this, and doing this will probably take a long time.
from mediawiki-butt-ruby.
Yeah I've been thinking this too. It won't break any existing things to add this feature so it should be fine as 2.1 or whatever.
from mediawiki-butt-ruby.
Just thought of a nice way to automatically handle the loading of extension modules
in initialize
:
# ...
get_all_extensions.each do |extension_name|
include MediaWiki::Extensions::Object.const_get(extension_name.delete(' '))
end
# ...
or something along those lines.
from mediawiki-butt-ruby.
@xbony2 For how to enable modules, what do you think about
# lib/mediawiki/butt.rb
module MediaWiki
class Butt
...
def enable_extension(ext_module)
if ext_module.include?(MediaWiki::Extensions::ExtensionModule)
extend(ext_module)
else
raise NotAnExtensionModuleError.new(ext_module)
end
end
end
end
# lib/mediawiki/extensions/extension_module.rb
module MediaWiki
module Extensions
class ExtensionModule
end
end
end
# lib/mediawiki/extensions/oredict.rb
require_relative 'extension_module'
module MediaWiki
module Extensions
module OreDict
include MediaWiki::Extensions::ExtensionModule
def get_oredict_whatever_stub; end
end
end
end
# script.rb
require 'mediawiki/butt'
require 'mediawiki/extensions/oredict'
@mw = MediaWiki::Butt.new(...)
@mw.enable_extension(MediaWiki::Extensions::OreDict)
@mw.get_oredict_whatever_stub
from mediawiki-butt-ruby.
Seems fine to me
from mediawiki-butt-ruby.
Related Issues (20)
- query functional methods do not handle errors HOT 1
- get_category_members should pass limit last
- `move` redirect param is reversed
- NoMethodError in get_contrib_count HOT 1
- Methods with specified hash arguments have annoying behavior
- NoMethodError in get_templates_in_page for pages without templates
- Make `use_continuation: true` and `assertion: :bot`the default HOT 4
- Export/import API support HOT 3
- Allowing different formats HOT 2
- MW 1.28 / 1.29 support HOT 1
- Change defaults for initialize
- Removal of unnecessary post params
- Logout does not work.
- MW 1.31 Support HOT 1
- MW 1.32 Support
- Remove custom limiting on continued queries HOT 1
- Support uploading local files
- Support protection API HOT 2
- MediaWiki::Utils.encode_url improvements HOT 1
- How do I get a category URL? (article URL too) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediawiki-butt-ruby.