Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemspec clean up #280

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
require 'rbconfig'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rbconfig doesn't appear to be used. Let's remove the require statement.

source 'https://rubygems.org'
gemspec

group :development do
gem 'yard', '~> 0.9'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move yard into the docs group below.

gem 'rake', '~> 12.0'
gem 'standard', '~> 1.21'
gem 'webrick', '~> 1.7'
Comment on lines +6 to +7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move standard and webrick dependency declaration over from the gemspec file to be grouped here with the other development dependencies.

end

group :test do
gem 'rspec', '~> 3.0', '>= 3.6.0'
gem 'rspec-its', '~> 1.2'
gem 'rack', '~> 2.0'
gem 'rack-test', '~> 0.7'
gem 'rspec', '~> 3.0', '>= 3.6.0'
gem 'rspec-its', '~> 1.2'
Comment on lines -11 to +14
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's sort dependencies in alphabetical order.

gem 'websocket_parser', '~>1.0'
end

group :docs do
platform :mri_19, :mri_20 do
gem 'redcarpet', '~> 3.4'
end
gem 'redcarpet', '~> 3.4', platform: :ruby
Copy link
Contributor Author

@orien orien Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the ruby platform to cover MRI version 3.x as well.

gem 'yard', '~> 0.9'
end

platforms :jruby do
Expand Down
10 changes: 4 additions & 6 deletions webmachine.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$:.push File.expand_path('../lib', __FILE__)
require 'webmachine/version'
require_relative 'lib/webmachine/version'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small simplification.


Gem::Specification.new do |gem|
gem.name = 'webmachine'
Expand All @@ -15,6 +14,7 @@ Gem::Specification.new do |gem|
gem.email = ['[email protected]']
gem.license = 'Apache-2.0'

gem.metadata['allowed_push_host'] = 'https://rubygems.org'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify where the gem package should be pushed upon release.

gem.metadata['bug_tracker_uri'] = "#{gem.homepage}/issues"
gem.metadata['changelog_uri'] = "#{gem.homepage}/blob/HEAD/CHANGELOG.md"
gem.metadata['documentation_uri'] = "https://www.rubydoc.info/gems/webmachine/#{gem.version}"
Expand All @@ -24,13 +24,11 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = '>= 2.6.0'

gem.add_runtime_dependency('i18n', ['>= 0.4.0'])
gem.add_runtime_dependency('multi_json')
gem.add_runtime_dependency('as-notifications', ['>= 1.0.2', '< 2.0'])
gem.add_runtime_dependency('base64')
gem.add_runtime_dependency('i18n', ['>= 0.4.0'])
gem.add_runtime_dependency('multi_json')
Comment on lines -27 to +30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order.


gem.add_development_dependency('webrick', ['~> 1.7.0'])
gem.add_development_dependency('standard', ['~> 1.21'])
Comment on lines -32 to -33
Copy link
Contributor Author

@orien orien Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to the gemfile for consistency.

ignores = File.read('.gitignore').split(/\r?\n/).reject { |f| f =~ /^(#.+|\s*)$/ }.map { |f| Dir[f] }.flatten
gem.files = (Dir['**/*', '.gitignore'] - ignores).reject do |f|
!File.file?(f) || f.start_with?(*%w[. Gemfile RELEASING Rakefile doc/ memory_test pkg/ spec/ vendor/ webmachine.gemspec])
Expand Down