From c73c09f311b5c22712e879ad7a5b42195541320b Mon Sep 17 00:00:00 2001 From: cn Date: Fri, 6 Mar 2020 21:04:59 +0100 Subject: [PATCH] gem: refactor gemspec, exclude tests from gem, move binaries to ./exe - based on recommendations of https://piotrmurach.com/articles/writing-a-ruby-gem-specification/ --- CHANGELOG.md | 6 ++++++ dyndnsd.gemspec | 18 ++++++++++++------ {bin => exe}/dyndnsd | 0 3 files changed, 18 insertions(+), 6 deletions(-) rename {bin => exe}/dyndnsd (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0531a..98025f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.2.0 + +IMPROVEMENTS: + +- Refactor gemspec based on [recommendations](https://piotrmurach.com/articles/writing-a-ruby-gem-specification/) so tests are now excluded from gem and binaries move to `./exe` directory + ## 2.1.1 (March 1, 2020) IMPROVEMENTS: diff --git a/dyndnsd.gemspec b/dyndnsd.gemspec index ee73b06..bd2b8f3 100644 --- a/dyndnsd.gemspec +++ b/dyndnsd.gemspec @@ -1,7 +1,5 @@ -$LOAD_PATH.push File.expand_path('lib', __dir__) - -require 'dyndnsd/version' +require_relative 'lib/dyndnsd/version' Gem::Specification.new do |s| s.name = 'dyndnsd' @@ -9,14 +7,22 @@ Gem::Specification.new do |s| s.summary = 'dyndnsd.rb' s.description = 'A small, lightweight and extensible DynDNS server written with Ruby and Rack.' s.author = 'Christian Nicolai' - s.email = 'chrnicolai@gmail.com' + s.homepage = 'https://github.com/cmur2/dyndnsd' s.license = 'Apache-2.0' + s.metadata = { + 'bug_tracker_uri' => "#{s.homepage}/issues", + 'changelog_uri' => "#{s.homepage}/blob/master/CHANGELOG.md", + 'source_code_uri' => s.homepage + } - s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - s.test_files = s.files.grep(%r{^(test|spec|features)/}) + s.files = `git ls-files -z`.split("\x0").select do |f| + f.match(%r{^(init.d|lib)/}) + end s.require_paths = ['lib'] + s.bindir = 'exe' s.executables = ['dyndnsd'] + s.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE'] s.required_ruby_version = '>= 2.3' diff --git a/bin/dyndnsd b/exe/dyndnsd similarity index 100% rename from bin/dyndnsd rename to exe/dyndnsd