Skip to content

Commit 26eb30d

Browse files
committed
👷 More GitLab CI updates
1 parent 79b9fb1 commit 26eb30d

File tree

10 files changed

+133
-165
lines changed

10 files changed

+133
-165
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export K_SOUP_COV_DO=true # Means you want code coverage
1919
# Available formats are html, xml, rcov, lcov, json, tty
2020
export K_SOUP_COV_COMMAND_NAME="RSpec Coverage"
2121
export K_SOUP_COV_FORMATTERS="html,tty"
22-
export K_SOUP_COV_MIN_BRANCH=100 # Means you want to enforce X% branch coverage
22+
export K_SOUP_COV_MIN_BRANCH=99 # Means you want to enforce X% branch coverage
2323
export K_SOUP_COV_MIN_LINE=100 # Means you want to enforce X% line coverage
2424
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
2525
export K_SOUP_COV_MULTI_FORMATTERS=true

.rubocop.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
inherit_from:
2-
- .rubocop_rspec.yml
3-
41
inherit_gem:
52
rubocop-lts: rubocop-lts.yml
63

4+
inherit_from:
5+
- .rubocop_rspec.yml
6+
77
AllCops:
88
DisplayCopNames: true # Display the name of the failing cops
99
Exclude:
@@ -12,15 +12,7 @@ AllCops:
1212
- '**/.irbrc'
1313

1414
Metrics/BlockLength:
15-
ExcludedMethods:
16-
- context
17-
- describe
18-
- it
19-
- shared_context
20-
- shared_examples
21-
- shared_examples_for
22-
- namespace
23-
- draw
15+
Enabled: false
2416

2517
Gemspec/RequiredRubyVersion:
2618
Enabled: false

.rubocop_gradual.lock

Lines changed: 56 additions & 83 deletions
Large diffs are not rendered by default.

Gemfile.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ GEM
8181
gem_bench (2.0.5)
8282
bundler (>= 1.14)
8383
version_gem (~> 1.1, >= 1.1.4)
84-
github-markup (5.0.1)
8584
hashie (5.0.0)
8685
io-console (0.8.0)
8786
irb (1.15.2)
@@ -127,7 +126,6 @@ GEM
127126
rake (13.2.1)
128127
rdoc (6.13.1)
129128
psych (>= 4.0.0)
130-
redcarpet (3.6.1)
131129
reek (6.5.0)
132130
dry-schema (~> 1.13)
133131
logger (~> 1.6)
@@ -276,13 +274,11 @@ DEPENDENCIES
276274
bundler-audit (~> 0.9.2)
277275
debug (>= 1.0.0)
278276
gem_bench (~> 2.0, >= 2.0.5)
279-
github-markup (~> 5.0, >= 5.0.1)
280277
kettle-soup-cover (~> 1.0, >= 1.0.6)
281278
nkf (~> 0.2)
282279
oauth2!
283280
rake (>= 12)
284281
rdoc (~> 6.11)
285-
redcarpet (~> 3.6)
286282
reek (~> 6.4)
287283
rexml (>= 3)
288284
rspec (>= 3)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,12 @@ You can specify custom URLs for authorization and access token, and when using a
297297

298298
```ruby
299299
client = OAuth2::Client.new(
300-
"client_id",
301-
"client_secret",
300+
"client_id",
301+
"client_secret",
302302
site: "https://example.org/nested/directory/on/your/server",
303303
authorize_url: "/jaunty/authorize/",
304-
token_url: "/stirrups/access_token")
304+
token_url: "/stirrups/access_token",
305+
)
305306
# => #<OAuth2::Client:0x00000001204c8288 @id="client_id", @secret="client_sec...
306307
client.auth_code.authorize_url(redirect_uri: "http://localhost:8080/oauth2/callback")
307308
# => "https://example.org/jaunty/authorize/?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2%2Fcallback&response_type=code"

oauth2.gemspec

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ gem_version =
1313
OAuth2::Version::VERSION
1414
end
1515

16-
1716
Gem::Specification.new do |spec|
1817
# Linux distros may package ruby gems differently,
1918
# and securely certify them independently via alternate package management systems.
@@ -31,14 +30,14 @@ Gem::Specification.new do |spec|
3130
end
3231
end
3332

34-
spec.authors = ['Peter Boling', 'Erik Michaels-Ober', 'Michael Bleigh']
35-
spec.summary = 'OAuth 2.0 Core Ruby implementation'
36-
spec.description = 'A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth spec.'
37-
38-
spec.homepage = 'https://gitlab.com/oauth-xx/oauth2'
39-
spec.licenses = 'MIT'
40-
spec.name = 'oauth2'
41-
spec.required_ruby_version = '>= 2.2.0'
33+
spec.authors = ["Peter Boling", "Erik Michaels-Ober", "Michael Bleigh"]
34+
spec.summary = "OAuth 2.0 Core Ruby implementation"
35+
spec.description = "A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth spec."
36+
37+
spec.homepage = "https://gitlab.com/oauth-xx/oauth2"
38+
spec.licenses = "MIT"
39+
spec.name = "oauth2"
40+
spec.required_ruby_version = ">= 2.2.0"
4241
spec.version = gem_version
4342
spec.post_install_message = %{
4443
You have installed oauth2 version #{gem_version}, congratulations!
@@ -76,16 +75,16 @@ Please report issues, and star the project!
7675
Thanks, |7eter l-|. l3oling
7776
}
7877

79-
spec.metadata['homepage_uri'] = spec.homepage
80-
spec.metadata['source_code_uri'] = "#{spec.homepage}/-/tree/v#{spec.version}"
81-
spec.metadata['changelog_uri'] = "#{spec.homepage}/-/blob/v#{spec.version}/CHANGELOG.md"
82-
spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/-/issues"
83-
spec.metadata['documentation_uri'] = "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}"
84-
spec.metadata['wiki_uri'] = "#{spec.homepage}/-/wiki"
85-
spec.metadata['mailing_list_uri'] = 'https://groups.google.com/g/oauth-ruby'
78+
spec.metadata["homepage_uri"] = spec.homepage
79+
spec.metadata["source_code_uri"] = "#{spec.homepage}/-/tree/v#{spec.version}"
80+
spec.metadata["changelog_uri"] = "#{spec.homepage}/-/blob/v#{spec.version}/CHANGELOG.md"
81+
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/-/issues"
82+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}"
83+
spec.metadata["wiki_uri"] = "#{spec.homepage}/-/wiki"
84+
spec.metadata["mailing_list_uri"] = "https://groups.google.com/g/oauth-ruby"
8685
spec.metadata["news_uri"] = "https://www.railsbling.com/tags/#{spec.name}"
87-
spec.metadata['funding_uri'] = 'https://liberapay.com/pboling'
88-
spec.metadata['rubygems_mfa_required'] = 'true'
86+
spec.metadata["funding_uri"] = "https://liberapay.com/pboling"
87+
spec.metadata["rubygems_mfa_required"] = "true"
8988

9089
# Specify which files should be added to the gem when it is released.
9190
spec.files = Dir[
@@ -115,22 +114,22 @@ Thanks, |7eter l-|. l3oling
115114
spec.bindir = "exe"
116115
spec.executables = []
117116

118-
spec.add_dependency 'faraday', ['>= 0.17.3', '< 3.0']
119-
spec.add_dependency 'jwt', ['>= 1.0', '< 3.0']
120-
spec.add_dependency 'multi_xml', '~> 0.5'
121-
spec.add_dependency 'rack', ['>= 1.2', '< 4']
122-
spec.add_dependency 'snaky_hash', '~> 2.0'
117+
spec.add_dependency("faraday", [">= 0.17.3", "< 3.0"])
118+
spec.add_dependency("jwt", [">= 1.0", "< 3.0"])
119+
spec.add_dependency("multi_xml", "~> 0.5")
120+
spec.add_dependency("rack", [">= 1.2", "< 4"])
121+
spec.add_dependency("snaky_hash", "~> 2.0")
123122
spec.add_dependency("version_gem", ">= 1.1.8", "< 3") # Ruby >= 2.2.0
124123

125-
spec.add_development_dependency 'addressable', '>= 2'
126-
spec.add_development_dependency 'backports', '>= 3'
127-
spec.add_development_dependency 'nkf', '~> 0.2'
128-
spec.add_development_dependency 'rake', '>= 12'
129-
spec.add_development_dependency 'rexml', '>= 3'
130-
spec.add_development_dependency 'rspec', '>= 3'
131-
spec.add_development_dependency 'rspec-block_is_expected'
132-
spec.add_development_dependency 'rspec-pending_for'
133-
spec.add_development_dependency 'rspec-stubbed_env'
134-
spec.add_development_dependency 'rubocop-lts', '~> 8.0'
135-
spec.add_development_dependency 'silent_stream'
124+
spec.add_development_dependency("addressable", ">= 2")
125+
spec.add_development_dependency("backports", ">= 3")
126+
spec.add_development_dependency("nkf", "~> 0.2")
127+
spec.add_development_dependency("rake", ">= 12")
128+
spec.add_development_dependency("rexml", ">= 3")
129+
spec.add_development_dependency("rspec", ">= 3")
130+
spec.add_development_dependency("rspec-block_is_expected")
131+
spec.add_development_dependency("rspec-pending_for")
132+
spec.add_development_dependency("rspec-stubbed_env")
133+
spec.add_development_dependency("rubocop-lts", "~> 8.0")
134+
spec.add_development_dependency("silent_stream")
136135
end

spec/config/debug.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
puts "LOADING DEBUGGER: #{load_debugger}" if load_debugger
44

5-
require "debug" if load_debugger
5+
require "debug" if load_debugger

spec/oauth2/access_token_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ def assert_initialized_token(target)
216216
let(:token) { "" }
217217

218218
it "raises on initialize" do
219-
block_is_expected.to raise_error(OAuth2::Error, {:mode=>:this_is_bad, :raise_errors=>true}.to_s)
219+
block_is_expected.to raise_error(OAuth2::Error, {mode: :this_is_bad, raise_errors: true}.to_s)
220220
end
221221
end
222222

223223
context "when there is nil token" do
224224
let(:token) { nil }
225225

226226
it "raises on initialize" do
227-
block_is_expected.to raise_error(OAuth2::Error, {:mode=>:this_is_bad, :raise_errors=>true}.to_s)
227+
block_is_expected.to raise_error(OAuth2::Error, {mode: :this_is_bad, raise_errors: true}.to_s)
228228
end
229229
end
230230
end
@@ -412,7 +412,7 @@ def assert_initialized_token(target)
412412

413413
context "when there is no refresh_token" do
414414
it "raises on initialize" do
415-
block_is_expected.to raise_error(OAuth2::Error, {:raise_errors=>true}.to_s)
415+
block_is_expected.to raise_error(OAuth2::Error, {raise_errors: true}.to_s)
416416
end
417417
end
418418

@@ -438,7 +438,7 @@ def assert_initialized_token(target)
438438

439439
context "when there is no refresh_token" do
440440
it "raises on initialize" do
441-
block_is_expected.to raise_error(OAuth2::Error, {:raise_errors=>true}.to_s)
441+
block_is_expected.to raise_error(OAuth2::Error, {raise_errors: true}.to_s)
442442
end
443443
end
444444

spec/oauth2/authenticator_spec.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
it "filters secret by default" do
129129
expect(described_class.filtered_attribute_names).to include(:secret)
130130
end
131+
131132
it "filters out the @secret value" do
132133
expect(subject.inspect).to include("@secret=[FILTERED]")
133134
end
@@ -137,31 +138,37 @@
137138
@original_filter = described_class.filtered_attribute_names
138139
described_class.filtered_attributes :vanilla
139140
end
141+
142+
after do
143+
described_class.filtered_attributes(*@original_filter)
144+
end
145+
140146
it "changes the filter" do
141147
expect(described_class.filtered_attribute_names).to eq([:vanilla])
142148
end
149+
143150
it "does not filter out the @secret value" do
144151
expect(subject.inspect).to include("@secret=\"bar\"")
145152
end
146-
after do
147-
described_class.filtered_attributes(*@original_filter)
148-
end
149153
end
150154

151155
context "when filter is empty" do
152156
before do
153157
@original_filter = described_class.filtered_attribute_names
154158
described_class.filtered_attributes
155159
end
160+
161+
after do
162+
described_class.filtered_attributes(*@original_filter)
163+
end
164+
156165
it "changes the filter" do
157166
expect(described_class.filtered_attribute_names).to eq([])
158167
end
168+
159169
it "does not filter out the @secret value" do
160170
expect(subject.inspect).to include("@secret=\"bar\"")
161171
end
162-
after do
163-
described_class.filtered_attributes(*@original_filter)
164-
end
165172
end
166173
end
167174
end

spec/oauth2/error_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def to_str
176176
end
177177

178178
it "just returns the thing if it can" do
179-
expect(subject.message).to eq({:hello=>:world}.to_s)
179+
expect(subject.message).to eq({hello: :world}.to_s)
180180
end
181181
end
182182
end
@@ -451,7 +451,7 @@ def to_str
451451
expect(subject.message.each_line.to_a).to eq(
452452
[
453453
"i_am_a_teapot: Short and stout\n",
454-
{:text=>"Coffee brewing failed", "error_description"=>"Short and stout", "error"=>"i_am_a_teapot"}.to_s,
454+
{:text => "Coffee brewing failed", "error_description" => "Short and stout", "error" => "i_am_a_teapot"}.to_s,
455455
],
456456
)
457457
end
@@ -466,11 +466,11 @@ def to_str
466466

467467
it "just returns whatever it can" do
468468
expect(subject.message.each_line.to_a).to eq(
469-
[
470-
"i_am_a_teapot: Short and stout\n",
471-
{:hello=>:world, "error_description"=>"Short and stout", "error"=>"i_am_a_teapot"}.to_s
472-
]
473-
)
469+
[
470+
"i_am_a_teapot: Short and stout\n",
471+
{:hello => :world, "error_description" => "Short and stout", "error" => "i_am_a_teapot"}.to_s,
472+
],
473+
)
474474
end
475475
end
476476
end
@@ -484,7 +484,7 @@ def to_str
484484
end
485485

486486
it "just returns the thing if it can" do
487-
expect(subject.message).to eq({:hello=>:world}.to_s)
487+
expect(subject.message).to eq({hello: :world}.to_s)
488488
end
489489
end
490490

@@ -496,7 +496,7 @@ def to_str
496496

497497
it "does not prepend anything to the message" do
498498
expect(subject.message.lines.count).to eq(1)
499-
expect(subject.message).to eq({:text=>"Coffee brewing failed"}.to_s)
499+
expect(subject.message).to eq({text: "Coffee brewing failed"}.to_s)
500500
end
501501

502502
it "does not set code" do
@@ -519,7 +519,7 @@ def to_str
519519
expect(subject.message.each_line.to_a).to eq(
520520
[
521521
"i_am_a_teapot: Short and stout\n",
522-
{:text=>"Coffee brewing failed", "error_description"=>"Short and stout", "error"=>"i_am_a_teapot", "status"=>"418"}.to_s,
522+
{:text => "Coffee brewing failed", "error_description" => "Short and stout", "error" => "i_am_a_teapot", "status" => "418"}.to_s,
523523
],
524524
)
525525
end
@@ -552,7 +552,7 @@ def to_str
552552
expect(subject.message.each_line.to_a).to eq(
553553
[
554554
"i_am_a_teapot: \n",
555-
{:text=>"Coffee brewing failed", "error"=>"i_am_a_teapot", "status"=>"418"}.to_s,
555+
{:text => "Coffee brewing failed", "error" => "i_am_a_teapot", "status" => "418"}.to_s,
556556
],
557557
)
558558
end
@@ -568,7 +568,7 @@ def to_str
568568
expect(subject.message.each_line.to_a).to eq(
569569
[
570570
"Short and stout\n",
571-
{:text=>"Coffee brewing failed", "error_description"=>"Short and stout"}.to_s,
571+
{:text => "Coffee brewing failed", "error_description" => "Short and stout"}.to_s,
572572
],
573573
)
574574
end
@@ -584,11 +584,11 @@ def to_str
584584

585585
it "does not try to encode the message string" do
586586
expect(subject.message.each_line.to_a).to eq(
587-
[
588-
"Short and stout\n",
589-
{:text=>"Coffee brewing failed", "error_description"=>"Short and stout"}.to_s
590-
]
591-
)
587+
[
588+
"Short and stout\n",
589+
{:text => "Coffee brewing failed", "error_description" => "Short and stout"}.to_s,
590+
],
591+
)
592592
end
593593
end
594594

0 commit comments

Comments
 (0)