Class: Duracloud::Commands::Sync

Inherits:
Command
  • Object
show all
Defined in:
lib/duracloud/commands/sync.rb

Instance Method Summary collapse

Methods inherited from Command

call, #cli

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/duracloud/commands/sync.rb', line 4

def call
  if infile
    File.open(infile, "rb") do |f|
      self.content_id ||= infile # XXX relativize to cwd?
      Duracloud::Content.create(space_id: space_id, store_id: store_id, content_id: content_id, md5: md5, body: f)
    end
  else
    Duracloud::Content.create(space_id: space_id, store_id: store_id, content_id: content_id, md5: md5, body: $stdin)
  end
end