Class: Ccs::Commands::Copy
- Inherits:
-
Object
- Object
- Ccs::Commands::Copy
- Defined in:
- lib/ccs/commands/copy.rb
Overview
The copy command, responsible for copying a target to a destination, performing encryption and decryption as necessary.
The target and destinations can be:
-
STDIN/STDOUT: a ‘-` sign is interpreted as these standard streams
-
The Occson server: strings beginning with ‘ccs://` or `http(s)://` are interpreted as such
-
local files: everything not matching the previous descriptions is assumed to be a path on the local system
Instance Method Summary collapse
-
#call ⇒ Object
Performs a transfer between locations - an upload if ‘@source` is local or STDIN, a download if `@source` is an URI.
-
#initialize(source, destination, access_token, passphrase, force: false) ⇒ Copy
constructor
Builds an instance of the Copy command.
Constructor Details
#initialize(source, destination, access_token, passphrase, force: false) ⇒ Copy
Builds an instance of the Copy command.
24 25 26 27 28 29 30 |
# File 'lib/ccs/commands/copy.rb', line 24 def initialize(source, destination, access_token, passphrase, force: false) @source = source @destination = destination @access_token = access_token @passphrase = passphrase @force = force end |
Instance Method Details
#call ⇒ Object
Performs a transfer between locations - an upload if ‘@source` is local or STDIN, a download if `@source` is an URI.
No guarantees are made about the return values of this method.
36 37 38 |
# File 'lib/ccs/commands/copy.rb', line 36 def call download? ? download : upload end |