bsclient 0.1.2 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -9
- data/bsclient.gemspec +1 -1
- data/lib/bsclient/cli.rb +32 -4
- data/lib/bsclient/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d422f8635e0838b7bc2c96d480fb7b45cadcba948d1f875ed8cb78174c24def
|
4
|
+
data.tar.gz: 6659279c9a187495b20888a95b075af33c5a63bdb17e903a04629bb5db5992ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89ea32dda741d966a78ee974246d9808f685965c4d2a35c45a2322b14423b36cce730cb81ad62c68b551b8af8b003b937c6d32679865d54deea87da18573462
|
7
|
+
data.tar.gz: abe576bdf55adb8b0ab9bc1aaaf5b280f1a7e46b7f090af03a4dd3fa20eda1e5a07a776917ca0cd2166eace0c553ec519877db99947f19133982a63644d0fb7a
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bsclient (0.1.
|
4
|
+
bsclient (0.1.6)
|
5
5
|
faraday
|
6
6
|
pry (~> 0.13.1)
|
7
7
|
pry-byebug (~> 3.9.0)
|
8
|
-
pry-doc (
|
8
|
+
pry-doc (>= 1.0.0)
|
9
9
|
thor (~> 0.20.0)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
14
|
byebug (11.1.3)
|
15
|
-
coderay (1.1.
|
15
|
+
coderay (1.1.3)
|
16
16
|
diff-lcs (1.3)
|
17
|
-
faraday (
|
18
|
-
|
17
|
+
faraday (2.0.1)
|
18
|
+
faraday-net_http (~> 2.0)
|
19
|
+
ruby2_keywords (>= 0.0.4)
|
20
|
+
faraday-net_http (2.0.1)
|
19
21
|
method_source (1.0.0)
|
20
|
-
multipart-post (2.1.1)
|
21
22
|
pry (0.13.1)
|
22
23
|
coderay (~> 1.1)
|
23
24
|
method_source (~> 1.0)
|
24
25
|
pry-byebug (3.9.0)
|
25
26
|
byebug (~> 11.0)
|
26
27
|
pry (~> 0.13.0)
|
27
|
-
pry-doc (1.
|
28
|
+
pry-doc (1.3.0)
|
28
29
|
pry (~> 0.11)
|
29
30
|
yard (~> 0.9.11)
|
30
31
|
rake (12.3.3)
|
@@ -41,8 +42,11 @@ GEM
|
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
43
|
rspec-support (~> 3.9.0)
|
43
44
|
rspec-support (3.9.3)
|
45
|
+
ruby2_keywords (0.0.5)
|
44
46
|
thor (0.20.3)
|
45
|
-
|
47
|
+
webrick (1.7.0)
|
48
|
+
yard (0.9.27)
|
49
|
+
webrick (~> 1.7.0)
|
46
50
|
|
47
51
|
PLATFORMS
|
48
52
|
ruby
|
@@ -53,4 +57,4 @@ DEPENDENCIES
|
|
53
57
|
rspec (~> 3.0)
|
54
58
|
|
55
59
|
BUNDLED WITH
|
56
|
-
2.
|
60
|
+
2.2.3
|
data/bsclient.gemspec
CHANGED
data/lib/bsclient/cli.rb
CHANGED
@@ -8,7 +8,7 @@ module BSClient
|
|
8
8
|
class_option :conf, type: :string, aliases: ['-c'], desc: 'Specify config file'
|
9
9
|
class_option :verbose, type: :boolean, aliases: ['-v'], desc: 'Verbose printing'
|
10
10
|
|
11
|
-
desc '', ''
|
11
|
+
desc 'register_account(filename = nil)', 'nil means STDIN'
|
12
12
|
def register_account(filename = nil)
|
13
13
|
req_content = if filename
|
14
14
|
IO.read(filename)
|
@@ -20,26 +20,54 @@ module BSClient
|
|
20
20
|
print app.register_account(req_content)
|
21
21
|
end
|
22
22
|
|
23
|
-
desc '', ''
|
23
|
+
desc 'query_registration(task_id, account)', ''
|
24
24
|
def query_registration(task_id, account)
|
25
25
|
app = App.new(options, Config.create(options[:env]))
|
26
26
|
print app.query_registration(task_id, account)
|
27
27
|
end
|
28
28
|
|
29
|
-
desc '', ''
|
29
|
+
desc 'create_user_image(account, text, size="30", color="red")', ''
|
30
30
|
def create_user_image(account, text, size="30", color="red")
|
31
31
|
req_content = {account: account, text: text, fontSize: size, fontColor: color}.to_json
|
32
32
|
app = App.new(options, Config.create(options[:env]))
|
33
33
|
print app.create_user_image(req_content)
|
34
34
|
end
|
35
35
|
|
36
|
-
desc '', ''
|
36
|
+
desc 'download_user_image(account)', ''
|
37
37
|
def download_user_image(account)
|
38
38
|
params = {account: account, imageName: ''}
|
39
39
|
app = App.new(options, Config.create(options[:env]))
|
40
40
|
print app.download_user_image(params)
|
41
41
|
end
|
42
42
|
|
43
|
+
desc 'get(url, *raw_params)', 'bsclient get <url> name=Jack age=10'
|
44
|
+
def get(url, *raw_params)
|
45
|
+
params = raw_params.each_with_object({}) do |param, h|
|
46
|
+
k, v = param.split('=')
|
47
|
+
h[k.to_sym] = v
|
48
|
+
end
|
49
|
+
app = App.new(options, Config.create(options[:env]))
|
50
|
+
print app.get(url, params)
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'post(url, *args)', 'bsclient post <url> name=Jack age=10; bsclient post <url> myfile.json; cat myfile.json | bsclient post <url>'
|
54
|
+
def post(url, *args)
|
55
|
+
if not STDIN.isatty
|
56
|
+
params = JSON.parse(STDIN.read)
|
57
|
+
elsif File.exist?(args.first)
|
58
|
+
params = File.read(args.first)
|
59
|
+
else
|
60
|
+
params = args.each_with_object({}) do |param, h|
|
61
|
+
k, v = param.split('=')
|
62
|
+
value = v
|
63
|
+
value = JSON.parse(v[1..-1]) if v[0] == ':'
|
64
|
+
h[k.to_sym] = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
app = App.new(options, Config.create(options[:env]))
|
68
|
+
print app.post_json(url, params)
|
69
|
+
end
|
70
|
+
|
43
71
|
# desc '', ''
|
44
72
|
# class_option :out, type: :string, aliases: ['-o'], desc: 'Specify output file'
|
45
73
|
# def sign(filename = nil)
|
data/lib/bsclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bsclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: pry-doc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.0.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.0.0
|
83
83
|
description: Register bs account
|
84
84
|
email:
|
85
85
|
- liuxiang@ktjr.com
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.3
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Register bs account
|