bkblz 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bkblz +42 -6
- data/lib/bkblz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bb020bd742d6466c5034266d7a7bb8226eb77e6
|
4
|
+
data.tar.gz: '02239fdea837af33a2c1b2c7d44e75a5c4b8baf5'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c9ea979f127b4460c079bb84e13381242ddc7c23bbaa6164a35d11b90eec93b1db2e3897689288ec3cc2a6c4417fa6356fc4203af3298dff7fbb5a15a92e4f7
|
7
|
+
data.tar.gz: 937b30c05b0e6156acf4380d76d7d8db3ee1d6446fdc0b7585fb99c0d67fa2d0b8206a034c512b67e43c0e6e716dec826ed63bcd4b2d9832fe965cce7f7b7d1b
|
data/bin/bkblz
CHANGED
@@ -44,10 +44,43 @@ module Bkblz
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
class Generators < Thor
|
48
|
+
include Helper
|
49
|
+
|
50
|
+
desc "config", "generate a bkblz config"
|
51
|
+
def config
|
52
|
+
map = Bkblz::Config::CONFIG_VARS.dup
|
53
|
+
|
54
|
+
puts "Enter a value for each field and press <enter>."
|
55
|
+
puts "To accept the default just press <enter>:"
|
56
|
+
puts
|
57
|
+
map.inject(map) do |m, (k, v)|
|
58
|
+
print "#{k}: #{v}"
|
59
|
+
input = STDIN.gets.chomp
|
60
|
+
input = v if input.empty?
|
61
|
+
input = case v
|
62
|
+
when Symbol
|
63
|
+
input.intern
|
64
|
+
when !!v == v # Boolean check
|
65
|
+
input == 'true'
|
66
|
+
else
|
67
|
+
input
|
68
|
+
end
|
69
|
+
m[k] = input
|
70
|
+
m
|
71
|
+
end
|
72
|
+
|
73
|
+
puts
|
74
|
+
puts "cat > bkblz.yml <<EOS"
|
75
|
+
puts map.to_yaml
|
76
|
+
puts "EOS"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
47
80
|
class Bucket < Thor
|
48
81
|
include Helper
|
49
82
|
|
50
|
-
desc "
|
83
|
+
desc "list", "lists all of your buckets"
|
51
84
|
def list
|
52
85
|
parse_opts
|
53
86
|
|
@@ -61,7 +94,7 @@ module Bkblz
|
|
61
94
|
end
|
62
95
|
end
|
63
96
|
|
64
|
-
desc "
|
97
|
+
desc "create <bucket_name>", "creates a new bucket"
|
65
98
|
def create(bucket_name)
|
66
99
|
parse_opts
|
67
100
|
|
@@ -76,7 +109,7 @@ module Bkblz
|
|
76
109
|
class File < Thor
|
77
110
|
include Helper
|
78
111
|
|
79
|
-
desc "
|
112
|
+
desc "upload <bucket_name> <local_file_path>", "upload a local file to B2"
|
80
113
|
def upload(bucket_name, local_file_path)
|
81
114
|
parse_opts
|
82
115
|
|
@@ -91,7 +124,7 @@ module Bkblz
|
|
91
124
|
print_model file_info
|
92
125
|
end
|
93
126
|
|
94
|
-
desc "
|
127
|
+
desc "download <id> <dir>", "downloads file <id> to directory <dir>"
|
95
128
|
def download(file_id, dir_path)
|
96
129
|
parse_opts
|
97
130
|
|
@@ -106,7 +139,7 @@ module Bkblz
|
|
106
139
|
print_model file_info
|
107
140
|
end
|
108
141
|
|
109
|
-
desc "
|
142
|
+
desc "list <bucket_name>", "lists files in a bucket"
|
110
143
|
option :start_at, :desc => "file name to start listing from, cannot be used with --all"
|
111
144
|
option :limit, {
|
112
145
|
:desc => "limit of files to list per request",
|
@@ -139,7 +172,7 @@ module Bkblz
|
|
139
172
|
end
|
140
173
|
end
|
141
174
|
|
142
|
-
desc "
|
175
|
+
desc "info <file_id>", "displays info for file with <id>"
|
143
176
|
def info(file_id)
|
144
177
|
parse_opts
|
145
178
|
|
@@ -164,6 +197,9 @@ module Bkblz
|
|
164
197
|
|
165
198
|
desc "file SUBCOMMAND ...ARGS", "manage backblaze files"
|
166
199
|
subcommand "file", File
|
200
|
+
|
201
|
+
desc "gen SUBCOMMAND ...ARGS", "generate bkblz files"
|
202
|
+
subcommand "gen", Generators
|
167
203
|
end
|
168
204
|
end
|
169
205
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erick Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|