From db71460a5c6806bae81b14f7cadd2a4ec20b78d6 Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Fri, 27 Dec 2024 18:35:22 -0800 Subject: [PATCH] Refactor gemspecs to no longer use `gemspec_helper.rb`. 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." # ------------------------------------------- ``` --- elasticgraph-admin/elasticgraph-admin.gemspec | 48 +++++++++++++---- .../elasticgraph-admin_lambda.gemspec | 39 ++++++++++++-- .../apollo_tests_implementation/Dockerfile | 36 ------------- .../elasticgraph-apollo.gemspec | 48 +++++++++++++---- .../elasticgraph-datastore_core.gemspec | 46 +++++++++++++--- .../elasticgraph-elasticsearch.gemspec | 36 +++++++++++-- .../elasticgraph-graphql.gemspec | 48 +++++++++++++---- .../elasticgraph-graphql_lambda.gemspec | 42 ++++++++++++--- .../elasticgraph-health_check.gemspec | 50 ++++++++++++++---- .../elasticgraph-indexer.gemspec | 50 ++++++++++++++---- ...ticgraph-indexer_autoscaler_lambda.gemspec | 42 ++++++++++++--- .../elasticgraph-indexer_lambda.gemspec | 38 ++++++++++++-- .../elasticgraph-json_schema.gemspec | 36 +++++++++++-- .../elasticgraph-lambda_support.gemspec | 44 +++++++++++++--- elasticgraph-local/elasticgraph-local.gemspec | 48 +++++++++++++---- .../elasticgraph-opensearch.gemspec | 36 +++++++++++-- .../elasticgraph-query_interceptor.gemspec | 44 +++++++++++++--- .../elasticgraph-query_registry.gemspec | 42 ++++++++++++--- elasticgraph-rack/elasticgraph-rack.gemspec | 44 +++++++++++++--- .../elasticgraph-schema_artifacts.gemspec | 40 ++++++++++++-- .../elasticgraph-schema_definition.gemspec | 52 +++++++++++++++---- .../elasticgraph-support.gemspec | 34 +++++++++++- elasticgraph/elasticgraph.gemspec | 42 ++++++++++++--- gemspec_helper.rb | 52 ------------------- 24 files changed, 803 insertions(+), 234 deletions(-) delete mode 100644 gemspec_helper.rb diff --git a/elasticgraph-admin/elasticgraph-admin.gemspec b/elasticgraph-admin/elasticgraph-admin.gemspec index cc6fa5bb..26e098dd 100644 --- a/elasticgraph-admin/elasticgraph-admin.gemspec +++ b/elasticgraph-admin/elasticgraph-admin.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec b/elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec index 611cf73e..f0cd0dc1 100644 --- a/elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec +++ b/elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-apollo/apollo_tests_implementation/Dockerfile b/elasticgraph-apollo/apollo_tests_implementation/Dockerfile index 558bc59e..84556b05 100644 --- a/elasticgraph-apollo/apollo_tests_implementation/Dockerfile +++ b/elasticgraph-apollo/apollo_tests_implementation/Dockerfile @@ -7,57 +7,21 @@ WORKDIR /web # Each of the elasticgraph gems this implementation depends on must be # copied into the container so it's available for inclusion in the bundle. -# Note: we've observed that hidden files (like .rspec) are not copied by COPY. -# gemspec_helper enforces the presence of `.rspec`/`.yardopts`, so we have to copy them. COPY elasticgraph-admin /web/elasticgraph-admin -COPY elasticgraph-admin/.rspec /web/elasticgraph-admin/.rspec -COPY elasticgraph-admin/.yardopts /web/elasticgraph-admin/.yardopts - COPY elasticgraph-apollo /web/elasticgraph-apollo -COPY elasticgraph-apollo/.rspec /web/elasticgraph-apollo/.rspec -COPY elasticgraph-apollo/.yardopts /web/elasticgraph-apollo/.yardopts - COPY elasticgraph-datastore_core /web/elasticgraph-datastore_core -COPY elasticgraph-datastore_core/.rspec /web/elasticgraph-datastore_core/.rspec -COPY elasticgraph-datastore_core/.yardopts /web/elasticgraph-datastore_core/.yardopts - COPY elasticgraph-elasticsearch /web/elasticgraph-elasticsearch -COPY elasticgraph-elasticsearch/.rspec /web/elasticgraph-elasticsearch/.rspec -COPY elasticgraph-elasticsearch/.yardopts /web/elasticgraph-elasticsearch/.yardopts - COPY elasticgraph-graphql /web/elasticgraph-graphql -COPY elasticgraph-graphql/.rspec /web/elasticgraph-graphql/.rspec -COPY elasticgraph-graphql/.yardopts /web/elasticgraph-graphql/.yardopts - COPY elasticgraph-indexer /web/elasticgraph-indexer -COPY elasticgraph-indexer/.rspec /web/elasticgraph-indexer/.rspec -COPY elasticgraph-indexer/.yardopts /web/elasticgraph-indexer/.yardopts - COPY elasticgraph-json_schema /web/elasticgraph-json_schema -COPY elasticgraph-json_schema/.rspec /web/elasticgraph-json_schema/.rspec -COPY elasticgraph-json_schema/.yardopts /web/elasticgraph-json_schema/.yardopts - COPY elasticgraph-rack /web/elasticgraph-rack -COPY elasticgraph-rack/.rspec /web/elasticgraph-rack/.rspec -COPY elasticgraph-rack/.yardopts /web/elasticgraph-rack/.yardopts - COPY elasticgraph-schema_artifacts /web/elasticgraph-schema_artifacts -COPY elasticgraph-schema_artifacts/.rspec /web/elasticgraph-schema_artifacts/.rspec -COPY elasticgraph-schema_artifacts/.yardopts /web/elasticgraph-schema_artifacts/.yardopts - COPY elasticgraph-schema_definition /web/elasticgraph-schema_definition -COPY elasticgraph-schema_definition/.rspec /web/elasticgraph-schema_definition/.rspec -COPY elasticgraph-schema_definition/.yardopts /web/elasticgraph-schema_definition/.yardopts - COPY elasticgraph-support /web/elasticgraph-support -COPY elasticgraph-support/.rspec /web/elasticgraph-support/.rspec -COPY elasticgraph-support/.yardopts /web/elasticgraph-support/.yardopts # We also have to copy the implementation files (config, schema, etc) as well. COPY elasticgraph-apollo/apollo_tests_implementation /web/ -COPY gemspec_helper.rb /web/gemspec_helper.rb - # We need to install the bundle and generate our schema artifacts. RUN bundle install RUN bundle exec rake schema_artifacts:dump TARGET_APOLLO_FEDERATION_VERSION=${TARGET_APOLLO_FEDERATION_VERSION} diff --git a/elasticgraph-apollo/elasticgraph-apollo.gemspec b/elasticgraph-apollo/elasticgraph-apollo.gemspec index c10ceaa2..b0a1e0f9 100644 --- a/elasticgraph-apollo/elasticgraph-apollo.gemspec +++ b/elasticgraph-apollo/elasticgraph-apollo.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec b/elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec index ff49d0d5..23b2feb8 100644 --- a/elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec +++ b/elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec b/elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec index a4ffa304..052a9d63 100644 --- a/elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec +++ b/elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec @@ -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 = ["myron@squareup.com"] + 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" diff --git a/elasticgraph-graphql/elasticgraph-graphql.gemspec b/elasticgraph-graphql/elasticgraph-graphql.gemspec index d7158aa7..6efc9f3c 100644 --- a/elasticgraph-graphql/elasticgraph-graphql.gemspec +++ b/elasticgraph-graphql/elasticgraph-graphql.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-graphql_lambda/elasticgraph-graphql_lambda.gemspec b/elasticgraph-graphql_lambda/elasticgraph-graphql_lambda.gemspec index 1efa9880..a627e8df 100644 --- a/elasticgraph-graphql_lambda/elasticgraph-graphql_lambda.gemspec +++ b/elasticgraph-graphql_lambda/elasticgraph-graphql_lambda.gemspec @@ -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 = ["myron@squareup.com"] + 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 diff --git a/elasticgraph-health_check/elasticgraph-health_check.gemspec b/elasticgraph-health_check/elasticgraph-health_check.gemspec index 5da1f0b9..5ba1600f 100644 --- a/elasticgraph-health_check/elasticgraph-health_check.gemspec +++ b/elasticgraph-health_check/elasticgraph-health_check.gemspec @@ -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: :extension) do |spec, eg_version| +Gem::Specification.new do |spec| + spec.name = "elasticgraph-health_check" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "An ElasticGraph extension that provides a health check for high availability deployments." - spec.add_dependency "elasticgraph-datastore_core", eg_version - 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 + } - spec.add_development_dependency "elasticgraph-admin", eg_version - spec.add_development_dependency "elasticgraph-elasticsearch", eg_version - spec.add_development_dependency "elasticgraph-indexer", 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-datastore_core", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-graphql", 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-indexer", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION end diff --git a/elasticgraph-indexer/elasticgraph-indexer.gemspec b/elasticgraph-indexer/elasticgraph-indexer.gemspec index 2cb304b0..1b5bbeec 100644 --- a/elasticgraph-indexer/elasticgraph-indexer.gemspec +++ b/elasticgraph-indexer/elasticgraph-indexer.gemspec @@ -6,19 +6,49 @@ # # 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-indexer" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem that provides APIs to robustly index data into a datastore." - spec.add_dependency "elasticgraph-datastore_core", eg_version - spec.add_dependency "elasticgraph-json_schema", 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-json_schema", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION spec.add_dependency "hashdiff", "~> 1.1" - 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 + 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 diff --git a/elasticgraph-indexer_autoscaler_lambda/elasticgraph-indexer_autoscaler_lambda.gemspec b/elasticgraph-indexer_autoscaler_lambda/elasticgraph-indexer_autoscaler_lambda.gemspec index 4cc0490c..a66c9665 100644 --- a/elasticgraph-indexer_autoscaler_lambda/elasticgraph-indexer_autoscaler_lambda.gemspec +++ b/elasticgraph-indexer_autoscaler_lambda/elasticgraph-indexer_autoscaler_lambda.gemspec @@ -6,23 +6,51 @@ # # 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-indexer_autoscaler_lambda" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem that monitors OpenSearch CPU utilization to autoscale indexer lambda concurrency." - spec.add_dependency "elasticgraph-datastore_core", 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 + } + # 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-lambda_support", ElasticGraph::VERSION spec.add_dependency "aws-sdk-lambda", "~> 1.144" spec.add_dependency "aws-sdk-sqs", "~> 1.89" spec.add_dependency "aws-sdk-cloudwatch", "~> 1.108" - # aws-sdk-sqs requires an XML library be available. On Ruby < 3 it'll use rexml from the standard library but on Ruby 3.0+ # we have to add an explicit dependency. It supports ox, oga, libxml, nokogiri or rexml, and of those, ox seems to be the # best choice: it leads benchmarks, is well-maintained, has no dependencies, and is MIT-licensed. spec.add_dependency "ox", "~> 2.14", ">= 2.14.18" - spec.add_development_dependency "elasticgraph-elasticsearch", eg_version - spec.add_development_dependency "elasticgraph-opensearch", eg_version + spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION end diff --git a/elasticgraph-indexer_lambda/elasticgraph-indexer_lambda.gemspec b/elasticgraph-indexer_lambda/elasticgraph-indexer_lambda.gemspec index db5521b6..56a460c3 100644 --- a/elasticgraph-indexer_lambda/elasticgraph-indexer_lambda.gemspec +++ b/elasticgraph-indexer_lambda/elasticgraph-indexer_lambda.gemspec @@ -6,13 +6,43 @@ # # 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-indexer_lambda" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "Provides an AWS Lambda interface for an elasticgraph API" - spec.add_dependency "elasticgraph-indexer", 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 + } + + # 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-indexer", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION spec.add_dependency "aws-sdk-s3", "~> 1.176" # aws-sdk-s3 requires an XML library be available. On Ruby < 3 it'll use rexml from the standard library but on Ruby 3.0+ diff --git a/elasticgraph-json_schema/elasticgraph-json_schema.gemspec b/elasticgraph-json_schema/elasticgraph-json_schema.gemspec index 992275db..ea417f80 100644 --- a/elasticgraph-json_schema/elasticgraph-json_schema.gemspec +++ b/elasticgraph-json_schema/elasticgraph-json_schema.gemspec @@ -6,11 +6,41 @@ # # 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-json_schema" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem that provides JSON Schema validation." - 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-support", ElasticGraph::VERSION spec.add_dependency "json_schemer", "~> 2.3" end diff --git a/elasticgraph-lambda_support/elasticgraph-lambda_support.gemspec b/elasticgraph-lambda_support/elasticgraph-lambda_support.gemspec index 3da6bd1c..380df779 100644 --- a/elasticgraph-lambda_support/elasticgraph-lambda_support.gemspec +++ b/elasticgraph-lambda_support/elasticgraph-lambda_support.gemspec @@ -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: :lambda) do |spec, eg_version| +Gem::Specification.new do |spec| + spec.name = "elasticgraph-lambda_support" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem that supports running ElasticGraph using AWS Lambda." - spec.add_dependency "elasticgraph-opensearch", 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 + } + + # 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-opensearch", ElasticGraph::VERSION spec.add_dependency "faraday_middleware-aws-sigv4", "~> 1.0" - spec.add_development_dependency "elasticgraph-admin", eg_version - spec.add_development_dependency "elasticgraph-graphql", eg_version - spec.add_development_dependency "elasticgraph-indexer", eg_version - spec.add_development_dependency "elasticgraph-indexer_autoscaler_lambda", eg_version + spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-graphql", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-indexer", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-indexer_autoscaler_lambda", ElasticGraph::VERSION end diff --git a/elasticgraph-local/elasticgraph-local.gemspec b/elasticgraph-local/elasticgraph-local.gemspec index 9d1b3cad..5b546af4 100644 --- a/elasticgraph-local/elasticgraph-local.gemspec +++ b/elasticgraph-local/elasticgraph-local.gemspec @@ -6,20 +6,50 @@ # # frozen_string_literal: true -require_relative "../gemspec_helper" +require_relative "../elasticgraph-support/lib/elastic_graph/version" -ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :local) do |spec, eg_version| +Gem::Specification.new do |spec| + spec.name = "elasticgraph-local" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "Provides support for developing and running ElasticGraph applications locally." - spec.add_dependency "elasticgraph-admin", eg_version - spec.add_dependency "elasticgraph-graphql", eg_version - spec.add_dependency "elasticgraph-indexer", eg_version - spec.add_dependency "elasticgraph-rack", eg_version - spec.add_dependency "elasticgraph-schema_definition", 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" => "local" # 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-admin", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-rack", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION spec.add_dependency "rackup", "~> 2.2" spec.add_dependency "rake", "~> 13.2" spec.add_dependency "webrick", "~> 1.9" - spec.add_development_dependency "elasticgraph-elasticsearch", eg_version - spec.add_development_dependency "elasticgraph-opensearch", eg_version + spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION end diff --git a/elasticgraph-opensearch/elasticgraph-opensearch.gemspec b/elasticgraph-opensearch/elasticgraph-opensearch.gemspec index 0ce2400a..b4ef26c3 100644 --- a/elasticgraph-opensearch/elasticgraph-opensearch.gemspec +++ b/elasticgraph-opensearch/elasticgraph-opensearch.gemspec @@ -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-opensearch" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "Wraps the OpenSearch 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 "faraday", "~> 2.12" spec.add_dependency "faraday-retry", "~> 2.2" spec.add_dependency "opensearch-ruby", "~> 3.4" diff --git a/elasticgraph-query_interceptor/elasticgraph-query_interceptor.gemspec b/elasticgraph-query_interceptor/elasticgraph-query_interceptor.gemspec index b74cd3e9..a3c3dcd1 100644 --- a/elasticgraph-query_interceptor/elasticgraph-query_interceptor.gemspec +++ b/elasticgraph-query_interceptor/elasticgraph-query_interceptor.gemspec @@ -6,15 +6,45 @@ # # 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-query_interceptor" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "An ElasticGraph extension for intercepting datastore queries." - spec.add_dependency "elasticgraph-graphql", 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" => "extension" # used by script/update_codebase_overview + } - 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-graphql", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-schema_artifacts", 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 diff --git a/elasticgraph-query_registry/elasticgraph-query_registry.gemspec b/elasticgraph-query_registry/elasticgraph-query_registry.gemspec index 8d484cec..d669a521 100644 --- a/elasticgraph-query_registry/elasticgraph-query_registry.gemspec +++ b/elasticgraph-query_registry/elasticgraph-query_registry.gemspec @@ -6,17 +6,47 @@ # # 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-query_registry" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "An ElasticGraph extension that supports safer schema evolution by limiting GraphQL queries based on " \ "a registry and validating registered queries against the schema." - 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 "rake", "~> 13.2" - spec.add_development_dependency "elasticgraph-elasticsearch", eg_version - spec.add_development_dependency "elasticgraph-opensearch", eg_version + spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION end diff --git a/elasticgraph-rack/elasticgraph-rack.gemspec b/elasticgraph-rack/elasticgraph-rack.gemspec index e359c371..9308b1de 100644 --- a/elasticgraph-rack/elasticgraph-rack.gemspec +++ b/elasticgraph-rack/elasticgraph-rack.gemspec @@ -6,17 +6,47 @@ # # frozen_string_literal: true -require_relative "../gemspec_helper" +require_relative "../elasticgraph-support/lib/elastic_graph/version" -ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :local) do |spec, eg_version| +Gem::Specification.new do |spec| + spec.name = "elasticgraph-rack" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem for serving an ElasticGraph GraphQL endpoint using rack." - spec.add_dependency "elasticgraph-graphql", 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" => "local" # 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 "rack", "~> 3.1" - 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-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 "rack-test", "~> 2.1" end diff --git a/elasticgraph-schema_artifacts/elasticgraph-schema_artifacts.gemspec b/elasticgraph-schema_artifacts/elasticgraph-schema_artifacts.gemspec index 2c92cb2f..b45a2a80 100644 --- a/elasticgraph-schema_artifacts/elasticgraph-schema_artifacts.gemspec +++ b/elasticgraph-schema_artifacts/elasticgraph-schema_artifacts.gemspec @@ -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-schema_artifacts" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem containing code related to generated schema artifacts." - 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-support", ElasticGraph::VERSION # Necessary since `ScalarType` references coercion adapters defined in the `elasticgraph-graphql` gem. - spec.add_development_dependency "elasticgraph-graphql", eg_version + spec.add_development_dependency "elasticgraph-graphql", ElasticGraph::VERSION # Necessary since `ScalarType` references indexing preparer defined in the `elasticgraph-indexer` gem. - spec.add_development_dependency "elasticgraph-indexer", eg_version + spec.add_development_dependency "elasticgraph-indexer", ElasticGraph::VERSION end diff --git a/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec b/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec index 6ca0f0f1..a2cfc859 100644 --- a/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec +++ b/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec @@ -6,21 +6,51 @@ # # frozen_string_literal: true -require_relative "../gemspec_helper" +require_relative "../elasticgraph-support/lib/elastic_graph/version" -ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :local) do |spec, eg_version| +Gem::Specification.new do |spec| + spec.name = "elasticgraph-schema_definition" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem that provides the schema definition API and generates schema artifacts." - spec.add_dependency "elasticgraph-graphql", eg_version # needed since we validate that scalar `coerce_with` options are valid (which loads scalar coercion adapters) - spec.add_dependency "elasticgraph-indexer", eg_version # needed since we validate that scalar `prepare_for_indexing_with` options are valid (which loads indexing preparer adapters) - spec.add_dependency "elasticgraph-json_schema", 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" => "local" # 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 # needed since we validate that scalar `coerce_with` options are valid (which loads scalar coercion adapters) + spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION # needed since we validate that scalar `prepare_for_indexing_with` options are valid (which loads indexing preparer adapters) + spec.add_dependency "elasticgraph-json_schema", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION spec.add_dependency "graphql", "~> 2.4.8" spec.add_dependency "rake", "~> 13.2" - spec.add_development_dependency "elasticgraph-admin", eg_version - spec.add_development_dependency "elasticgraph-datastore_core", eg_version - spec.add_development_dependency "elasticgraph-elasticsearch", eg_version - spec.add_development_dependency "elasticgraph-opensearch", eg_version + spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION + spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION end diff --git a/elasticgraph-support/elasticgraph-support.gemspec b/elasticgraph-support/elasticgraph-support.gemspec index fc31518c..f58bceb0 100644 --- a/elasticgraph-support/elasticgraph-support.gemspec +++ b/elasticgraph-support/elasticgraph-support.gemspec @@ -6,11 +6,41 @@ # # frozen_string_literal: true -require_relative "../gemspec_helper" +require_relative "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-support" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph gem providing support utilities to the other ElasticGraph gems." + # 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" + # Ruby 3.4 warns about using `logger` being moved out of the standard library, and in Ruby 3.5 # it'll no longer be available without declaring a dependency. # diff --git a/elasticgraph/elasticgraph.gemspec b/elasticgraph/elasticgraph.gemspec index 03fce1f9..670e5f31 100644 --- a/elasticgraph/elasticgraph.gemspec +++ b/elasticgraph/elasticgraph.gemspec @@ -6,13 +6,43 @@ # # 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" + spec.version = ElasticGraph::VERSION + spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] + spec.email = ["myron@squareup.com"] + spec.homepage = "https://block.github.io/elasticgraph/" + spec.license = "MIT" spec.summary = "ElasticGraph meta-gem that pulls in all the core ElasticGraph gems." - spec.add_dependency "elasticgraph-admin", eg_version - spec.add_dependency "elasticgraph-graphql", eg_version - spec.add_dependency "elasticgraph-indexer", eg_version - spec.add_dependency "elasticgraph-local", 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-admin", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION + spec.add_dependency "elasticgraph-local", ElasticGraph::VERSION end diff --git a/gemspec_helper.rb b/gemspec_helper.rb deleted file mode 100644 index 4f52857c..00000000 --- a/gemspec_helper.rb +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2024 Block, Inc. -# -# Use of this source code is governed by an MIT-style -# license that can be found in the LICENSE file or at -# https://opensource.org/licenses/MIT. -# -# frozen_string_literal: true - -require_relative "elasticgraph-support/lib/elastic_graph/version" - -module ElasticGraphGemspecHelper - # Helper methor for defining a gemspec for an elasticgraph gem. - def self.define_elasticgraph_gem(gemspec_file:, category:) - gem_dir = ::File.expand_path(::File.dirname(gemspec_file)) - - ::Gem::Specification.new do |spec| - spec.name = ::File.basename(gemspec_file, ".gemspec") - spec.version = ElasticGraph::VERSION - spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"] - spec.email = ["myron@squareup.com"] - spec.homepage = "https://block.github.io/elasticgraph/" - spec.license = "MIT" - spec.metadata["gem_category"] = category.to_s - - # 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/", # TODO(#2): update this URL to link to the exact doc version - "homepage_uri" => "https://block.github.io/elasticgraph/", - "source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}", - "gem_category" => category.to_s # 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(gem_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" - - yield spec, ElasticGraph::VERSION - end - end -end