Class: Drupid::Library
Instance Attribute Summary
Attributes inherited from Component
#download_specs, #download_type, #download_url, #ignore_paths, #local_path, #name, #overwrite
Instance Method Summary collapse
- #destination ⇒ Object
- #destination=(d) ⇒ Object
- #fetch ⇒ Object
-
#initialize(name) ⇒ Library
constructor
A new instance of Library.
-
#target_path ⇒ Object
Returns the relative path where this library should be installed within a platform.
Methods inherited from Component
#add_download_spec, #add_patch, #cached_location, #clear_patches, #clone, #directory_name, #directory_name=, #each_patch, #exist?, #extended_name, #file_level_compare_with, #get_patch, #has_patches?, #ignore_path, #patch, #patched?, #patched_location, #subdir, #subdir=, #to_s
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(name) ⇒ Library
Returns a new instance of Library.
26 27 28 29 30 |
# File 'lib/drupid/library.rb', line 26 def initialize name super self.download_type = 'file' # Default download type @destination = nil end |
Instance Method Details
#destination ⇒ Object
32 33 34 35 |
# File 'lib/drupid/library.rb', line 32 def destination return Pathname.new('libraries') unless @destination return Pathname.new(@destination) end |
#destination=(d) ⇒ Object
37 38 39 |
# File 'lib/drupid/library.rb', line 37 def destination=(d) @destination = d end |
#fetch ⇒ Object
47 48 49 50 51 |
# File 'lib/drupid/library.rb', line 47 def fetch debug "Cached location: #{cached_location}" dont_debug { cached_location.rmtree if cached_location.exist? } super end |
#target_path ⇒ Object
Returns the relative path where this library should be installed within a platform. This is ‘libraries/#name’ by default.
43 44 45 |
# File 'lib/drupid/library.rb', line 43 def target_path return destination + subdir + directory_name end |