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 +4 -4
- data/lib/dolphin_kit/helpers/http.rb +18 -0
- data/lib/dolphin_kit/version.rb +1 -1
- data/lib/dolphin_kit.rb +2 -3
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29b28c111e89a70ad3080b6f4cdc67dcea705a5992d122185fffb37d01d30df0
|
4
|
+
data.tar.gz: fed18ea224b57131a67b4464a4658ed9077300466d26b5c3b215003cc5c51e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/dolphin_kit/version.rb
CHANGED
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/
|
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.
|
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-
|
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
|