aliyun-dysms 0.0.1 → 0.0.2

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: 7e914670b8041bfb2c1639676ce08f5feeaa102b2a8dc010d887670bae47bc95
4
- data.tar.gz: 1e06b33272fc719c89dd7895ff846087db93fa4f93b90912195554749f82de8f
3
+ metadata.gz: de6093b9783e0f0d02983f70594642cd986d978dc684a522698c8b961b1114c5
4
+ data.tar.gz: 5c9e9f49c5fc9ac53bb700901fa8ab8f1fe5a9d2d6df27f93d8c5b577799abfb
5
5
  SHA512:
6
- metadata.gz: e9f46d98707ba1dc708fbe0913bbeece580e4a959aa9b25c2aba5f4173ed7b9b9bc0b36dc1963ee3fd6d5fe01dc80f4303238d21393fbabdbd02c4a03936375d
7
- data.tar.gz: 3840d128f31c10be310b30b203b3e7432db4b390093794a186b6d5c2c4091cbcbbfdeb67a99b8425475058a19552964af730d3227d84d6481a48cd6d4a94ff5f
6
+ metadata.gz: ccc22eace9f207017b142516bcd528112e52ad53a992796f97bd6f09f9b09d72ce688f66e1042dab64c6f78d18388aace65ea52b53ee2ae847fb4e8bedd26c5b
7
+ data.tar.gz: 15a6e0d8826168124b8a95e43e5f1bf2b441e7495e3a97238a446e12ff3717a7a1c7ee4afd20b7593d25a1240afe0a1e2074ebd6c3cd3da52dfa0ed7bf92809a
@@ -0,0 +1,218 @@
1
+ require: rubocop-performance
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.6
5
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
6
+ # to ignore them, so only the ones explicitly set in this file are enabled.
7
+ DisabledByDefault: true
8
+
9
+ Performance:
10
+ Exclude:
11
+ - '**/test/**/*'
12
+
13
+ # Prefer &&/|| over and/or.
14
+ Style/AndOr:
15
+ Enabled: true
16
+
17
+ # Do not use braces for hash literals when they are the last argument of a
18
+ # method call.
19
+ Style/BracesAroundHashParameters:
20
+ Enabled: true
21
+ EnforcedStyle: context_dependent
22
+
23
+ # Align `when` with `case`.
24
+ Layout/CaseIndentation:
25
+ Enabled: true
26
+
27
+ # Align comments with method definitions.
28
+ Layout/CommentIndentation:
29
+ Enabled: true
30
+
31
+ Layout/ElseAlignment:
32
+ Enabled: true
33
+
34
+ # Align `end` with the matching keyword or starting expression except for
35
+ # assignments, where it should be aligned with the LHS.
36
+ Layout/EndAlignment:
37
+ Enabled: true
38
+ EnforcedStyleAlignWith: variable
39
+ AutoCorrect: true
40
+
41
+ Layout/EmptyLineAfterMagicComment:
42
+ Enabled: true
43
+
44
+ Layout/EmptyLinesAroundBlockBody:
45
+ Enabled: true
46
+
47
+ # In a regular class definition, no empty lines around the body.
48
+ Layout/EmptyLinesAroundClassBody:
49
+ Enabled: true
50
+
51
+ # In a regular method definition, no empty lines around the body.
52
+ Layout/EmptyLinesAroundMethodBody:
53
+ Enabled: true
54
+
55
+ # In a regular module definition, no empty lines around the body.
56
+ Layout/EmptyLinesAroundModuleBody:
57
+ Enabled: true
58
+
59
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
60
+ Style/HashSyntax:
61
+ Enabled: true
62
+
63
+ # Method definitions after `private` or `protected` isolated calls need one
64
+ # extra level of indentation.
65
+ Layout/IndentationConsistency:
66
+ Enabled: true
67
+
68
+ # Two spaces, no tabs (for indentation).
69
+ Layout/IndentationWidth:
70
+ Enabled: true
71
+
72
+ Layout/LeadingCommentSpace:
73
+ Enabled: true
74
+
75
+ Layout/SpaceAfterColon:
76
+ Enabled: true
77
+
78
+ Layout/SpaceAfterComma:
79
+ Enabled: true
80
+
81
+ Layout/SpaceAfterSemicolon:
82
+ Enabled: true
83
+
84
+ Layout/SpaceAroundEqualsInParameterDefault:
85
+ Enabled: true
86
+
87
+ Layout/SpaceAroundKeyword:
88
+ Enabled: true
89
+
90
+ Layout/SpaceAroundOperators:
91
+ Enabled: true
92
+
93
+ Layout/SpaceBeforeComma:
94
+ Enabled: true
95
+
96
+ Layout/SpaceBeforeFirstArg:
97
+ Enabled: true
98
+
99
+ Style/DefWithParentheses:
100
+ Enabled: true
101
+
102
+ # Defining a method with parameters needs parentheses.
103
+ Style/MethodDefParentheses:
104
+ Enabled: true
105
+
106
+ Style/FrozenStringLiteralComment:
107
+ Enabled: true
108
+ EnforcedStyle: always
109
+
110
+ Style/RedundantFreeze:
111
+ Enabled: true
112
+
113
+ # Use `foo {}` not `foo{}`.
114
+ Layout/SpaceBeforeBlockBraces:
115
+ Enabled: true
116
+
117
+ # Use `foo { bar }` not `foo {bar}`.
118
+ Layout/SpaceInsideBlockBraces:
119
+ Enabled: true
120
+ EnforcedStyleForEmptyBraces: space
121
+
122
+ # Use `{ a: 1 }` not `{a:1}`.
123
+ Layout/SpaceInsideHashLiteralBraces:
124
+ Enabled: true
125
+
126
+ Layout/SpaceInsideParens:
127
+ Enabled: true
128
+
129
+ # Check quotes usage according to lint rule below.
130
+ Style/StringLiterals:
131
+ Enabled: true
132
+ EnforcedStyle: double_quotes
133
+
134
+ # Detect hard tabs, no hard tabs.
135
+ Layout/Tab:
136
+ Enabled: true
137
+
138
+ # Blank lines should not have any spaces.
139
+ Layout/TrailingBlankLines:
140
+ Enabled: true
141
+
142
+ # No trailing whitespace.
143
+ Layout/TrailingWhitespace:
144
+ Enabled: true
145
+
146
+ # Use quotes for string literals when they are enough.
147
+ Style/UnneededPercentQ:
148
+ Enabled: true
149
+
150
+ Lint/AmbiguousOperator:
151
+ Enabled: true
152
+
153
+ Lint/AmbiguousRegexpLiteral:
154
+ Enabled: true
155
+
156
+ Lint/ErbNewArguments:
157
+ Enabled: true
158
+
159
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
160
+ Lint/RequireParentheses:
161
+ Enabled: true
162
+
163
+ Lint/ShadowingOuterLocalVariable:
164
+ Enabled: true
165
+
166
+ Lint/StringConversionInInterpolation:
167
+ Enabled: true
168
+
169
+ Lint/UriEscapeUnescape:
170
+ Enabled: true
171
+
172
+ Lint/UselessAssignment:
173
+ Enabled: true
174
+
175
+ Lint/DeprecatedClassMethods:
176
+ Enabled: true
177
+
178
+ Style/ParenthesesAroundCondition:
179
+ Enabled: true
180
+
181
+ Style/RedundantBegin:
182
+ Enabled: true
183
+
184
+ Style/RedundantReturn:
185
+ Enabled: true
186
+ AllowMultipleReturnValues: true
187
+
188
+ Style/Semicolon:
189
+ Enabled: true
190
+ AllowAsExpressionSeparator: true
191
+
192
+ # Prefer Foo.method over Foo::method
193
+ Style/ColonMethodCall:
194
+ Enabled: true
195
+
196
+ Style/TrivialAccessors:
197
+ Enabled: true
198
+
199
+ Performance/FlatMap:
200
+ Enabled: true
201
+
202
+ Performance/RedundantMerge:
203
+ Enabled: true
204
+
205
+ Performance/StartWith:
206
+ Enabled: true
207
+
208
+ Performance/EndWith:
209
+ Enabled: true
210
+
211
+ Performance/RegexpMatch:
212
+ Enabled: true
213
+
214
+ Performance/ReverseEach:
215
+ Enabled: true
216
+
217
+ Performance/UnfreezeString:
218
+ Enabled: true
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  # Specify your gem's dependencies in aliyun-dysms.gemspec
6
8
  gemspec
data/README.md CHANGED
@@ -60,7 +60,7 @@ require 'aliyun/dysms'
60
60
  可以改为 Github 安装源,例如 Rails Gemfile 文件引用可以改为下面格式,即可正确安装。
61
61
 
62
62
  ```ruby
63
- gem 'aliyun-dysms', '0.0.1', git: 'https://github.com/kejincan0527/aliyun-dysms.git'
63
+ gem 'aliyun-dysms', '0.0.2', git: 'https://github.com/kejincan0527/aliyun-dysms.git'
64
64
  ```
65
65
 
66
66
  ## Usage 使用
data/Rakefile CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- task :default => :spec
4
+ task default: :spec
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  lib = File.expand_path("../lib", __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@@ -9,8 +10,8 @@ Gem::Specification.new do |spec|
9
10
  spec.authors = ["Wells Muker"]
10
11
  spec.email = ["wellsmuker@gmail.com"]
11
12
 
12
- spec.summary = %q{A Ruby Gem for using aliyun dysms service.}
13
- spec.description = %q{适用于阿里云官方提供的短信服务。}
13
+ spec.summary = "A Ruby Gem for using aliyun dysms service."
14
+ spec.description = "适用于阿里云官方提供的短信服务。"
14
15
  spec.homepage = "https://github.com/kejincan0527/aliyun-dysms"
15
16
  spec.license = "MIT"
16
17
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "aliyun/dysms"
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "aliyun/dysms/version"
2
4
  require "aliyunsdkcore"
3
5
 
4
6
  module Aliyun
5
7
  module Dysms
6
8
  class Configuration
7
- attr_accessor :access_key_id, :access_key_secret, :action,
9
+ attr_accessor :access_key_id, :access_key_secret, :action,
8
10
  :region_id, :sign_name, :api_version
9
11
 
10
12
  def initialize
@@ -43,6 +45,8 @@ module Aliyun
43
45
  method: "POST"
44
46
  }
45
47
  )
48
+ rescue StandardError => e
49
+ { Code: "BadRequest", Message: "Request failed: #<#{e.class}: #{e.message}>" }
46
50
  end
47
51
 
48
52
  def client
@@ -54,9 +58,7 @@ module Aliyun
54
58
  )
55
59
  end
56
60
 
57
- def response
58
- @response
59
- end
61
+ attr_reader :response
60
62
  end # class << self
61
63
  end # module Dysms
62
64
  end # module Aliyun
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aliyun
2
4
  module Dysms
3
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun-dysms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wells Muker
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
+ - ".rubocop.yml"
78
79
  - CODE_OF_CONDUCT.md
79
80
  - Gemfile
80
81
  - LICENSE.txt