shipcloud 0.6.0 → 0.11.0
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 +5 -5
- data/.codeclimate.yml +1 -0
- data/.hound.yml +1 -1
- data/.rubocop.yml +713 -2
- data/.ruby-version +1 -0
- data/.travis.yml +18 -6
- data/CHANGELOG.md +70 -0
- data/README.md +76 -8
- data/bin/rubocop +29 -0
- data/install-cc-test-reporter.sh +4 -0
- data/lib/shipcloud.rb +28 -14
- data/lib/shipcloud/address.rb +2 -1
- data/lib/shipcloud/operations/all.rb +12 -2
- data/lib/shipcloud/operations/create.rb +10 -2
- data/lib/shipcloud/operations/delete.rb +10 -2
- data/lib/shipcloud/operations/find.rb +10 -2
- data/lib/shipcloud/operations/update.rb +12 -4
- data/lib/shipcloud/pickup_request.rb +12 -0
- data/lib/shipcloud/request/base.rb +14 -10
- data/lib/shipcloud/request/connection.rb +18 -12
- data/lib/shipcloud/request/info.rb +7 -5
- data/lib/shipcloud/shipcloud_error.rb +70 -0
- data/lib/shipcloud/shipment.rb +3 -2
- data/lib/shipcloud/tracker.rb +13 -0
- data/lib/shipcloud/version.rb +1 -1
- data/lib/shipcloud/webhook.rb +2 -1
- data/shipcloud.gemspec +9 -8
- data/spec/shipcloud/address_spec.rb +114 -43
- data/spec/shipcloud/carrier_spec.rb +12 -5
- data/spec/shipcloud/pickup_request_spec.rb +136 -0
- data/spec/shipcloud/request/base_spec.rb +51 -13
- data/spec/shipcloud/request/connection_spec.rb +3 -3
- data/spec/shipcloud/request/info_spec.rb +34 -0
- data/spec/shipcloud/shipcloud_error_spec.rb +125 -0
- data/spec/shipcloud/shipment_quote_spec.rb +14 -1
- data/spec/shipcloud/shipment_spec.rb +126 -11
- data/spec/shipcloud/tracker_spec.rb +141 -0
- data/spec/shipcloud/webhooks_spec.rb +70 -6
- data/spec/shipcloud_spec.rb +82 -20
- data/spec/spec_helper.rb +2 -2
- metadata +55 -43
- data/.ruby-style.yml +0 -240
- data/lib/shipcloud/request/validator.rb +0 -33
- data/spec/shipcloud/request/validator_spec.rb +0 -24
data/spec/shipcloud_spec.rb
CHANGED
@@ -16,74 +16,136 @@ describe Shipcloud do
|
|
16
16
|
|
17
17
|
it "attempts to get a url with one param" do
|
18
18
|
Shipcloud.request(:get, "transactions", { param_name: "param_value" })
|
19
|
-
|
19
|
+
|
20
|
+
expect(WebMock).to have_requested(:get, "#{api_url}/transactions?param_name=param_value")
|
20
21
|
end
|
21
22
|
|
22
23
|
it "attempts to get a url with more than one param" do
|
23
24
|
Shipcloud.request(:get, "transactions", { client: "client_id", order: "created_at_desc" })
|
24
|
-
|
25
|
+
|
26
|
+
expect(WebMock).
|
27
|
+
to have_requested(:get, "#{api_url}/transactions?client=client_id&order=created_at_desc")
|
25
28
|
end
|
26
29
|
|
27
30
|
it "doesn't add a question mark if no params" do
|
28
31
|
Shipcloud.request(:get, "transactions", {})
|
29
|
-
WebMock.
|
32
|
+
expect(WebMock).to have_requested(:get, "#{api_url}/transactions")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "with an api key passed in as an argument" do
|
37
|
+
it "uses the given api key instead of the global one" do
|
38
|
+
WebMock.stub_request(:any, /#{Shipcloud.configuration.api_base}/).to_return(body: "{}")
|
39
|
+
Shipcloud.api_key = "global-api-key"
|
40
|
+
|
41
|
+
Shipcloud.request(:get, "transactions", {}, api_key: "123")
|
42
|
+
|
43
|
+
expect(WebMock).to have_requested(
|
44
|
+
:get,
|
45
|
+
"#{api_url}/transactions",
|
46
|
+
).with(
|
47
|
+
headers: {
|
48
|
+
"Authorization" => "Basic #{Base64.strict_encode64('123:').chomp}",
|
49
|
+
},
|
50
|
+
)
|
30
51
|
end
|
31
52
|
end
|
32
53
|
end
|
33
54
|
|
34
|
-
describe
|
55
|
+
describe ".configure" do
|
35
56
|
before :each do
|
36
57
|
Shipcloud.configuration = nil
|
37
58
|
end
|
38
59
|
|
39
|
-
it
|
60
|
+
it "defaults api_key to nil" do
|
40
61
|
expect(Shipcloud.configuration.api_key).to be_nil
|
41
62
|
end
|
42
63
|
|
43
|
-
it
|
64
|
+
it "sets the api_key" do
|
44
65
|
Shipcloud.configure do |config|
|
45
|
-
config.api_key =
|
66
|
+
config.api_key = "your-api-key"
|
46
67
|
end
|
47
|
-
expect(Shipcloud.configuration.api_key).to eq
|
68
|
+
expect(Shipcloud.configuration.api_key).to eq "your-api-key"
|
48
69
|
end
|
49
70
|
|
50
|
-
it
|
51
|
-
Shipcloud.api_key =
|
52
|
-
expect(Shipcloud.api_key).to eq
|
53
|
-
expect(Shipcloud.configuration.api_key).to eq
|
71
|
+
it "gets the api key, set as a class variable (DEPRECATED)" do
|
72
|
+
Shipcloud.api_key = "old-school-api-key"
|
73
|
+
expect(Shipcloud.api_key).to eq "old-school-api-key"
|
74
|
+
expect(Shipcloud.configuration.api_key).to eq "old-school-api-key"
|
54
75
|
end
|
55
76
|
|
56
77
|
it "defaults api_base to 'api.shipcloud.io'" do
|
57
|
-
expect(Shipcloud.configuration.api_base).to eq
|
78
|
+
expect(Shipcloud.configuration.api_base).to eq "api.shipcloud.io"
|
58
79
|
end
|
59
80
|
|
60
|
-
it
|
81
|
+
it "overwrites the default api base" do
|
61
82
|
Shipcloud.configure do |config|
|
62
|
-
config.api_base =
|
83
|
+
config.api_base = "api.shipcloud.dev"
|
63
84
|
end
|
64
|
-
expect(Shipcloud.configuration.api_base).to eq
|
85
|
+
expect(Shipcloud.configuration.api_base).to eq "api.shipcloud.dev"
|
65
86
|
end
|
66
87
|
|
67
|
-
it
|
88
|
+
it "defaults use_ssl to true" do
|
68
89
|
expect(Shipcloud.configuration.use_ssl).to be true
|
69
90
|
end
|
70
91
|
|
71
|
-
it
|
92
|
+
it "overwrites the default ssl mode" do
|
72
93
|
Shipcloud.configure do |config|
|
73
94
|
config.use_ssl = false
|
74
95
|
end
|
75
96
|
expect(Shipcloud.configuration.use_ssl).to be false
|
76
97
|
end
|
77
98
|
|
78
|
-
it
|
99
|
+
it "defaults debug to false" do
|
79
100
|
expect(Shipcloud.configuration.debug).to be false
|
80
101
|
end
|
81
102
|
|
82
|
-
it
|
103
|
+
it "overwrites the default debug mode" do
|
83
104
|
Shipcloud.configure do |config|
|
84
105
|
config.debug = true
|
85
106
|
end
|
86
107
|
expect(Shipcloud.configuration.debug).to be true
|
87
108
|
end
|
109
|
+
|
110
|
+
it "defaults affiliate_id to nil" do
|
111
|
+
expect(Shipcloud.configuration.affiliate_id).to be_nil
|
112
|
+
end
|
113
|
+
|
114
|
+
it "sets and gets the affiliate_id" do
|
115
|
+
Shipcloud.configure do |config|
|
116
|
+
config.affiliate_id = "integration.my_rails_app.1234567"
|
117
|
+
end
|
118
|
+
|
119
|
+
expect(Shipcloud.configuration.affiliate_id).to eq "integration.my_rails_app.1234567"
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
describe ".api_headers" do
|
124
|
+
it "returns the correct api headers with default affiliate id" do
|
125
|
+
Shipcloud.configuration = nil # reset configuration
|
126
|
+
|
127
|
+
expect(Shipcloud.api_headers).to eq(
|
128
|
+
"Content-Type" => "application/json",
|
129
|
+
"User-Agent" => "shipcloud-ruby v#{Shipcloud::VERSION}, API #{Shipcloud::API_VERSION}, " \
|
130
|
+
"#{RUBY_VERSION}, #{RUBY_PLATFORM}, #{RUBY_PATCHLEVEL}",
|
131
|
+
"Affiliate-ID" => "integration.shipcloud-ruby-gem.v#{Shipcloud::VERSION}",
|
132
|
+
)
|
133
|
+
end
|
134
|
+
|
135
|
+
it "returns the correct api headers with affiliate id if configured" do
|
136
|
+
Shipcloud.configure do |config|
|
137
|
+
config.affiliate_id = "integration.my_rails_app.1234567"
|
138
|
+
end
|
139
|
+
expect(Shipcloud.api_headers).to eq(
|
140
|
+
"Content-Type" => "application/json",
|
141
|
+
"User-Agent" => "shipcloud-ruby v#{Shipcloud::VERSION}, API #{Shipcloud::API_VERSION}, " \
|
142
|
+
"#{RUBY_VERSION}, #{RUBY_PLATFORM}, #{RUBY_PATCHLEVEL}",
|
143
|
+
"Affiliate-ID" => "integration.my_rails_app.1234567",
|
144
|
+
)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def api_url
|
149
|
+
"https://#{Shipcloud.configuration.api_base}/#{Shipcloud::API_VERSION}"
|
88
150
|
end
|
89
151
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,22 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shipcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sthollmann
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.8'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.8.0
|
@@ -24,90 +21,81 @@ dependencies:
|
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.8'
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
26
|
version: 1.8.0
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: pry
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 1.3.0
|
40
|
-
- - "<"
|
31
|
+
- - "~>"
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
33
|
+
version: '0.10'
|
43
34
|
type: :development
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.3.0
|
50
|
-
- - "<"
|
38
|
+
- - "~>"
|
51
39
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
40
|
+
version: '0.10'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: rake
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
56
44
|
requirements:
|
57
45
|
- - "~>"
|
58
46
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
47
|
+
version: '12.0'
|
60
48
|
type: :development
|
61
49
|
prerelease: false
|
62
50
|
version_requirements: !ruby/object:Gem::Requirement
|
63
51
|
requirements:
|
64
52
|
- - "~>"
|
65
53
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
54
|
+
version: '12.0'
|
67
55
|
- !ruby/object:Gem::Dependency
|
68
56
|
name: rspec
|
69
57
|
requirement: !ruby/object:Gem::Requirement
|
70
58
|
requirements:
|
71
59
|
- - "~>"
|
72
60
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
61
|
+
version: '3.6'
|
74
62
|
type: :development
|
75
63
|
prerelease: false
|
76
64
|
version_requirements: !ruby/object:Gem::Requirement
|
77
65
|
requirements:
|
78
66
|
- - "~>"
|
79
67
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
68
|
+
version: '3.6'
|
81
69
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
70
|
+
name: rubocop
|
83
71
|
requirement: !ruby/object:Gem::Requirement
|
84
72
|
requirements:
|
85
73
|
- - "~>"
|
86
74
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
75
|
+
version: 0.71.0
|
88
76
|
type: :development
|
89
77
|
prerelease: false
|
90
78
|
version_requirements: !ruby/object:Gem::Requirement
|
91
79
|
requirements:
|
92
80
|
- - "~>"
|
93
81
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
82
|
+
version: 0.71.0
|
95
83
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
84
|
+
name: rubocop-performance
|
97
85
|
requirement: !ruby/object:Gem::Requirement
|
98
86
|
requirements:
|
99
|
-
- - "
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
|
-
version: '0
|
89
|
+
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
93
|
requirements:
|
106
|
-
- - "
|
94
|
+
- - ">="
|
107
95
|
- !ruby/object:Gem::Version
|
108
|
-
version: '0
|
96
|
+
version: '0'
|
109
97
|
- !ruby/object:Gem::Dependency
|
110
|
-
name:
|
98
|
+
name: simplecov
|
111
99
|
requirement: !ruby/object:Gem::Requirement
|
112
100
|
requirements:
|
113
101
|
- - ">="
|
@@ -120,10 +108,25 @@ dependencies:
|
|
120
108
|
- - ">="
|
121
109
|
- !ruby/object:Gem::Version
|
122
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.0'
|
123
125
|
description: A wrapper for the shipcloud API. Fore more details visit https://developers.shipcloud.io/
|
124
126
|
email:
|
125
127
|
- stefan@shipcloud.io
|
126
|
-
executables:
|
128
|
+
executables:
|
129
|
+
- rubocop
|
127
130
|
extensions: []
|
128
131
|
extra_rdoc_files: []
|
129
132
|
files:
|
@@ -132,13 +135,15 @@ files:
|
|
132
135
|
- ".hound.yml"
|
133
136
|
- ".rspec"
|
134
137
|
- ".rubocop.yml"
|
135
|
-
- ".ruby-
|
138
|
+
- ".ruby-version"
|
136
139
|
- ".travis.yml"
|
137
140
|
- CHANGELOG.md
|
138
141
|
- Gemfile
|
139
142
|
- LICENSE.txt
|
140
143
|
- README.md
|
141
144
|
- Rakefile
|
145
|
+
- bin/rubocop
|
146
|
+
- install-cc-test-reporter.sh
|
142
147
|
- lib/shipcloud.rb
|
143
148
|
- lib/shipcloud/address.rb
|
144
149
|
- lib/shipcloud/base.rb
|
@@ -148,22 +153,27 @@ files:
|
|
148
153
|
- lib/shipcloud/operations/delete.rb
|
149
154
|
- lib/shipcloud/operations/find.rb
|
150
155
|
- lib/shipcloud/operations/update.rb
|
156
|
+
- lib/shipcloud/pickup_request.rb
|
151
157
|
- lib/shipcloud/request/base.rb
|
152
158
|
- lib/shipcloud/request/connection.rb
|
153
159
|
- lib/shipcloud/request/info.rb
|
154
|
-
- lib/shipcloud/
|
160
|
+
- lib/shipcloud/shipcloud_error.rb
|
155
161
|
- lib/shipcloud/shipment.rb
|
156
162
|
- lib/shipcloud/shipment_quote.rb
|
163
|
+
- lib/shipcloud/tracker.rb
|
157
164
|
- lib/shipcloud/version.rb
|
158
165
|
- lib/shipcloud/webhook.rb
|
159
166
|
- shipcloud.gemspec
|
160
167
|
- spec/shipcloud/address_spec.rb
|
161
168
|
- spec/shipcloud/carrier_spec.rb
|
169
|
+
- spec/shipcloud/pickup_request_spec.rb
|
162
170
|
- spec/shipcloud/request/base_spec.rb
|
163
171
|
- spec/shipcloud/request/connection_spec.rb
|
164
|
-
- spec/shipcloud/request/
|
172
|
+
- spec/shipcloud/request/info_spec.rb
|
173
|
+
- spec/shipcloud/shipcloud_error_spec.rb
|
165
174
|
- spec/shipcloud/shipment_quote_spec.rb
|
166
175
|
- spec/shipcloud/shipment_spec.rb
|
176
|
+
- spec/shipcloud/tracker_spec.rb
|
167
177
|
- spec/shipcloud/webhooks_spec.rb
|
168
178
|
- spec/shipcloud_spec.rb
|
169
179
|
- spec/spec_helper.rb
|
@@ -171,7 +181,7 @@ homepage: https://github.com/shipcloud/shipcloud-ruby
|
|
171
181
|
licenses:
|
172
182
|
- MIT
|
173
183
|
metadata: {}
|
174
|
-
post_install_message:
|
184
|
+
post_install_message:
|
175
185
|
rdoc_options: []
|
176
186
|
require_paths:
|
177
187
|
- lib
|
@@ -179,26 +189,28 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
189
|
requirements:
|
180
190
|
- - ">="
|
181
191
|
- !ruby/object:Gem::Version
|
182
|
-
version: '2.
|
192
|
+
version: '2.3'
|
183
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
194
|
requirements:
|
185
195
|
- - ">="
|
186
196
|
- !ruby/object:Gem::Version
|
187
197
|
version: '0'
|
188
198
|
requirements: []
|
189
|
-
|
190
|
-
|
191
|
-
signing_key:
|
199
|
+
rubygems_version: 3.0.3
|
200
|
+
signing_key:
|
192
201
|
specification_version: 4
|
193
202
|
summary: A wrapper for the shipcloud API
|
194
203
|
test_files:
|
195
204
|
- spec/shipcloud/address_spec.rb
|
196
205
|
- spec/shipcloud/carrier_spec.rb
|
206
|
+
- spec/shipcloud/pickup_request_spec.rb
|
197
207
|
- spec/shipcloud/request/base_spec.rb
|
198
208
|
- spec/shipcloud/request/connection_spec.rb
|
199
|
-
- spec/shipcloud/request/
|
209
|
+
- spec/shipcloud/request/info_spec.rb
|
210
|
+
- spec/shipcloud/shipcloud_error_spec.rb
|
200
211
|
- spec/shipcloud/shipment_quote_spec.rb
|
201
212
|
- spec/shipcloud/shipment_spec.rb
|
213
|
+
- spec/shipcloud/tracker_spec.rb
|
202
214
|
- spec/shipcloud/webhooks_spec.rb
|
203
215
|
- spec/shipcloud_spec.rb
|
204
216
|
- spec/spec_helper.rb
|
data/.ruby-style.yml
DELETED
@@ -1,240 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
RunRailsCops: true
|
3
|
-
Exclude:
|
4
|
-
- "vendor/**/*"
|
5
|
-
- "db/schema.rb"
|
6
|
-
UseCache: false
|
7
|
-
Rails/FindBy:
|
8
|
-
Enabled: false
|
9
|
-
Metrics/LineLength:
|
10
|
-
Max: 100
|
11
|
-
Style/CollectionMethods:
|
12
|
-
Description: Preferred collection methods.
|
13
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
14
|
-
Enabled: true
|
15
|
-
PreferredMethods:
|
16
|
-
collect: map
|
17
|
-
collect!: map!
|
18
|
-
find: detect
|
19
|
-
find_all: select
|
20
|
-
reduce: inject
|
21
|
-
Style/DotPosition:
|
22
|
-
Description: Checks the position of the dot in multi-line method calls.
|
23
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
24
|
-
Enabled: true
|
25
|
-
EnforcedStyle: trailing
|
26
|
-
SupportedStyles:
|
27
|
-
- trailing
|
28
|
-
Style/FileName:
|
29
|
-
Description: Use snake_case for source file names.
|
30
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
31
|
-
Enabled: false
|
32
|
-
Exclude: []
|
33
|
-
Style/GuardClause:
|
34
|
-
Description: Check for conditionals that can be replaced with guard clauses
|
35
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
36
|
-
Enabled: false
|
37
|
-
MinBodyLength: 1
|
38
|
-
Style/IfUnlessModifier:
|
39
|
-
Description: Favor modifier if/unless usage when you have a single-line body.
|
40
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
41
|
-
Enabled: false
|
42
|
-
MaxLineLength: 80
|
43
|
-
Style/OptionHash:
|
44
|
-
Description: Don't use option hashes when you can use keyword arguments.
|
45
|
-
Enabled: false
|
46
|
-
Style/PercentLiteralDelimiters:
|
47
|
-
Description: Use `%`-literal delimiters consistently
|
48
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
49
|
-
Enabled: false
|
50
|
-
PreferredDelimiters:
|
51
|
-
"%": "()"
|
52
|
-
"%i": "()"
|
53
|
-
"%q": "()"
|
54
|
-
"%Q": "()"
|
55
|
-
"%r": "{}"
|
56
|
-
"%s": "()"
|
57
|
-
"%w": "()"
|
58
|
-
"%W": "()"
|
59
|
-
"%x": "()"
|
60
|
-
Style/PredicateName:
|
61
|
-
Description: Check the names of predicate methods.
|
62
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
63
|
-
Enabled: true
|
64
|
-
NamePrefix:
|
65
|
-
- is_
|
66
|
-
- has_
|
67
|
-
- have_
|
68
|
-
NamePrefixBlacklist:
|
69
|
-
- is_
|
70
|
-
Exclude:
|
71
|
-
- spec/**/*
|
72
|
-
Style/RaiseArgs:
|
73
|
-
Description: Checks the arguments passed to raise/fail.
|
74
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
75
|
-
Enabled: false
|
76
|
-
EnforcedStyle: exploded
|
77
|
-
SupportedStyles:
|
78
|
-
- compact
|
79
|
-
- exploded
|
80
|
-
Style/SignalException:
|
81
|
-
Description: Checks for proper usage of fail and raise.
|
82
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
83
|
-
Enabled: false
|
84
|
-
EnforcedStyle: semantic
|
85
|
-
SupportedStyles:
|
86
|
-
- only_raise
|
87
|
-
- only_fail
|
88
|
-
- semantic
|
89
|
-
Style/SingleLineBlockParams:
|
90
|
-
Description: Enforces the names of some block params.
|
91
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
92
|
-
Enabled: false
|
93
|
-
Methods:
|
94
|
-
- reduce:
|
95
|
-
- a
|
96
|
-
- e
|
97
|
-
- inject:
|
98
|
-
- a
|
99
|
-
- e
|
100
|
-
Style/SingleLineMethods:
|
101
|
-
Description: Avoid single-line methods.
|
102
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
103
|
-
Enabled: false
|
104
|
-
AllowIfMethodIsEmpty: true
|
105
|
-
Style/StringLiterals:
|
106
|
-
Description: Checks if uses of quotes match the configured preference.
|
107
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
108
|
-
Enabled: true
|
109
|
-
EnforcedStyle: double_quotes
|
110
|
-
SupportedStyles:
|
111
|
-
- single_quotes
|
112
|
-
- double_quotes
|
113
|
-
Style/StringLiteralsInInterpolation:
|
114
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
115
|
-
match the configured preference.
|
116
|
-
Enabled: true
|
117
|
-
EnforcedStyle: single_quotes
|
118
|
-
SupportedStyles:
|
119
|
-
- single_quotes
|
120
|
-
- double_quotes
|
121
|
-
Style/TrailingComma:
|
122
|
-
Description: Checks for trailing comma in parameter lists and literals.
|
123
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
124
|
-
Enabled: false
|
125
|
-
EnforcedStyleForMultiline: no_comma
|
126
|
-
SupportedStyles:
|
127
|
-
- comma
|
128
|
-
Metrics/AbcSize:
|
129
|
-
Description: A calculated magnitude based on number of assignments, branches, and
|
130
|
-
conditions.
|
131
|
-
Enabled: false
|
132
|
-
Max: 15
|
133
|
-
Metrics/ClassLength:
|
134
|
-
Description: Avoid classes longer than 100 lines of code.
|
135
|
-
Enabled: false
|
136
|
-
CountComments: false
|
137
|
-
Max: 100
|
138
|
-
Metrics/ModuleLength:
|
139
|
-
CountComments: false
|
140
|
-
Max: 100
|
141
|
-
Description: Avoid modules longer than 100 lines of code.
|
142
|
-
Enabled: false
|
143
|
-
Metrics/CyclomaticComplexity:
|
144
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
145
|
-
cases needed to validate a method.
|
146
|
-
Enabled: false
|
147
|
-
Max: 6
|
148
|
-
Metrics/MethodLength:
|
149
|
-
Description: Avoid methods longer than 10 lines of code.
|
150
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
151
|
-
Enabled: false
|
152
|
-
CountComments: false
|
153
|
-
Max: 10
|
154
|
-
Metrics/ParameterLists:
|
155
|
-
Description: Avoid parameter lists longer than three or four parameters.
|
156
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
157
|
-
Enabled: false
|
158
|
-
Max: 5
|
159
|
-
CountKeywordArgs: true
|
160
|
-
Metrics/PerceivedComplexity:
|
161
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
162
|
-
reader.
|
163
|
-
Enabled: false
|
164
|
-
Max: 7
|
165
|
-
Lint/AssignmentInCondition:
|
166
|
-
Description: Don't use assignment in conditions.
|
167
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
168
|
-
Enabled: false
|
169
|
-
AllowSafeAssignment: true
|
170
|
-
Style/InlineComment:
|
171
|
-
Description: Avoid inline comments.
|
172
|
-
Enabled: false
|
173
|
-
Style/AccessorMethodName:
|
174
|
-
Description: Check the naming of accessor methods for get_/set_.
|
175
|
-
Enabled: false
|
176
|
-
Style/Alias:
|
177
|
-
Description: Use alias_method instead of alias.
|
178
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
179
|
-
Enabled: false
|
180
|
-
Style/Documentation:
|
181
|
-
Description: Document classes and non-namespace modules.
|
182
|
-
Enabled: false
|
183
|
-
Style/DoubleNegation:
|
184
|
-
Description: Checks for uses of double negation (!!).
|
185
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
186
|
-
Enabled: false
|
187
|
-
Style/EachWithObject:
|
188
|
-
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
189
|
-
Enabled: false
|
190
|
-
Style/EmptyLiteral:
|
191
|
-
Description: Prefer literals to Array.new/Hash.new/String.new.
|
192
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
193
|
-
Enabled: false
|
194
|
-
Style/ModuleFunction:
|
195
|
-
Description: Checks for usage of `extend self` in modules.
|
196
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
197
|
-
Enabled: false
|
198
|
-
Style/OneLineConditional:
|
199
|
-
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
200
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
201
|
-
Enabled: false
|
202
|
-
Style/PerlBackrefs:
|
203
|
-
Description: Avoid Perl-style regex back references.
|
204
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
205
|
-
Enabled: false
|
206
|
-
Style/Send:
|
207
|
-
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
208
|
-
may overlap with existing methods.
|
209
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
210
|
-
Enabled: false
|
211
|
-
Style/SpecialGlobalVars:
|
212
|
-
Description: Avoid Perl-style global variables.
|
213
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
214
|
-
Enabled: false
|
215
|
-
Style/VariableInterpolation:
|
216
|
-
Description: Don't interpolate global, instance and class variables directly in
|
217
|
-
strings.
|
218
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
219
|
-
Enabled: false
|
220
|
-
Style/WhenThen:
|
221
|
-
Description: Use when x then ... for one-line cases.
|
222
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
223
|
-
Enabled: false
|
224
|
-
Lint/EachWithObjectArgument:
|
225
|
-
Description: Check for immutable argument given to each_with_object.
|
226
|
-
Enabled: true
|
227
|
-
Lint/EndAlignment:
|
228
|
-
Description: This cop checks whether the end keywords are aligned properly.
|
229
|
-
AlignWith: variable
|
230
|
-
Enabled: true
|
231
|
-
Lint/HandleExceptions:
|
232
|
-
Description: Don't suppress exception.
|
233
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
234
|
-
Enabled: false
|
235
|
-
Lint/LiteralInCondition:
|
236
|
-
Description: Checks of literals used in conditions.
|
237
|
-
Enabled: false
|
238
|
-
Lint/LiteralInInterpolation:
|
239
|
-
Description: Checks for literals used in interpolation.
|
240
|
-
Enabled: false
|