Module: VimGet
- Defined in:
- lib/vimget/output.rb,
lib/vimget.rb,
lib/vimget/db.rb,
lib/vimget/script.rb,
lib/vimget/command.rb,
lib/vimget/configure.rb,
lib/vimget/installer.rb,
lib/vimget/webparser.rb,
lib/vimget/exceptions.rb,
lib/vimget/command_manager.rb,
lib/vimget/commands/list_command.rb,
lib/vimget/commands/sync_command.rb,
lib/vimget/commands/clean_command.rb,
lib/vimget/commands/install_command.rb,
lib/vimget/commands/upgrade_command.rb,
lib/vimget/commands/outdated_command.rb,
lib/vimget/commands/installed_command.rb,
lib/vimget/commands/uninstall_command.rb
Overview
VimGet exceptions
Eddy Xu <[email protected]>
2008 © Quarkware.com
$Id: exceptions.rb 3 2008-04-02 20:47:49Z eddyxu $
Defined Under Namespace
Modules: Commands Classes: Application, BaseCommand, CommandLineError, CommandManager, Configure, Exception, InstallError, Installer, NetworkError, Output, PathDB, Script, UnknownScriptError
Class Method Summary collapse
- .application ⇒ Object
- .application=(app) ⇒ Object
- .configure ⇒ Object
- .db ⇒ Object
- .parse_script_page(sid) ⇒ Object
Class Method Details
.application ⇒ Object
21 22 23 |
# File 'lib/vimget.rb', line 21 def application @application ||= VimGet::Application.new end |
.application=(app) ⇒ Object
25 26 27 |
# File 'lib/vimget.rb', line 25 def application=(app) @application = app end |
.configure ⇒ Object
13 14 15 |
# File 'lib/vimget/configure.rb', line 13 def configure @configure ||= Configure.new end |
.parse_script_page(sid) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vimget/webparser.rb', line 12 def VimGet.parse_script_page(sid) url = "http://www.vim.org/scripts/script.php?script_id=#{sid}" puts "Fetching...#{url}..." doc = Hpricot(open(url)) name = (doc/'title').inner_html.split(" - ")[0] script = Script.new(sid, name) table = (doc/"//tr[@class='tableheader']")[0] top_row = table.next_sibling() if top_row ctns = top_row.containers() script.download = ctns[0].at('a').attributes['href'] script.version = ctns[1].at('b').inner_text script. = ctns[4].at('a').inner_text end return script end |