Skip to content

Commit

Permalink
Merge pull request #32 from texpert/restrict-ruby-to-at-least-3-1
Browse files Browse the repository at this point in the history
Restrict Ruby minimal version to 3.1
  • Loading branch information
texpert authored Aug 25, 2024
2 parents 09b98ce + f5d5e1f commit faa5851
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 2.6

- ruby: 2.7

- ruby: 3.0

- ruby: 3.1
- ruby: 3.2
- ruby: 3.3
- ruby: head

name: ruby ${{ matrix.ruby }}

Expand Down
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require:
- rubocop-performance
- rubocop-rake
- rubocop-rspec

inherit_from:
Expand All @@ -24,7 +25,7 @@ AllCops:
# Additional cops that do not reference a style guide rule may be enabled by
# default. Change behavior by overriding StyleGuideCopsOnly, or by giving
# the --only-guide-cops option.
TargetRubyVersion: 2.6
TargetRubyVersion: 3.1

Layout/LineLength:
Max: 120
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 2.7.7
ruby 3.3.4
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in ngrok-wrapper.gemspec
gemspec

gem 'github_changelog_generator', git: 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'rake'
gem 'rspec'
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'simplecov', require: false, group: :test
3 changes: 3 additions & 0 deletions disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RSpec/BeEql:
RSpec/ExampleLength:
Enabled: false

RSpec/PredicateMatcher:
Enabled: false

RSpec/ExpectInHook:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion lib/ngrok/wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def start(params = {})
# Attempt to read the attributes of an existing process instead of starting a new process.
try_params_from_running_ngrok if persistent_ngrok

spawn_new_ngrok(persistent_ngrok: persistent_ngrok) if stopped?
spawn_new_ngrok(persistent_ngrok:) if stopped?

@status = :running
if persistent_ngrok
Expand Down
9 changes: 1 addition & 8 deletions ngrok-wrapper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.summary = 'Ngrok-wrapper gem is a ruby wrapper for ngrok2'
spec.description = 'Ngrok-wrapper gem is a ruby wrapper for ngrok2'
spec.homepage = 'https://github.com/texpert/ngrok-wrapper'
spec.required_ruby_version = '>= 2.6.0'
spec.required_ruby_version = '>= 3.1.0'
spec.license = 'MIT'

spec.metadata['rubygems_mfa_required'] = 'true'
Expand All @@ -26,11 +26,4 @@ Gem::Specification.new do |spec|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = `git ls-files -z`.split("\x0")
spec.require_paths = ['lib']

spec.add_development_dependency 'github_changelog_generator'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-performance'
spec.add_development_dependency 'rubocop-rspec'
end
10 changes: 5 additions & 5 deletions spec/ngrok/wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@

it 'maps port param to addr' do
port = 10_010
Ngrok::Wrapper.start(port: port)
Ngrok::Wrapper.start(port:)
expect(Ngrok::Wrapper.addr).to eq port
end

it 'returns just the port when the address contains a host' do
addr = '192.168.0.5:10010'
Ngrok::Wrapper.start(addr: addr)
Ngrok::Wrapper.start(addr:)
expect(Ngrok::Wrapper.port).to eq 10_010
end

it 'supports remote addresses' do
addr = '192.168.0.5:10010'
Ngrok::Wrapper.start(addr: addr)
Ngrok::Wrapper.start(addr:)
expect(Ngrok::Wrapper.addr).to eq addr
end
end
Expand All @@ -154,7 +154,7 @@

it 'includes the -region parameter with the correct value when it is provided' do
region = 'eu'
Ngrok::Wrapper.start(region: region)
Ngrok::Wrapper.start(region:)
expect(Ngrok::Wrapper.__send__(:ngrok_exec_params)).to include("-region=#{region}")
end
end
Expand Down Expand Up @@ -198,7 +198,7 @@
it 'includes the -host-header parameter with the correct value when it is provided' do
expect(Ngrok::Wrapper).to receive(:fetch_urls)
host_header = 'foo.bar'
Ngrok::Wrapper.start(host_header: host_header)
Ngrok::Wrapper.start(host_header:)
expect(Ngrok::Wrapper.__send__(:ngrok_exec_params)).to include("-host-header=#{host_header}")
end
end
Expand Down

0 comments on commit faa5851

Please sign in to comment.