From 9f73f2c6b475e0874956e3642651bb6b77090c07 Mon Sep 17 00:00:00 2001 From: Tommaso Barbato Date: Thu, 16 Jan 2020 08:08:52 +0100 Subject: [PATCH] Update gemspec file to latest style standards (#21) - Remove test_files attribute since it's deprecated and no longer used. https://github.com/rubygems/guides/issues/90#issuecomment-49213972 - Use Dir[] instead of git ls-files to specify gem files, in order to improve readability and exclude unnecessary files. - Don't include development files and RSpec tests in the built gem. --- CHANGELOG.md | 1 + rarbg.gemspec | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb0e73..71ceb4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). #### Changed - Rename attr_reader `conn` to `connection` ([#18](https://github.com/epistrephein/rarbg/pull/18)). +- Remove unnecessary files and attributes from gemspec ([#21](https://github.com/epistrephein/rarbg/pull/21)). - Update version constraints for Rake, following v13.0 release ([#15](https://github.com/epistrephein/rarbg/pull/15)). - Update version constraints for RuboCop in order to avoid breaking changes ([#16](https://github.com/epistrephein/rarbg/pull/16)). - Tweak and reorder documentation ([#18](https://github.com/epistrephein/rarbg/pull/18)). diff --git a/rarbg.gemspec b/rarbg.gemspec index ec41d8e..9d4eb3d 100644 --- a/rarbg.gemspec +++ b/rarbg.gemspec @@ -15,12 +15,6 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/epistrephein/rarbg' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|docs)/}) - end - spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - spec.require_path = 'lib' - spec.metadata = { 'bug_tracker_uri' => 'https://github.com/epistrephein/rarbg/issues', 'changelog_uri' => 'https://github.com/epistrephein/rarbg/blob/master/CHANGELOG.md', @@ -29,6 +23,10 @@ Gem::Specification.new do |spec| 'source_code_uri' => 'https://github.com/epistrephein/rarbg' } + spec.files = Dir['lib/**/*.rb', 'rarbg.gemspec'] + spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE'] + spec.require_path = 'lib' + spec.required_ruby_version = '>= 2.0' spec.add_runtime_dependency 'faraday', '~> 0.12'