From 5d8025bd81a597f6f3c3904faad874c0be9b59ed Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 14 Nov 2024 10:36:29 +0100 Subject: [PATCH] Remove rails binstub from built gems The bin/rails script is solely used for local dev purposes. Since the default bindir from Rubygems is bin the binstub gets installed with the gems. This can cause issues with the rails command comming from rails itself. Also removing the old script/rails files, which were excluded to solve the same issue. (cherry picked from commit dde89665589fbcfae696ecb65ad940e45c3af955) --- admin/solidus_admin.gemspec | 2 +- api/script/rails | 10 ---------- api/solidus_api.gemspec | 2 +- backend/script/rails | 10 ---------- backend/solidus_backend.gemspec | 2 +- core/script/rails | 10 ---------- core/solidus_core.gemspec | 2 +- legacy_promotions/solidus_legacy_promotions.gemspec | 2 +- promotions/solidus_promotions.gemspec | 4 ++-- 9 files changed, 7 insertions(+), 37 deletions(-) delete mode 100755 api/script/rails delete mode 100755 backend/script/rails delete mode 100755 core/script/rails diff --git a/admin/solidus_admin.gemspec b/admin/solidus_admin.gemspec index f15f2c9ce47..ce348c7b33d 100644 --- a/admin/solidus_admin.gemspec +++ b/admin/solidus_admin.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |s| s.metadata["changelog_uri"] = "https://github.com/solidusio/solidus/releases?q=%22solidus_admin%2Fv0%22&expanded=true" s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|script)/}) + f.match(%r{^(spec|bin)/}) end + ["app/assets/builds/solidus_admin/tailwind.css"] s.required_ruby_version = '>= 3.1.0' diff --git a/api/script/rails b/api/script/rails deleted file mode 100755 index f4f3cbf4353..00000000000 --- a/api/script/rails +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. - -ENGINE_ROOT = File.expand_path('..', __dir__) -ENGINE_PATH = File.expand_path('../lib/spree/api/engine', __dir__) - -require 'rails/all' -require 'rails/engine/commands' diff --git a/api/solidus_api.gemspec b/api/solidus_api.gemspec index 90885c28ebd..f9ef877d116 100644 --- a/api/solidus_api.gemspec +++ b/api/solidus_api.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|script)/}) + f.match(%r{^(spec|bin)/}) end s.required_ruby_version = '>= 3.1.0' diff --git a/backend/script/rails b/backend/script/rails deleted file mode 100755 index d8e68052dd2..00000000000 --- a/backend/script/rails +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. - -ENGINE_ROOT = File.expand_path('..', __dir__) -ENGINE_PATH = File.expand_path('../lib/spree/backend/engine', __dir__) - -require 'rails/all' -require 'rails/engine/commands' diff --git a/backend/solidus_backend.gemspec b/backend/solidus_backend.gemspec index 7d0fcd2b8cb..15783c7061d 100644 --- a/backend/solidus_backend.gemspec +++ b/backend/solidus_backend.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|script)/}) + f.match(%r{^(spec|bin)/}) end s.required_ruby_version = '>= 3.1.0' diff --git a/core/script/rails b/core/script/rails deleted file mode 100755 index 05c3838f737..00000000000 --- a/core/script/rails +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. - -ENGINE_ROOT = File.expand_path('..', __dir__) -ENGINE_PATH = File.expand_path('../lib/spree/core/engine', __dir__) - -require 'rails/all' -require 'rails/engine/commands' diff --git a/core/solidus_core.gemspec b/core/solidus_core.gemspec index 330e7f81306..3d4a7f5c108 100644 --- a/core/solidus_core.gemspec +++ b/core/solidus_core.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|script)/}) + f.match(%r{^(spec|bin)/}) end s.required_ruby_version = '>= 3.1.0' diff --git a/legacy_promotions/solidus_legacy_promotions.gemspec b/legacy_promotions/solidus_legacy_promotions.gemspec index 8f5586e6839..fdd1bcddaac 100644 --- a/legacy_promotions/solidus_legacy_promotions.gemspec +++ b/legacy_promotions/solidus_legacy_promotions.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(spec|script)/}) + f.match(%r{^(spec|bin)/}) end s.required_ruby_version = '>= 3.1.0' diff --git a/promotions/solidus_promotions.gemspec b/promotions/solidus_promotions.gemspec index 7f67644ee32..fd3f6a35348 100644 --- a/promotions/solidus_promotions.gemspec +++ b/promotions/solidus_promotions.gemspec @@ -17,12 +17,12 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage - spec.required_ruby_version = ">= 3.0.0" + spec.required_ruby_version = ">= 3.1.0" # 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. files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") } - spec.files = files.grep_v(%r{^(test|spec|features)/}) + spec.files = files.grep_v(%r{^(spec|bin)/}) spec.add_dependency "importmap-rails", "~> 1.2" spec.add_dependency "ransack-enum", "~> 1.0"