Class: VRundler::VimScriptBundle
- Inherits:
-
Object
- Object
- VRundler::VimScriptBundle
- Includes:
- BasicBundle
- Defined in:
- lib/vrundler/vim_script_bundle.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#script_type ⇒ Object
readonly
Returns the value of attribute script_type.
Attributes included from BasicBundle
Instance Method Summary collapse
- #bundle_specific_unpack ⇒ Object
-
#initialize(name, type, id) ⇒ VimScriptBundle
constructor
A new instance of VimScriptBundle.
- #url ⇒ Object
Methods included from BasicBundle
#after_download, #delete_existing_folder, #dont_delete, #run_extra, #unpack
Constructor Details
#initialize(name, type, id) ⇒ VimScriptBundle
Returns a new instance of VimScriptBundle.
9 10 11 12 13 |
# File 'lib/vrundler/vim_script_bundle.rb', line 9 def initialize(name, type, id) @name = name @script_type = type @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/vrundler/vim_script_bundle.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vrundler/vim_script_bundle.rb', line 5 def name @name end |
#script_type ⇒ Object (readonly)
Returns the value of attribute script_type.
5 6 7 |
# File 'lib/vrundler/vim_script_bundle.rb', line 5 def script_type @script_type end |
Instance Method Details
#bundle_specific_unpack ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vrundler/vim_script_bundle.rb', line 15 def bundle_specific_unpack puts " Downloading script: [#{name}]" local_file = File.join(name, script_type, "#{name}.vim") FileUtils.mkdir_p(File.dirname(local_file)) File.open(local_file, "w") do |file| file << open(url).read end end |
#url ⇒ Object
27 28 29 |
# File 'lib/vrundler/vim_script_bundle.rb', line 27 def url "http://www.vim.org/scripts/download_script.php?scr_id=#{self.id}" end |