Skip to content

Commit

Permalink
Merge pull request #84 from block/myron/dependabot-fixes/step9
Browse files Browse the repository at this point in the history
Fix `Gemfile` to be compatible with dependabot.
  • Loading branch information
myronmarston authored Jan 1, 2025
2 parents 83be56f + 850c431 commit 734859e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ group :site do
end

# Since this file gets symlinked both at the repo root and into each Gem directory, we have
# to dynamically detect the repo root, by looking for a file that only exists at the root.
repo_root = ::Pathname.new(::Dir.pwd).ascend.find { |dir| ::File.exist?("#{dir}/CODE_OF_CONDUCT.md") }.to_s
# to dynamically detect the repo root, by looking for one of the subdirs at the root.
repo_root = ::Pathname.new(__dir__).ascend.find { |dir| ::Dir.exist?("#{dir}/elasticgraph-support") }.to_s

# `tmp` and `log` are git-ignored but many of our build tasks and scripts expect them to exist.
# We create them here since `Gemfile` evaluation happens before anything else.
::FileUtils.mkdir_p("#{repo_root}/log")
::FileUtils.mkdir_p("#{repo_root}/tmp")

# Identify the gems that live in the ElasticGraph repository.
require "#{repo_root}/script/list_eg_gems"
gems_in_this_repo = ::ElasticGraphGems.list.to_set
gems_in_this_repo = ::Dir.glob("#{repo_root}/*/*.gemspec").map do |gemspec|
::File.basename(::File.dirname(gemspec))
end.to_set

# Here we override the `gem` method to automatically add the ElasticGraph version
# to all ElasticGraph gems. If we don't do this, we can get confusing bundler warnings
Expand Down
2 changes: 2 additions & 0 deletions script/list_eg_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ def self.list
end

if $PROGRAM_NAME == __FILE__
# :nocov: -- specs only require this file, not run it as a script.
puts ElasticGraphGems.list.join("\n")
# :nocov:
end

0 comments on commit 734859e

Please sign in to comment.