Class: PF::QiniuCommand

Inherits:
CommandBase show all
Defined in:
lib/pf/cli/qiniu.rb

Constant Summary collapse

@@myself =
"qiniu"

Instance Method Summary collapse

Methods inherited from CommandBase

banner

Instance Method Details

#push(filepath, bucket = nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/pf/cli/qiniu.rb', line 13

def push(filepath, bucket=nil)
  qiniu = Profile.qiniu()
  if bucket.nil?
    bucket = qiniu.default_bucket
    if bucket.nil?
      puts "pass bucket name in command line, like 'pf qiniu push FILENAME BUCKET_NAME',"
      "or set default qiniu bucket using 'pf qiniu default bucket BUCKET_NAME' before push"
      return
    end
  end

   = qiniu.()

  if .nil?
    puts "You haven't add any qiniu accounts. Please add an qiniu account before push"
    return
  end

  action = Action.new()
  action.push(filepath, bucket)
end