aliyun-rails 0.1.17 → 0.1.20
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/CHANGELOG.md +11 -15
- data/CODE_OF_CONDUCT.md +84 -84
- data/CONTRIBUTING.md +1 -0
- data/LICENSE.txt +21 -21
- data/README.md +152 -152
- data/Rakefile +8 -8
- data/lib/aliyun/connector/roa_client.rb +166 -166
- data/lib/aliyun/connector/rpc_client.rb +148 -116
- data/lib/aliyun/dysms.rb +25 -25
- data/lib/aliyun/dyvms.rb +25 -25
- data/lib/aliyun/version.rb +7 -7
- data/lib/aliyun-rails.rb +25 -26
- metadata +7 -6
data/lib/aliyun/dyvms.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Aliyun
|
4
|
-
class Dyvms < Aliyun::Connector::RPCClient
|
5
|
-
# 本产品(Dyvmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
|
6
|
-
# 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
|
7
|
-
def initialize(config = {}, verbose = nil)
|
8
|
-
config[:endpoint] ||= "http://dyvmsapi.aliyuncs.com"
|
9
|
-
config[:api_version] ||= "2017-05-25"
|
10
|
-
super(config, verbose)
|
11
|
-
end
|
12
|
-
|
13
|
-
# 调用SingleCallByTts接口向指定号码发送语音验证码和带参数变量的语音通知
|
14
|
-
def single_call_by_tts(called_show_number, called_number, tts_code, tts_param)
|
15
|
-
params = {
|
16
|
-
CalledShowNumber: called_show_number,
|
17
|
-
CalledNumber: called_number,
|
18
|
-
TtsCode: tts_code,
|
19
|
-
TtsParam: tts_param.to_json
|
20
|
-
}
|
21
|
-
opts = { method: "POST", timeout: 15000 }
|
22
|
-
request(action: "
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aliyun
|
4
|
+
class Dyvms < Aliyun::Connector::RPCClient
|
5
|
+
# 本产品(Dyvmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
|
6
|
+
# 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
|
7
|
+
def initialize(config = {}, verbose = nil)
|
8
|
+
config[:endpoint] ||= "http://dyvmsapi.aliyuncs.com"
|
9
|
+
config[:api_version] ||= "2017-05-25"
|
10
|
+
super(config, verbose)
|
11
|
+
end
|
12
|
+
|
13
|
+
# 调用SingleCallByTts接口向指定号码发送语音验证码和带参数变量的语音通知
|
14
|
+
def single_call_by_tts(called_show_number, called_number, tts_code, tts_param)
|
15
|
+
params = {
|
16
|
+
CalledShowNumber: called_show_number,
|
17
|
+
CalledNumber: called_number,
|
18
|
+
TtsCode: tts_code,
|
19
|
+
TtsParam: tts_param.to_json
|
20
|
+
}
|
21
|
+
opts = { method: "POST", timeout: 15000 }
|
22
|
+
request(action: "SendSms", params: params, opts: opts)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/aliyun/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Aliyun
|
4
|
-
VERSION = "0.1.
|
5
|
-
DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
|
6
|
-
"#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
|
7
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aliyun
|
4
|
+
VERSION = "0.1.20"
|
5
|
+
DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
|
6
|
+
"#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
|
7
|
+
end
|
data/lib/aliyun-rails.rb
CHANGED
@@ -1,26 +1,25 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "aliyun/version"
|
4
|
-
require_relative "aliyun/connector/roa_client"
|
5
|
-
require_relative "aliyun/connector/rpc_client"
|
6
|
-
require_relative "aliyun/dysms"
|
7
|
-
require_relative "aliyun/dyvms"
|
8
|
-
|
9
|
-
module Aliyun
|
10
|
-
class Error < StandardError; end
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
Dyvms = Aliyun::Dyvms
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "aliyun/version"
|
4
|
+
require_relative "aliyun/connector/roa_client"
|
5
|
+
require_relative "aliyun/connector/rpc_client"
|
6
|
+
require_relative "aliyun/dysms"
|
7
|
+
require_relative "aliyun/dyvms"
|
8
|
+
|
9
|
+
module Aliyun
|
10
|
+
class Error < StandardError; end
|
11
|
+
|
12
|
+
# 模块单例方法
|
13
|
+
class << self
|
14
|
+
attr_accessor :access_key_id, :access_key_secret
|
15
|
+
def config
|
16
|
+
yield self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# 加载模块,自动初始化的常量
|
22
|
+
RPCClient = Aliyun::Connector::RPCClient
|
23
|
+
ROAClient = Aliyun::Connector::ROAClient
|
24
|
+
Dysms = Aliyun::Dysms
|
25
|
+
Dyvms = Aliyun::Dyvms
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aliyun-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WENWU.YAN
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- CHANGELOG.md
|
49
49
|
- CODE_OF_CONDUCT.md
|
50
|
+
- CONTRIBUTING.md
|
50
51
|
- LICENSE.txt
|
51
52
|
- README.md
|
52
53
|
- Rakefile
|
@@ -62,8 +63,8 @@ licenses:
|
|
62
63
|
metadata:
|
63
64
|
homepage_uri: https://github.com/ciscolive/aliyun-rails
|
64
65
|
source_code_uri: https://github.com/ciscolive/aliyun-rails
|
65
|
-
changelog_uri: https://github.com/ciscolive/aliyun-rails/blob/main/
|
66
|
-
post_install_message:
|
66
|
+
changelog_uri: https://github.com/ciscolive/aliyun-rails/blob/main/README.md
|
67
|
+
post_install_message:
|
67
68
|
rdoc_options: []
|
68
69
|
require_paths:
|
69
70
|
- lib
|
@@ -79,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
82
|
rubygems_version: 3.3.7
|
82
|
-
signing_key:
|
83
|
+
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: 非阿里云官方SDK,本GEM主要实现RAILS项目轻松调用 ** aliyun ** 相关接口
|
85
86
|
test_files: []
|