bkblz 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/bkblz +24 -4
- data/lib/bkblz/task/all.rb +2 -1
- data/lib/bkblz/task/get_file_info.rb +14 -0
- data/lib/bkblz/v1/all.rb +1 -0
- data/lib/bkblz/v1/get_file_info.rb +22 -0
- data/lib/bkblz/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 990022a090baa3a510ff31ed662426b951a73245
|
4
|
+
data.tar.gz: 531dfaecf56ea2a1c886352d4725a0e9558c4c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1244c37357c5fa5c0c183efedb218683c854002b60f6b4abb976f3b9c033c1f189ff0bbf30d4216189a5678ccc55cb05af4abac6d1bf827fc0c2646eb5c9160
|
7
|
+
data.tar.gz: bf64f19457e1d9b21b12298b7c4756b540b812964fadca488639410aa5f8f3749a6acb1d236476f350f69e3864df7fdcd32694d0d562877239821d4b64a2bf1a
|
data/bin/bkblz
CHANGED
@@ -92,13 +92,14 @@ module Bkblz
|
|
92
92
|
end
|
93
93
|
|
94
94
|
desc "file list <bucket_name>", "lists files in a bucket"
|
95
|
-
option :start_at, :desc => "file name to start listing from"
|
95
|
+
option :start_at, :desc => "file name to start listing from, cannot be used with --all"
|
96
96
|
option :limit, {
|
97
97
|
:desc => "limit of files to list per request",
|
98
98
|
:default => 100,
|
99
99
|
:type => :numeric
|
100
100
|
}
|
101
101
|
option :all, :desc => "lists all file versions, cannot be used with --start-at"
|
102
|
+
option :with_id, :type => :boolean, :desc => "include file_id in results"
|
102
103
|
def list(bucket_name)
|
103
104
|
parse_opts
|
104
105
|
|
@@ -112,11 +113,30 @@ module Bkblz
|
|
112
113
|
:bucket_name => bucket_name
|
113
114
|
})
|
114
115
|
|
115
|
-
|
116
|
-
|
117
|
-
|
116
|
+
file_printer = lambda do |file|
|
117
|
+
puts options[:with_id] ?
|
118
|
+
"%s - %s" % [file.file_name, file.file_id] :
|
119
|
+
file.file_name
|
118
120
|
end
|
121
|
+
|
122
|
+
print_header "Files"
|
123
|
+
paged_response.files.each &file_printer
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
desc "file info <id>", "displays info for file with <id>"
|
128
|
+
option :id, :desc => "the file id as returned by <file list>"
|
129
|
+
def info(file_id)
|
130
|
+
parse_opts
|
131
|
+
|
132
|
+
file_info = run_task do
|
133
|
+
Bkblz::Task::GetFileInfo.run Bkblz.config, {
|
134
|
+
:file_id => options[:id]
|
135
|
+
}
|
119
136
|
end
|
137
|
+
|
138
|
+
print_header "File Info"
|
139
|
+
print_model file_info
|
120
140
|
end
|
121
141
|
end
|
122
142
|
|
data/lib/bkblz/task/all.rb
CHANGED
data/lib/bkblz/v1/all.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative "authorize_account"
|
|
10
10
|
require_relative "list_buckets"
|
11
11
|
require_relative "create_bucket"
|
12
12
|
require_relative "delete_bucket"
|
13
|
+
require_relative "get_file_info"
|
13
14
|
require_relative "get_upload_url"
|
14
15
|
require_relative "upload_file"
|
15
16
|
require_relative "list_file_names"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Bkblz
|
2
|
+
module V1
|
3
|
+
|
4
|
+
class GetFileInfoResponse < Response
|
5
|
+
response_model Model::FileInfo
|
6
|
+
end
|
7
|
+
|
8
|
+
class GetFileInfoRequest < Request
|
9
|
+
|
10
|
+
response_class GetFileInfoResponse
|
11
|
+
url_suffix "/b2api/v1/b2_get_file_info"
|
12
|
+
|
13
|
+
def initialize(file_id)
|
14
|
+
@file_id = file_id
|
15
|
+
end
|
16
|
+
|
17
|
+
def build_request(session)
|
18
|
+
session.create_post url(session), :file_id => @file_id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/bkblz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bkblz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erick Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/bkblz/map_key_formatter.rb
|
92
92
|
- lib/bkblz/task/all.rb
|
93
93
|
- lib/bkblz/task/create_bucket.rb
|
94
|
+
- lib/bkblz/task/get_file_info.rb
|
94
95
|
- lib/bkblz/task/list_buckets.rb
|
95
96
|
- lib/bkblz/task/list_files.rb
|
96
97
|
- lib/bkblz/task/task.rb
|
@@ -103,6 +104,7 @@ files:
|
|
103
104
|
- lib/bkblz/v1/delete_file_version.rb
|
104
105
|
- lib/bkblz/v1/download_file.rb
|
105
106
|
- lib/bkblz/v1/error_response.rb
|
107
|
+
- lib/bkblz/v1/get_file_info.rb
|
106
108
|
- lib/bkblz/v1/get_upload_url.rb
|
107
109
|
- lib/bkblz/v1/list_buckets.rb
|
108
110
|
- lib/bkblz/v1/list_file_names.rb
|
@@ -134,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
136
|
version: '0'
|
135
137
|
requirements: []
|
136
138
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.5.
|
139
|
+
rubygems_version: 2.5.2
|
138
140
|
signing_key:
|
139
141
|
specification_version: 4
|
140
142
|
summary: Bkblz GEM for the Backblaze B2 API. https://www.backblaze.com/b2/docs/
|