diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df54b7b..73024c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/.rubocop.yml b/.rubocop.yml index c8f27b6..86b1414 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: - rubocop-performance + - rubocop-rake - rubocop-rspec inherit_from: @@ -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 diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 1f7da99..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.7 diff --git a/.tool-versions b/.tool-versions index 33a8789..05668b7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 2.7.7 +ruby 3.3.4 diff --git a/Gemfile b/Gemfile index 349427a..0c4bc6a 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/disabled.yml b/disabled.yml index 2ab43f5..be1b1a4 100644 --- a/disabled.yml +++ b/disabled.yml @@ -15,6 +15,9 @@ RSpec/BeEql: RSpec/ExampleLength: Enabled: false +RSpec/PredicateMatcher: + Enabled: false + RSpec/ExpectInHook: Enabled: false diff --git a/lib/ngrok/wrapper.rb b/lib/ngrok/wrapper.rb index 468bd6a..9001515 100644 --- a/lib/ngrok/wrapper.rb +++ b/lib/ngrok/wrapper.rb @@ -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 diff --git a/ngrok-wrapper.gemspec b/ngrok-wrapper.gemspec index f77ecc1..488871b 100644 --- a/ngrok-wrapper.gemspec +++ b/ngrok-wrapper.gemspec @@ -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' @@ -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 diff --git a/spec/ngrok/wrapper_spec.rb b/spec/ngrok/wrapper_spec.rb index 2923877..a350fc6 100644 --- a/spec/ngrok/wrapper_spec.rb +++ b/spec/ngrok/wrapper_spec.rb @@ -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 @@ -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 @@ -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