From 357a6ab5ea95ee4b6008b30183f32a95864346e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Thu, 26 Oct 2023 06:50:23 +0200 Subject: [PATCH] Modernize gemspec and Gemfile files Include them under rubocop checks. Require MFA. --- .rubocop.yml | 2 -- Gemfile | 11 +++++++++++ web_pipe.gemspec | 41 +++++++++++------------------------------ 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9a9911a..55aeb88 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,9 +3,7 @@ AllCops: NewCops: enable SuggestExtensions: false Exclude: - - "*.gemspec" - vendor/**/* - - Gemfile Metrics/BlockLength: Exclude: diff --git a/Gemfile b/Gemfile index c6cf42a..8f13360 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,17 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } gemspec group :development do + gem 'dry-schema', '~> 1.0' + gem 'dry-transformer', '~> 0.1' + gem 'pry-byebug' + gem 'rack-flash3', '~> 1.0' + gem 'rack-test', '~> 1.1' + gem 'rake', '~> 12.3', '>= 12.3.3' + gem 'redcarpet', '~> 3.4' + gem 'rspec', '~> 3.0' + gem 'rubocop', '~> 1.8' + gem 'rubocop-rspec', '~> 2.1' + gem 'yard', '~> 0.9', '>= 0.9.20' # TODO: Move to gemspec when hanami-view 2.0 is available gem 'hanami-view', github: 'hanami/view', tag: 'v2.1.0.beta2' end diff --git a/web_pipe.gemspec b/web_pipe.gemspec index cade435..53d9e89 100644 --- a/web_pipe.gemspec +++ b/web_pipe.gemspec @@ -9,48 +9,29 @@ Gem::Specification.new do |spec| spec.version = WebPipe::VERSION spec.authors = ['Marc Busqué'] spec.email = ['marc@lamarciana.com'] - - spec.summary = 'Rack application builder through a pipe of operations on an immutable struct.' spec.homepage = 'https://github.com/waiting-for-dev/web_pipe' + spec.summary = 'Rack application builder through a pipe of operations on an immutable struct.' spec.licenses = ['MIT'] - # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' - # to allow pushing to a single host or delete this section to allow pushing to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = 'https://rubygems.org' + spec.metadata = { + 'bug_tracker_uri' => 'https://github.com/waiting-for-dev/web_pipe/issues', + 'changelog_uri' => 'https://github.com/waiting-for-dev/web_pipe/blob/main/CHANGELOG.md', + 'documentation_uri' => 'https://github.com/waiting-for-dev/web_pipe/blob/main/README.md', + 'funding_uri' => 'https://github.com/sponsors/waiting-for-dev', + 'label' => 'web_pipe', + 'source_code_uri' => 'https://github.com/waiting-for-dev/web_pipe', + 'rubygems_mfa_required' => 'true' + } - spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = spec.homepage - spec.metadata['changelog_uri'] = spec.homepage + '/CHANGELOG.md' - else - raise 'RubyGems 2.0 or newer is required to protect against ' \ - 'public gem pushes.' - end + spec.required_ruby_version = '>= 3.0' - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end - spec.bindir = 'exe' - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] spec.add_runtime_dependency 'dry-monads', '~> 1.3' spec.add_runtime_dependency 'dry-struct', '~> 1.0' spec.add_runtime_dependency 'dry-types', '~> 1.1' spec.add_runtime_dependency 'rack', '~> 2.0' - - spec.add_development_dependency 'bundler' - spec.add_development_dependency 'dry-schema', '~> 1.0' - spec.add_development_dependency 'dry-transformer', '~> 0.1' - spec.add_development_dependency 'pry-byebug' - spec.add_development_dependency 'rack-flash3', '~> 1.0' - spec.add_development_dependency 'rack-test', '~> 1.1' - spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3' - spec.add_development_dependency 'redcarpet', '~> 3.4' - spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'yard', '~> 0.9', '>= 0.9.20' - spec.add_development_dependency 'rubocop', '~> 1.8' - spec.add_development_dependency 'rubocop-rspec', '~> 2.1' end