Class: Drupid::DownloadStrategy::Base
- Inherits:
-
Object
- Object
- Drupid::DownloadStrategy::Base
- Includes:
- Utils
- Defined in:
- lib/drupid/download_strategy.rb
Overview
- url
-
The URL to download from
- dest
-
The target directory for the download
- name
-
The name (without extension) to assign to the downloaded entity
- download_specs
-
A hash of optional download parameters.
Instance Attribute Summary collapse
-
#dest ⇒ Object
readonly
Returns the value of attribute dest.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#staged_path ⇒ Object
readonly
Returns the value of attribute staged_path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, dest, name, download_specs = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Utils
#blah, #bzr, #compare_paths, #curl, #cvs, #debug, #dont_debug, #git, #hg, #ignore_interrupts, #interactive_shell, #odie, #ofail, #ohai, #owarn, #runBabyRun, #svn, #tempdir, #uncompress, #which, #writeFile
Constructor Details
#initialize(url, dest, name, download_specs = {}) ⇒ Base
Returns a new instance of Base.
112 113 114 115 116 117 118 119 120 |
# File 'lib/drupid/download_strategy.rb', line 112 def initialize url, dest, name, download_specs = {} @url = url @dest = Pathname.new(dest). @name = name @specs = download_specs @staged_path = nil debug "#{self.class.to_s.split(/::/).last} downloader created for url=#{@url}, dest=#{@dest}, name=#{@name}" debug "Download specs: #{download_specs}" unless download_specs.empty? end |
Instance Attribute Details
#dest ⇒ Object (readonly)
Returns the value of attribute dest.
108 109 110 |
# File 'lib/drupid/download_strategy.rb', line 108 def dest @dest end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
109 110 111 |
# File 'lib/drupid/download_strategy.rb', line 109 def name @name end |
#staged_path ⇒ Object (readonly)
Returns the value of attribute staged_path.
110 111 112 |
# File 'lib/drupid/download_strategy.rb', line 110 def staged_path @staged_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
107 108 109 |
# File 'lib/drupid/download_strategy.rb', line 107 def url @url end |