baidupan 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # Baidupan
1
+ # Baidupan 反馈建议
2
+
3
+ http://ml-china.org/blog/21
2
4
 
3
5
  TODO: Write a gem description
4
6
 
data/baidupan.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Baidupan::VERSION
9
9
  spec.authors = ["AndyHu"]
10
10
  spec.email = ["meeasyhappy@gmail.com"]
11
- spec.description = %q{利用百度云盘接口, 实现文件备份功能}
11
+ spec.description = %q{利用百度云盘接口, 实现文件备份功能 如果您有建议请在这里留言: http://ml-china.org/blog/21}
12
12
  spec.summary = %q{文件上传和查看等功能}
13
13
  spec.homepage = "http://ml-china.org"
14
14
  spec.license = "MIT"
@@ -76,7 +76,7 @@ overwrite:表示覆盖同名文件;newcopy:表示生成文件副本并进
76
76
  say "total upload #{count} files"
77
77
  end
78
78
 
79
- desc 'download file [Remote path, Local path', 'download remote file to local, not support for download dir'
79
+ desc 'download file [Remote path, Local path', '下载单个文件 download remote file to local, not support for download dir'
80
80
  def download(rpath, lpath=nil)
81
81
  lpath = (lpath||rpath).dup
82
82
  res = Baidupan::FsCmd.download(rpath, lpath, options.dup)
@@ -101,7 +101,7 @@ overwrite:表示覆盖同名文件;newcopy:表示生成文件副本并进
101
101
  say Baidupan::FsCmd.url(rpath)
102
102
  end
103
103
 
104
- desc "thumbnail rpath", "获取缩略图"
104
+ desc "thumbnail rpath", "获取指定图片文件的缩略图。"
105
105
  option :quality, type: :numeric, desc: "缩略图的质量,默认为“100”,取值范围(0,100]", default: 100
106
106
  option :height, type: :numeric, desc: "指定缩略图的高度,取值范围为(0,1600]", default: 200
107
107
  option :width, type: :numeric, desc: "指定缩略图的宽度,取值范围为(0,1600]", default: 200
@@ -110,7 +110,7 @@ overwrite:表示覆盖同名文件;newcopy:表示生成文件副本并进
110
110
  say Baidupan::FsCmd.thumbnail(rpath, opts)
111
111
  end
112
112
 
113
- desc 'mkdir rpath', 'mkdir remote path, e.g. mkdir path/to/newdir'
113
+ desc 'mkdir rpath', '创建目录 mkdir remote path, e.g. mkdir path/to/newdir'
114
114
  def mkdir(rpath)
115
115
  print_item Baidupan::FsCmd.mkdir(rpath).body
116
116
  end
@@ -135,7 +135,7 @@ overwrite:表示覆盖同名文件;newcopy:表示生成文件副本并进
135
135
  end
136
136
  map cp: :copy
137
137
 
138
- desc 'delete rpath', 'delete a remote path'
138
+ desc 'delete rpath', '删除单个文件/目录 delete a remote path'
139
139
  option :force, type: :boolean, default: false
140
140
  def delete(rpath)
141
141
  if options[:force] || yes?("Are you sure to delte #{rpath}?")
@@ -146,5 +146,12 @@ overwrite:表示覆盖同名文件;newcopy:表示生成文件副本并进
146
146
  end
147
147
  end
148
148
  map del: :delete
149
+
150
+ desc "quota", '获取当前用户空间配额信息'
151
+ def quota
152
+ body = Baidupan::FsCmd.quota.body
153
+ say "总空间为:#{body[:quota]*1.0/1024**3}G"
154
+ say "已用: #{body[:used]*1.0/1024**3}G"
155
+ end
149
156
  end
150
157
  end
@@ -29,7 +29,11 @@ module Baidupan
29
29
  end
30
30
 
31
31
  def thumbnail
32
- File.join(self.base_url, 'thumbnail')
32
+ File.join(self.base_url, "thumbnail")
33
+ end
34
+
35
+ def other_api_path(api)
36
+ File.join(self.base_url, api.to_s)
33
37
  end
34
38
 
35
39
  def time_format
@@ -58,6 +58,11 @@ module Baidupan
58
58
  params = common_params(:delete, path: "#{Config.join_path(rpath)}")
59
59
  post(Config.file_path, params)
60
60
  end
61
+
62
+ def quota
63
+ params = common_params(:info)
64
+ get(Config.other_api_path(:quota), params)
65
+ end
61
66
  end
62
67
  end
63
68
  end
@@ -1,3 +1,3 @@
1
1
  module Baidupan
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baidupan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -123,7 +123,7 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
- description: 利用百度云盘接口, 实现文件备份功能
126
+ description: ! '利用百度云盘接口, 实现文件备份功能 如果您有建议请在这里留言: http://ml-china.org/blog/21'
127
127
  email:
128
128
  - meeasyhappy@gmail.com
129
129
  executables: