Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dev and check groups from appraisal groups #4198

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions appraisal/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,38 @@
#
# Usage: `bundle exec ruby appraisal/generate.rb`

require 'bundler'
require "appraisal/appraisal"

require_relative "../tasks/appraisal_conversion"

gemfile = Appraisal::Gemfile.new.tap do |g|
# Support `eval_gemfile` for `Bundler::DSL`
g.define_singleton_method(:eval_gemfile) {|file| load(file) }
g.load(ENV["BUNDLE_GEMFILE"] || "Gemfile")
g.load(Bundler.default_gemfile)
end

appraisals = []

REMOVED_GEMS = {
:check => [
'rbs',
'steep',
'standard',
],
:dev => [
'ruby-lsp',
],
}
definition = Bundler.definition
to_remove = Hash.new { |hash, key| hash[key] = definition.dependencies_for([key]).map(&:name) }
TonyCTHsu marked this conversation as resolved.
Show resolved Hide resolved

# Register groups to be removed
[:dev, :check].each { |g| to_remove[g] }
TonyCTHsu marked this conversation as resolved.
Show resolved Hide resolved

define_singleton_method(:appraise) do |name, &block|
# Customize name
name = "#{AppraisalConversion.runtime_identifier}_#{name}"
appraisal = Appraisal::Appraisal.new(name, gemfile)
appraisal.instance_eval(&block)

# Customize callback for removal
REMOVED_GEMS.each do |group_name, gems|
to_remove.each do |group_name, gems|
appraisal.group(group_name) do
gems.each { |gem_name| remove_gem gem_name }
end
end

appraisals << appraisal
end

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_activesupport.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions gemfiles/ruby_3.4_activesupport.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_aws.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_aws.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_contrib.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_contrib.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_contrib_old.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_contrib_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_core_old.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_core_old.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_elasticsearch_7.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_elasticsearch_7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_elasticsearch_8.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_elasticsearch_8.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_elasticsearch_latest.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions gemfiles/ruby_3.4_elasticsearch_latest.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gemfiles/ruby_3.4_graphql_1.13.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions gemfiles/ruby_3.4_graphql_1.13.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading