Class: FPM::Cookery::SourceHandler
- Inherits:
-
Object
- Object
- FPM::Cookery::SourceHandler
- Extended by:
- Forwardable
- Defined in:
- lib/fpm/cookery/source_handler.rb,
lib/fpm/cookery/source_handler/hg.rb,
lib/fpm/cookery/source_handler/git.rb,
lib/fpm/cookery/source_handler/svn.rb,
lib/fpm/cookery/source_handler/curl.rb,
lib/fpm/cookery/source_handler/template.rb
Defined Under Namespace
Classes: Curl, Git, Hg, Svn, Template
Constant Summary collapse
- DEFAULT_HANDLER =
:curl
Instance Attribute Summary collapse
-
#source_url ⇒ Object
readonly
Returns the value of attribute source_url.
Instance Method Summary collapse
-
#initialize(source_url, options, cachedir, builddir) ⇒ SourceHandler
constructor
A new instance of SourceHandler.
Constructor Details
#initialize(source_url, options, cachedir, builddir) ⇒ SourceHandler
Returns a new instance of SourceHandler.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fpm/cookery/source_handler.rb', line 18 def initialize(source_url, , cachedir, builddir) # The reason for these checks is related to the test cases # Test cases for individual recipe attributes # are not setting spec before hand (due to delegation chain?) # Additionally, one test actually has options being sent as a String if ( .nil? || .class == String || .has_key?(:with) == false) @source_provider = DEFAULT_HANDLER else @source_provider = [:with] end @source_url = source_url @options = @cachedir = cachedir @builddir = builddir @handler = get_source_handler(@source_provider) end |
Instance Attribute Details
#source_url ⇒ Object (readonly)
Returns the value of attribute source_url.
16 17 18 |
# File 'lib/fpm/cookery/source_handler.rb', line 16 def source_url @source_url end |