From bf3ba8f7cdccc91b9560c61634f2c35e1789a269 Mon Sep 17 00:00:00 2001 From: cn Date: Sat, 7 Mar 2020 01:28:17 +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/ --- {bin => exe}/openvpn-status-web | 1 + openvpn-status-web.gemspec | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) rename {bin => exe}/openvpn-status-web (75%) diff --git a/bin/openvpn-status-web b/exe/openvpn-status-web similarity index 75% rename from bin/openvpn-status-web rename to exe/openvpn-status-web index af7ad16..d9d49ee 100755 --- a/bin/openvpn-status-web +++ b/exe/openvpn-status-web @@ -1,3 +1,4 @@ +#!/usr/bin/env ruby require 'openvpn-status-web' diff --git a/openvpn-status-web.gemspec b/openvpn-status-web.gemspec index fdc33bb..98d1fb4 100644 --- a/openvpn-status-web.gemspec +++ b/openvpn-status-web.gemspec @@ -1,7 +1,5 @@ -$LOAD_PATH.push File.expand_path('lib', __dir__) - -require 'openvpn-status-web/version' +require_relative 'lib/openvpn-status-web/version' Gem::Specification.new do |s| s.name = 'openvpn-status-web' @@ -9,14 +7,21 @@ Gem::Specification.new do |s| s.summary = 'openvpn-status-web' s.description = 'Small Rack (Ruby) application serving OpenVPN status file.' s.author = 'Christian Nicolai' - s.email = 'chrnicolai@gmail.com' + s.homepage = 'https://github.com/cmur2/openvpn-status-web' s.license = 'Apache-2.0' + s.metadata = { + 'bug_tracker_uri' => "#{s.homepage}/issues", + '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 = ['openvpn-status-web'] + s.extra_rdoc_files = Dir['README.md', 'LICENSE'] s.required_ruby_version = '>= 2.3'