dolphin_kit 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 545aad4e725c12ada156f91ccbe06c090daf9f7751f161e50d607f3a22fc70f9
4
- data.tar.gz: 2bb1d5112a145349ade8bd9f457b82704840229d9331f4472c22651df19eaec7
3
+ metadata.gz: 29b28c111e89a70ad3080b6f4cdc67dcea705a5992d122185fffb37d01d30df0
4
+ data.tar.gz: fed18ea224b57131a67b4464a4658ed9077300466d26b5c3b215003cc5c51e81
5
5
  SHA512:
6
- metadata.gz: 5077713b1df1d38d55d661fce2fc144afd6824d86aabf68aee4ee33379a38f46a8cab87df0d66c2b1d2e0041bac96cfde56d185a5eacdd8ed7d2d8be340b9228
7
- data.tar.gz: c96a70c4bb7739a6de9d632fc8a3c0b50c438e64a6480d83af02d1be6e4a25be161b7bc1c3f1ebb741944adcb75b40c214e4873e98b9d6051da1c1406f504d60
6
+ metadata.gz: 49f2267df9d14cbc1fd7dd2a9b1eb966e34dfc73cf1c3e0d698a61622936c92f3d5917dac3de9512e60cd2334b7a7cd91580484b319e0823a80332d0d0f5b050
7
+ data.tar.gz: baf923ecde1c32e5b42204ef3c93094f20c0033691a2234098c8cef8857f4266f166e0ad5655ed10a473484838535dd0a10f73880061c73b4153a13d5b22c448
@@ -0,0 +1,18 @@
1
+ require 'net/http'
2
+
3
+ module DolphinKit
4
+ module HTTP
5
+ module_function
6
+
7
+ def get(url, params: {})
8
+ uri = URI(url)
9
+ uri.query = URI.encode_www_form(params) unless params.empty?
10
+ Net::HTTP.get_response(uri)
11
+ end
12
+
13
+ def post(url, form: {})
14
+ uri = URI(url)
15
+ Net::HTTP.post_form(uri, **form)
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module DolphinKit
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
data/lib/dolphin_kit.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  require 'json'
2
- require 'http'
3
-
4
2
  require 'dolphin_kit/version'
5
- require 'dolphin_kit/service'
3
+ require 'dolphin_kit/helpers/http'
6
4
  require 'dolphin_kit/services/baidu_service'
7
5
  require 'dolphin_kit/services/qcloud_service'
8
6
  require 'dolphin_kit/services/youdao_service'
7
+ require 'dolphin_kit/service'
9
8
 
10
9
  module DolphinKit
11
10
  module_function
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolphin_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - razeos at tossdev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-16 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: http
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.1'
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description:
28
14
  email:
29
15
  executables: []
@@ -31,6 +17,7 @@ extensions: []
31
17
  extra_rdoc_files: []
32
18
  files:
33
19
  - lib/dolphin_kit.rb
20
+ - lib/dolphin_kit/helpers/http.rb
34
21
  - lib/dolphin_kit/service.rb
35
22
  - lib/dolphin_kit/services/baidu_service.rb
36
23
  - lib/dolphin_kit/services/qcloud_service.rb