From 850c5565a21a3b6c2afe0d02f16415caa8077627 Mon Sep 17 00:00:00 2001 From: himura467 Date: Tue, 14 Jul 2026 17:15:06 +0900 Subject: [PATCH] chore: scaffold the nack gem Gemspec, Rakefile, CI, and the Nack namespace with its version. --- .github/workflows/test.yaml | 25 +++++++++++++++++++++++++ .gitignore | 3 +++ Gemfile | 5 +++++ Rakefile | 11 +++++++++++ lib/nack.rb | 3 +++ lib/nack/version.rb | 5 +++++ nack.gemspec | 31 +++++++++++++++++++++++++++++++ test/helper.rb | 6 ++++++ 8 files changed, 89 insertions(+) create mode 100644 .github/workflows/test.yaml create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 lib/nack.rb create mode 100644 lib/nack/version.rb create mode 100644 nack.gemspec create mode 100644 test/helper.rb diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..0253de1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +name: Test + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + test: + strategy: + fail-fast: false + matrix: + ruby: + - '3.3' + - '3.4' + - '4.0' + - ruby-head + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: ruby/setup-ruby@6e5d382445ae5590b7449d8b3bc8cb1c2c27f617 # v1.317.0 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + - run: bundle exec rake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..058471b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/Gemfile.lock +/pkg/ +/*.gem diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..be173b2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..56237d2 --- /dev/null +++ b/Rakefile @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.test_files = FileList["test/test_*.rb"] +end + +task default: :test diff --git a/lib/nack.rb b/lib/nack.rb new file mode 100644 index 0000000..598cf7b --- /dev/null +++ b/lib/nack.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require_relative "nack/version" diff --git a/lib/nack/version.rb b/lib/nack/version.rb new file mode 100644 index 0000000..0cd460a --- /dev/null +++ b/lib/nack/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Nack + VERSION = "0.1.0" +end diff --git a/nack.gemspec b/nack.gemspec new file mode 100644 index 0000000..3bd56d3 --- /dev/null +++ b/nack.gemspec @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "lib/nack/version" + +Gem::Specification.new do |spec| + spec.name = "nack" + spec.version = Nack::VERSION + spec.summary = "Ruby toolkit for NSGI applications" + spec.description = <<~DESCRIPTION + Middleware with a composition DSL, request/response conveniences, + path-based dispatch, and a host-free test kit for applications + targeting the NSGI Ruby application contract. + DESCRIPTION + spec.authors = ["himura467"] + spec.homepage = "https://github.com/nsgi-org/nack-ruby" + spec.license = "MIT" + spec.required_ruby_version = ">= 3.3" + + spec.metadata = { + "source_code_uri" => "https://github.com/nsgi-org/nack-ruby", + "bug_tracker_uri" => "https://github.com/nsgi-org/nack-ruby/issues", + "rubygems_mfa_required" => "true" + } + + spec.files = Dir["lib/**/*.rb", "README.md", "LICENSE"] + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler" + spec.add_development_dependency "rake" + spec.add_development_dependency "minitest" +end diff --git a/test/helper.rb b/test/helper.rb new file mode 100644 index 0000000..2e49dfb --- /dev/null +++ b/test/helper.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) + +require "nack" +require "minitest/autorun"