bsclient 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f31285623aaf593a739ceef8b17933358216c6d240d016461ba2f38a62121ae7
4
- data.tar.gz: 2725d05e592da9d749e9fbe9a99b948064cac61d24029b088319c5e17580c92f
3
+ metadata.gz: fba63b8b9264d8f8fa2cbcf48e9ec8a1c6a40287c415a8830c8adf328ab5c280
4
+ data.tar.gz: 0e18b44a05942300eebc44574d839b904d8afa3887d94b4d05cc56726a49dbe5
5
5
  SHA512:
6
- metadata.gz: '0493fe581b568f6a80ea726fd5cb5a566f4963990eada774186e77a62693ecf8e2c381f7b5e5ac66547c8fa67c763ff3fb149454ea7c3fae387ba86314ab0de0'
7
- data.tar.gz: 488a667b8a6f827e407fc530d5070871cc57ead13b3874fc4897f9d1bcb1662b86a77de2d2138fec34f3ed15bd01cce4337948b89827620fe8fd7295e9d391e3
6
+ metadata.gz: ec26af38a5a8a3c7a0f90bc02cc66f05605d6ab6b9b1c53544954ff004a4e4444dbfdea153bbb12aa21a5a5663f57117f374062418e9346ec0ef7f6a5e4c8651
7
+ data.tar.gz: 072f6dfd67cfe92377361d48347cb2e64ee58478e8e365ad01a941d8782004e08833ecb1309af58e1e0cf6b33da7c3780e76a5504ed49c612ac1ab7e2676ff21
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bsclient (0.1.2)
4
+ bsclient (0.1.3)
5
5
  faraday
6
6
  pry (~> 0.13.1)
7
7
  pry-byebug (~> 3.9.0)
@@ -40,6 +40,34 @@ module BSClient
40
40
  print app.download_user_image(params)
41
41
  end
42
42
 
43
+ desc '', ''
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 '', ''
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)
@@ -1,3 +1,3 @@
1
1
  module BSClient
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2020-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday