Skip to content

Commit

Permalink
Refactor gemspecs to no longer use gemspec_helper.rb.
Browse files Browse the repository at this point in the history
Instead, inline the full definition of the gemspec in each `.gemspec` file.
This should fix a dependabot error we are getting:

```
Bundler::GemspecError with message: [!] There was an error while loading `elasticgraph.gemspec`: uninitialized constant ElasticGraphGemspecHelper. Bundler cannot continue.

 #  from /home/dependabot/dependabot-updater/repo/elasticgraph/elasticgraph/elasticgraph.gemspec:14
 #  -------------------------------------------
 #
 >  ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
 #    spec.summary = "ElasticGraph meta-gem that pulls in all the core ElasticGraph gems."
 #  -------------------------------------------
```
  • Loading branch information
myronmarston committed Dec 28, 2024
1 parent 634eae7 commit 2f9c556
Show file tree
Hide file tree
Showing 23 changed files with 803 additions and 198 deletions.
48 changes: 39 additions & 9 deletions elasticgraph-admin/elasticgraph-admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,48 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-admin"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem that provides datastore administrative tasks, to keep a datastore up-to-date with an ElasticGraph schema."

spec.add_dependency "elasticgraph-datastore_core", eg_version
spec.add_dependency "elasticgraph-indexer", eg_version
spec.add_dependency "elasticgraph-schema_artifacts", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "core" # used by script/update_codebase_overview
}

# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "rake", "~> 13.2"

spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
39 changes: 34 additions & 5 deletions elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,42 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :lambda) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-admin_lambda"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem that wraps elasticgraph-admin in an AWS Lambda."

spec.add_dependency "rake", "~> 13.2"
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "lambda" # used by script/update_codebase_overview
}

# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.add_dependency "elasticgraph-admin", eg_version
spec.add_dependency "elasticgraph-lambda_support", eg_version
spec.required_ruby_version = "~> 3.2"

spec.add_dependency "rake", "~> 13.2"
spec.add_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION
end
48 changes: 39 additions & 9 deletions elasticgraph-apollo/elasticgraph-apollo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,52 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :extension) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-apollo"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "An ElasticGraph extension that implements the Apollo federation spec."

spec.add_dependency "elasticgraph-graphql", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "extension" # used by script/update_codebase_overview
}

# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "graphql", "~> 2.4.8"
spec.add_dependency "apollo-federation", "~> 3.8"

# Note: technically, this is not purely a development dependency, but since `eg-schema_def`
# isn't intended to be used in production (or even included in a deployed bundle) we don't
# want to declare it as normal dependency here.
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
spec.add_development_dependency "elasticgraph-admin", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-indexer", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-indexer", ElasticGraph::VERSION
end
46 changes: 38 additions & 8 deletions elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,46 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-datastore_core"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem containing the core datastore support types and logic."

spec.add_dependency "elasticgraph-schema_artifacts", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "core" # used by script/update_codebase_overview
}

spec.add_development_dependency "elasticgraph-admin", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION

spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
36 changes: 33 additions & 3 deletions elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,42 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :datastore_adapter) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-elasticsearch"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "Wraps the Elasticsearch client for use by ElasticGraph."

spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "datastore_adapter" # used by script/update_codebase_overview
}

# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "elasticsearch", "~> 8.16"
spec.add_dependency "faraday", "~> 2.12"
spec.add_dependency "faraday-retry", "~> 2.2"
Expand Down
48 changes: 39 additions & 9 deletions elasticgraph-graphql/elasticgraph-graphql.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,48 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-graphql"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "The ElasticGraph GraphQL query engine."

spec.add_dependency "elasticgraph-datastore_core", eg_version
spec.add_dependency "elasticgraph-schema_artifacts", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "core" # used by script/update_codebase_overview
}

# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "graphql", "~> 2.4.8"

spec.add_development_dependency "elasticgraph-admin", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-indexer", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-indexer", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
42 changes: 36 additions & 6 deletions elasticgraph-graphql_lambda/elasticgraph-graphql_lambda.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,44 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :lambda) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-graphql_lambda"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem that wraps elasticgraph-graphql in an AWS Lambda."

spec.add_dependency "elasticgraph-graphql", eg_version
spec.add_dependency "elasticgraph-lambda_support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "lambda" # used by script/update_codebase_overview
}

spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-query_registry", eg_version
# 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.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION

spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-query_registry", ElasticGraph::VERSION
end
Loading

0 comments on commit 2f9c556

Please sign in to comment.