rongcloud-server-sdk 1.0.1 → 1.0.2
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 +4 -4
- data/.overcommit.yml +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +17 -4
- data/lib/rongcloud/api/user.rb +3 -0
- data/lib/rongcloud/version.rb +1 -1
- data/rongcloud-server-sdk.gemspec +38 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb4e6f2555e86fcf2ca28b4bfdf8f2607dcf76dbcaf8f7ef0c96a60abf75954
|
4
|
+
data.tar.gz: 3cf79649378bad6ffd15700496f5c7ea56837a94546c3927a6c74fdbf31aa419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f960322de7803e1a16ab378937185ad0e6c775833aeeaaf34e81036b7ab4d6a9b3ddba91b1a6b2a6ffc94303e60201efa15b403405fc8adabaae66c25e414f94
|
7
|
+
data.tar.gz: 00ec6b5d2256a59bd2552f83edf88bd39a6fcf72121326f4218c4ba770df22f1f9a6630d257f87859a87a0da1c4bc1a63932d8bef019d05fc0e9388decb7cc57
|
data/.overcommit.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,9 @@ Or install it yourself as:
|
|
23
23
|
## Usage
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
rongcloud
|
26
|
+
require "rongcloud"
|
27
|
+
|
28
|
+
rongcloud = RongCloud::Client.new(
|
27
29
|
app_key: ENV["RONGCLOUD_APP_KEY"],
|
28
30
|
app_secret: ENV["RONGCLOUD_APP_SECRET"],
|
29
31
|
host: "api-cn.ronghub.com"
|
@@ -49,13 +51,13 @@ The API name is converted from the corresponding URI, E.g.
|
|
49
51
|
### Timeout
|
50
52
|
|
51
53
|
```ruby
|
52
|
-
rongcloud = RongCloud::Client
|
54
|
+
rongcloud = RongCloud::Client.new(
|
53
55
|
app_key: ENV["RONGCLOUD_APP_KEY"],
|
54
56
|
app_secret: ENV["RONGCLOUD_APP_SECRET"],
|
55
57
|
host: "api-cn.ronghub.com",
|
56
58
|
http: {
|
57
59
|
timeout_class: HTTP::Timeout::Global,
|
58
|
-
timeout_options: {global_timeout:
|
60
|
+
timeout_options: {global_timeout: 5}
|
59
61
|
}
|
60
62
|
)
|
61
63
|
```
|
@@ -63,7 +65,7 @@ rongcloud = RongCloud::Client::new(
|
|
63
65
|
### Logging
|
64
66
|
|
65
67
|
```ruby
|
66
|
-
rongcloud = RongCloud::Client
|
68
|
+
rongcloud = RongCloud::Client.new(
|
67
69
|
app_key: ENV["RONGCLOUD_APP_KEY"],
|
68
70
|
app_secret: ENV["RONGCLOUD_APP_SECRET"],
|
69
71
|
host: "api-cn.ronghub.com",
|
@@ -75,6 +77,17 @@ rongcloud = RongCloud::Client::new(
|
|
75
77
|
)
|
76
78
|
```
|
77
79
|
|
80
|
+
### Signature Verify
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
verified = RongCloud::Signer.verify?(
|
84
|
+
app_secret: ENV["RONGCLOUD_APP_SECRET"],
|
85
|
+
nonce: params["nonce"],
|
86
|
+
timestamp: params["timestamp"],
|
87
|
+
signature: params["signature"]
|
88
|
+
)
|
89
|
+
```
|
90
|
+
|
78
91
|
|
79
92
|
## Development
|
80
93
|
|
data/lib/rongcloud/api/user.rb
CHANGED
@@ -7,6 +7,9 @@ module RongCloud
|
|
7
7
|
member "/user/token/expire.json"
|
8
8
|
member "/user/info.json"
|
9
9
|
member "/user/refresh.json"
|
10
|
+
member "/user/tag/set.json", format: :json
|
11
|
+
member "/user/tag/batch/set.json", format: :json
|
12
|
+
member "/user/tags/get.json"
|
10
13
|
|
11
14
|
member "/user/block.json"
|
12
15
|
member "/user/block/query.json"
|
data/lib/rongcloud/version.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/rongcloud/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "rongcloud-server-sdk"
|
7
|
+
spec.version = RongCloud::VERSION
|
8
|
+
spec.authors = ["John Doe"]
|
9
|
+
spec.email = ["johndoe@example.com"]
|
10
|
+
|
11
|
+
spec.summary = "RongCloud Server SDK in Ruby."
|
12
|
+
spec.description = "RongCloud Server SDK in Ruby."
|
13
|
+
spec.homepage = "https://github.com/souk4711/rongcloud-server-sdk-ruby"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.7.0"
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/souk4711/rongcloud-server-sdk-ruby"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/souk4711/rongcloud-server-sdk-ruby"
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
# Uncomment to register a new dependency of your gem
|
33
|
+
spec.add_dependency "http", "~> 5.0"
|
34
|
+
|
35
|
+
# For more information and examples about making a new gem, check out our
|
36
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
37
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
38
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rongcloud-server-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Doe
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/rongcloud/http.rb
|
63
63
|
- lib/rongcloud/signer.rb
|
64
64
|
- lib/rongcloud/version.rb
|
65
|
+
- rongcloud-server-sdk.gemspec
|
65
66
|
homepage: https://github.com/souk4711/rongcloud-server-sdk-ruby
|
66
67
|
licenses:
|
67
68
|
- MIT
|