Class: XCCache::S3Storage
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ S3Storage
constructor
A new instance of S3Storage.
- #pull ⇒ Object
- #push ⇒ Object
Methods included from Config::Mixin
Constructor Details
#initialize(options = {}) ⇒ S3Storage
5 6 7 8 9 10 11 12 |
# File 'lib/xccache/storage/s3.rb', line 5 def initialize( = {}) super @uri = [:uri] @creds_path = Pathname([:creds_path] || "~/.xccache/s3.creds.json"). creds = JSONRepresentable.new(@creds_path) @access_key_id = creds["access_key_id"] @secret_access_key = creds["secret_access_key"] end |
Instance Method Details
#pull ⇒ Object
14 15 16 |
# File 'lib/xccache/storage/s3.rb', line 14 def pull s3_sync(src: @uri, dst: config.spm_cache_dir) end |
#push ⇒ Object
18 19 20 |
# File 'lib/xccache/storage/s3.rb', line 18 def push s3_sync(src: config.spm_cache_dir, dst: @uri) end |