Module: Drupid

Defined in:
lib/drupid/patch.rb,
lib/drupid/drush.rb,
lib/drupid/utils.rb,
lib/drupid/library.rb,
lib/drupid/project.rb,
lib/drupid/updater.rb,
lib/drupid/version.rb,
lib/drupid/makefile.rb,
lib/drupid/platform.rb,
lib/drupid/component.rb,
lib/drupid/project_version.rb,
lib/drupid/platform_project.rb,
lib/drupid/download_strategy.rb

Overview

Copyright © 2012-2013 Lifepillar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: DownloadStrategy, Drush, Utils Classes: Component, Library, Makefile, NotDrupalVersionError, ParseMakefileError, Patch, Platform, PlatformProject, Project, ProjectInfo, Updater, Version, VersionCore

Constant Summary collapse

VERSION =
'1.1.5'
USER_AGENT =
"Drupid #{VERSION} (Ruby #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}; #{RUBY_PLATFORM})"
@@cache_path =
Pathname.new(ENV['HOME']) + '.drupid_cache'

Class Method Summary collapse

Class Method Details

.cache_pathObject



31
32
33
# File 'lib/drupid/component.rb', line 31

def Drupid.cache_path
  @@cache_path
end

.cache_path=(new_path) ⇒ Object



35
36
37
38
# File 'lib/drupid/component.rb', line 35

def Drupid.cache_path=(new_path)
  raise "Invalid cache path" unless new_path.to_s =~ /cache/i
  @@cache_path = Pathname.new(new_path).realpath # must exist
end

.makeDownloader(uri, dest, name, download_specs = {}) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/drupid/download_strategy.rb', line 51

def self.makeDownloader uri, dest, name, download_specs = {}
  case download_specs[:type]
  when 'file'
    DownloadStrategy::Curl.new uri, dest, name, download_specs
  when 'git'
    DownloadStrategy::Git.new uri, dest, name, download_specs
  when 'svn'
    DownloadStrategy::Subversion.new uri, dest, name, download_specs
  when 'cvs'
    DownloadStrategy::CVS.new uri, dest, name, download_specs
  when 'bzr'
    DownloadStrategy::Bazaar.new uri, dest, name, download_specs
  else
    (DownloadStrategy.detect uri).new uri, dest, name, download_specs
  end
end