Class: BunBun::CLI::StorageCommand
- Defined in:
- lib/bunbun/cli/storage_command.rb
Direct Known Subclasses
StorageDelete, StorageDownload, StorageEdit, StorageFiles, StorageUpload
Instance Attribute Summary collapse
-
#storage_access_key ⇒ Object
Returns the value of attribute storage_access_key.
-
#storage_host ⇒ Object
Returns the value of attribute storage_host.
-
#storage_zone ⇒ Object
Returns the value of attribute storage_zone.
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
argument_count, argument_names, option, #option_parser, options
Instance Attribute Details
#storage_access_key ⇒ Object
Returns the value of attribute storage_access_key.
6 7 8 |
# File 'lib/bunbun/cli/storage_command.rb', line 6 def storage_access_key @storage_access_key end |
#storage_host ⇒ Object
Returns the value of attribute storage_host.
5 6 7 |
# File 'lib/bunbun/cli/storage_command.rb', line 5 def storage_host @storage_host end |
#storage_zone ⇒ Object
Returns the value of attribute storage_zone.
4 5 6 |
# File 'lib/bunbun/cli/storage_command.rb', line 4 def storage_zone @storage_zone end |
Instance Method Details
#call(path) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bunbun/cli/storage_command.rb', line 8 def call(path) unless path =~ /\A\/([\w\-]+)\// raise BunBun::CLI::Error, 'path must start with a zone name' end self.storage_zone = $1 self.storage_host = [:host] || 'storage.bunnycdn.com' self.storage_access_key = get_access_key(storage_host, storage_zone) @client = BunBun::Client.new(host: storage_host, access_key: storage_access_key) end |