From a06f8206ac19a8b3a4fdb2b331329a3c84b7fd06 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 6 Jun 2024 13:51:14 +0200 Subject: [PATCH 1/2] Update CI configuration and gemspec --- .github/workflows/test.yml | 4 +++- .gitignore | 1 + Gemfile | 8 ++++++++ builder.gemspec | 25 +++++++++++-------------- 4 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 Gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6d231d..d7045b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,7 @@ on: [push, pull_request] jobs: test: strategy: + fail-fast: false matrix: ruby: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, head, jruby, jruby-head, truffleruby, truffleruby-head] runs-on: ubuntu-latest @@ -11,5 +12,6 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: + bundler-cache: true ruby-version: ${{ matrix.ruby }} - - run: rake + - run: bundle exec rake diff --git a/.gitignore b/.gitignore index 267121e..eb980b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ TAGS html pkg +Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..ddc0b99 --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true +source "https://rubygems.org" + +# Specify your gem's dependencies in heap-profiler.gemspec +gemspec + +gem "rake" +gem "minitest" diff --git a/builder.gemspec b/builder.gemspec index 7f3db54..2b11193 100644 --- a/builder.gemspec +++ b/builder.gemspec @@ -1,22 +1,12 @@ # frozen_string_literal: true require './lib/builder/version' -PKG_VERSION = Builder::VERSION - -PKG_FILES = Dir[ - '[A-Z]*', - 'doc/**/*', - 'lib/**/*.rb', - 'test/**/*.rb', - 'rakelib/**/*' -] - Gem::Specification.new do |s| #### Basic information. s.name = 'builder' - s.version = PKG_VERSION + s.version = Builder::VERSION s.summary = "Builders for MarkUp." s.description = %{\ Builder provides a number of builder objects that make creating structured data @@ -26,12 +16,19 @@ simple to do. Currently the following builder objects are supported: * XML Events } - s.files = PKG_FILES + pkg_files = Dir[ + '[A-Z]*', + 'doc/**/*', + 'lib/**/*.rb', + 'test/**/*.rb', + 'rakelib/**/*' + ] + + s.files = pkg_files s.require_path = 'lib' - s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ } + s.test_files = pkg_files.select { |fn| fn =~ /^test\/test/ } - s.has_rdoc = true # s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a s.rdoc_options << '--title' << 'Builder -- Easy XML Building' << From 3633d2ddd880af55933bd2b4171d7beb0d2dafcd Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 6 Jun 2024 13:58:53 +0200 Subject: [PATCH 2/2] File.exists? -> File.exist? Fix: #22 --- rakelib/tags.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 rakelib/tags.rake diff --git a/rakelib/tags.rake b/rakelib/tags.rake old mode 100644 new mode 100755 index 18000ea..2743f02 --- a/rakelib/tags.rake +++ b/rakelib/tags.rake @@ -14,7 +14,7 @@ module Tags PROJECT_DIR = ['.'] RVM_GEMDIR = File.join(`rvm gemdir`.strip, "gems") rescue nil - SYSTEM_DIRS = RVM_GEMDIR && File.exists?(RVM_GEMDIR) ? RVM_GEMDIR : [] + SYSTEM_DIRS = RVM_GEMDIR && File.exist?(RVM_GEMDIR) ? RVM_GEMDIR : [] module_function