Class: CarthageCache::Application
- Inherits:
-
Object
- Object
- CarthageCache::Application
- Defined in:
- lib/carthage_cache.rb
Constant Summary collapse
- CACHE_DIR_NAME =
"carthage_cache"
Instance Attribute Summary collapse
-
#archiver ⇒ Object
readonly
Returns the value of attribute archiver.
-
#configurator ⇒ Object
readonly
Returns the value of attribute configurator.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#terminal ⇒ Object
readonly
Returns the value of attribute terminal.
Instance Method Summary collapse
- #archive_exist? ⇒ Boolean
- #create_archive(force = false) ⇒ Object
-
#initialize(project_path, verbose, config) ⇒ Application
constructor
A new instance of Application.
- #install_archive ⇒ Object
Constructor Details
#initialize(project_path, verbose, config) ⇒ Application
24 25 26 27 28 29 30 |
# File 'lib/carthage_cache.rb', line 24 def initialize(project_path, verbose, config) @terminal = Terminal.new(verbose) @archiver = Archiver.new @configurator = Configurator.new(project_path) @repository = Repository.new(configurator.config[:bucket_name], configurator.config[:aws_s3_client_options]) @project = Project.new(project_path, CACHE_DIR_NAME, terminal) end |
Instance Attribute Details
#archiver ⇒ Object (readonly)
Returns the value of attribute archiver.
19 20 21 |
# File 'lib/carthage_cache.rb', line 19 def archiver @archiver end |
#configurator ⇒ Object (readonly)
Returns the value of attribute configurator.
22 23 24 |
# File 'lib/carthage_cache.rb', line 22 def configurator @configurator end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
21 22 23 |
# File 'lib/carthage_cache.rb', line 21 def project @project end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
20 21 22 |
# File 'lib/carthage_cache.rb', line 20 def repository @repository end |
#terminal ⇒ Object (readonly)
Returns the value of attribute terminal.
18 19 20 |
# File 'lib/carthage_cache.rb', line 18 def terminal @terminal end |
Instance Method Details
#archive_exist? ⇒ Boolean
32 33 34 |
# File 'lib/carthage_cache.rb', line 32 def archive_exist? repository.archive_exist?(project.archive_filename) end |
#create_archive(force = false) ⇒ Object
45 46 47 |
# File 'lib/carthage_cache.rb', line 45 def create_archive(force = false) archive_builder.build if force || !archive_exist? end |
#install_archive ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/carthage_cache.rb', line 36 def install_archive if archive_exist? archive_installer.install else terminal.puts "There is no cached archive for the current Cartfile.resolved file." exit 1 end end |