aliyun-rails 0.1.21 → 0.1.22

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: 5ccdac6af59f37792525c9a0b013bd0bfd6a100bb716144cc9396096ade241b8
4
- data.tar.gz: 1337c663672fe95a6e3e98d72995065435ed40ef05fe8cb9cfdd6cb0566a4805
3
+ metadata.gz: fae9647befd19495efe8ee65622d39798262f64431d0ef1fc1f672b90312f507
4
+ data.tar.gz: 36694d962ab372a380c895d38a48b7d00f612b8640cad2361a4438c74434fb25
5
5
  SHA512:
6
- metadata.gz: 50f671530e769630468705c677ce1787e0924a9fcd82e53133374bafe8edb9b69faa5d14b2f45830c287a24cf920866530576ca73cbb6249fbd01067cb075d6b
7
- data.tar.gz: f974dca4cf118419bdfca3d5ff5ee7cced1a2e848293e0d58c642362658a30cc8ce70f6328e98f0bbcbe3dc531da792dd0d72247323b1f93787031f050043a7f
6
+ metadata.gz: 5e02396fef78d045ca91dc9cc907ce275fe776e92a471a92058e9bf57daad42caf86882348006585e1ee96a7f484c24083f587c74dd78d753c10b1e3ab001334
7
+ data.tar.gz: '0814489a4fed1755ff900a08baa6741a96e8e5d9904c74e887b4617dc33efd35f20ba9a4e9f36b995c60f5100e414cfb5886c38fef7a4676338b08ffa6b01c84'
data/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  </p>
16
16
 
17
17
 
18
- - 支持 Rails 轻松访问阿里云服务,例如:弹性云主机(ECS)、负载均衡(SLB)、云监控(CloudMonitor)等。
18
+ - 支持 Rails 轻松访问阿里云服务,例如:弹性云主机(ECS)、负载均衡(SLB)、云监控(CloudMonitor)等。
19
19
  - 已集成阿里云短信服务和语音服务,满足日常短信和电话告警需求。
20
20
 
21
21
  本文档介绍如何安装和使用 aliyun-rails
@@ -23,8 +23,8 @@ module Aliyun
23
23
 
24
24
  self.endpoint = config[:endpoint]
25
25
  self.api_version = config[:api_version]
26
- self.access_key_id = config[:access_key_id]
27
- self.access_key_secret = config[:access_key_secret]
26
+ self.access_key_id = config[:access_key_id] || Aliyun.access_key_id
27
+ self.access_key_secret = config[:access_key_secret] || Aliyun.access_key_secret
28
28
  self.security_token = config[:security_token]
29
29
  end
30
30
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "set"
2
4
  require "openssl"
3
5
  require "faraday"
@@ -6,15 +8,15 @@ require "active_support/all"
6
8
  module Aliyun
7
9
  module Connector
8
10
  class RPCClient
9
-
10
11
  attr_accessor :endpoint, :api_version, :access_key_id, :access_key_secret,
11
12
  :security_token, :codes, :opts, :verbose
12
13
 
13
14
  # 对象初始化属性
14
15
  def initialize(config, verbose = false)
15
-
16
+ # 参数校验
16
17
  validate config
17
18
 
19
+ # 相关属性
18
20
  self.endpoint = config[:endpoint]
19
21
  self.api_version = config[:api_version]
20
22
  self.access_key_id = config[:access_key_id] || Aliyun.access_key_id
@@ -63,6 +65,7 @@ module Aliyun
63
65
  raise StandardError, "Code: #{response_body['Code']}, Message: #{response_body['Message']}, URL: #{uri}"
64
66
  end
65
67
 
68
+ # 返回数据
66
69
  response_body
67
70
  end
68
71
 
@@ -117,7 +120,7 @@ module Aliyun
117
120
  target[key.to_s] = value
118
121
  end
119
122
  end
120
- target.to_query
123
+ target
121
124
  end
122
125
 
123
126
  def normalize(params)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aliyun
4
- VERSION = "0.1.21"
4
+ VERSION = "0.1.22"
5
5
  DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
6
6
  "#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
7
7
  end
data/lib/aliyun-rails.rb CHANGED
@@ -9,17 +9,18 @@ require_relative "aliyun/dyvms"
9
9
  module Aliyun
10
10
  class Error < StandardError; end
11
11
 
12
- # 模块单例方法
13
12
  class << self
14
13
  attr_accessor :access_key_id, :access_key_secret
15
14
  def config
16
15
  yield self
17
16
  end
18
17
  end
18
+
19
+ # Your code goes here...
19
20
  end
20
21
 
21
22
  # 加载模块,自动初始化的常量
22
23
  RPCClient = Aliyun::Connector::RPCClient
23
24
  ROAClient = Aliyun::Connector::ROAClient
24
- Dysms = Aliyun::Dysms
25
- Dyvms = Aliyun::Dyvms
25
+ Dysms = Aliyun::Dysms
26
+ 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.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - WENWU.YAN
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-18 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -45,9 +45,6 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - CHANGELOG.md
49
- - CODE_OF_CONDUCT.md
50
- - CONTRIBUTING.md
51
48
  - LICENSE.txt
52
49
  - README.md
53
50
  - Rakefile
@@ -79,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
76
  - !ruby/object:Gem::Version
80
77
  version: '0'
81
78
  requirements: []
82
- rubygems_version: 3.3.7
79
+ rubygems_version: 3.3.3
83
80
  signing_key:
84
81
  specification_version: 4
85
82
  summary: 非阿里云官方SDK,本GEM主要实现RAILS项目轻松调用 ** aliyun ** 相关接口
data/CHANGELOG.md DELETED
@@ -1,11 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.14] - 2022-04-01
4
-
5
- - 优化 rpc_client 代码
6
- - 优化 roa_client 代码
7
- - 完善代码范例
8
-
9
- ## [0.1.0] - 2022-03-31
10
-
11
- - 首次发布代码
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at careline@foxmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/CONTRIBUTING.md DELETED
@@ -1 +0,0 @@
1
- ## 待添加