Skip to content

Commit

Permalink
Add conventional gem building infra
Browse files Browse the repository at this point in the history
  • Loading branch information
Mange committed Sep 9, 2020
1 parent 27c43ba commit 563511f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
.yardoc
doc
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
require "bundler/gem_tasks"
require "rake/testtask"

Rake::TestTask.new do |t|
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end

desc "Run tests"
task default: :test
23 changes: 15 additions & 8 deletions personnummer.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
$:.push File.expand_path("../lib", __FILE__)
require "swedish_pin/version"
require_relative "lib/swedish_pin/version"

Gem::Specification.new do |s|
s.name = "swedish-pin"
s.version = SwedishPIN::VERSION
s.date = "2020-08-09"
s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")

s.license = "MIT"
s.summary = "Work with Swedish PINs (Personnummer)"
s.description = "Parse, validate, and generate Swedish Personal Identity Numbers (PINs / Personnummer)"
s.homepage = "https://github.com/Mange/swedish-pin-ruby"

s.authors = ["Magnus Bergmark", "Jack Millard", "Fredrik Forsmo"]
s.email = ["me@mange.dev", "millard64@hotmail.co.uk", "fredrik.forsmo@gmail.com"]
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }

# 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.
s.files = Dir.chdir(File.expand_path("..", __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
s.bindir = "exe"
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
s.require_paths = ["lib"]
s.homepage = "https://github.com/Mange/swedish-pin-ruby"
s.license = "MIT"

s.add_development_dependency "rake"
s.add_development_dependency "minitest"
s.add_development_dependency "standard"
Expand Down

0 comments on commit 563511f

Please sign in to comment.