Class: TerraspaceBundler::Mod::Fetcher
- Inherits:
-
Object
- Object
- TerraspaceBundler::Mod::Fetcher
- Defined in:
- lib/terraspace_bundler/mod/fetcher/base.rb,
lib/terraspace_bundler/mod/fetcher.rb,
lib/terraspace_bundler/mod/fetcher/s3.rb,
lib/terraspace_bundler/mod/fetcher/gcs.rb,
lib/terraspace_bundler/mod/fetcher/git.rb,
lib/terraspace_bundler/mod/fetcher/local.rb
Overview
Interface of subclasses should implement
run
switch_version(mod.sha)
sha
Defined Under Namespace
Classes: Base, Gcs, Git, Local, S3
Instance Method Summary collapse
-
#initialize(mod) ⇒ Fetcher
constructor
A new instance of Fetcher.
- #instance ⇒ Object
Constructor Details
#initialize(mod) ⇒ Fetcher
Returns a new instance of Fetcher.
8 9 10 |
# File 'lib/terraspace_bundler/mod/fetcher.rb', line 8 def initialize(mod) @mod = mod end |
Instance Method Details
#instance ⇒ Object
12 13 14 15 16 |
# File 'lib/terraspace_bundler/mod/fetcher.rb', line 12 def instance type = @mod.type == "registry" ? "git" : @mod.type klass = "TerraspaceBundler::Mod::Fetcher::#{type.camelize}".constantize klass.new(@mod) # IE: Local.new(@mod), Git.new(@mod), S3.new(@mod), etc end |