Skip to content

Commit

Permalink
prepare gemspec for release; specify ddtrace as dev dependency, not r…
Browse files Browse the repository at this point in the history
…untime one
  • Loading branch information
anmarchenko committed Sep 7, 2023
1 parent 25d26b2 commit f0b4e91
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 34 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Datadog.configure do |c|
# Enables the RSpec instrumentation
c.ci.instrument :rspec, **options
end

```

`options` are the following keyword arguments:
Expand Down
54 changes: 30 additions & 24 deletions datadog-ci.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,41 @@ require_relative "lib/datadog/ci/version"

Gem::Specification.new do |spec|
spec.name = "datadog-ci"
spec.version = Datadog::CI::VERSION
spec.version = Datadog::CI::VERSION::STRING
spec.required_ruby_version = [
">= #{Datadog::CI::VERSION::MINIMUM_RUBY_VERSION}",
"< #{Datadog::CI::VERSION::MAXIMUM_RUBY_VERSION}"
]
spec.required_rubygems_version = ">= 2.0.0"
spec.authors = ["Datadog, Inc."]
spec.email = ["dev@datadoghq.com"]

spec.summary = "Datadog CI visibility for your ruby application"
# spec.description = "TODO: Write a longer description or delete this line."
# spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.description = <<-DESC
datadog-ci is a Datadog's CI visibility library for Ruby. It traces
tests as they are being executed and brings developers visibility into
their CI pipelines.
DESC

spec.homepage = "https://github.com/DataDog/datadog-ci-rb"
spec.license = "BSD-3-Clause"
# spec.required_ruby_version = ">= 2.6.0"

spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"

# spec.metadata["homepage_uri"] = spec.homepage
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."

# 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.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "ddtrace", "~> 1"
spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["changelog_uri"] = "https://github.com/DataDog/datadog-ci-rb/blob/main/CHANGELOG.md"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/DataDog/datadog-ci-rb"

spec.files =
Dir[*%w[
CHANGELOG.md
LICENSE*
NOTICE
README.md
lib/**/*
sig/**/*
]].select { |fn| File.file?(fn) } # We don't want directories, only files

spec.require_paths = ["lib"]

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.add_development_dependency "ddtrace", "~> 1"
end
20 changes: 19 additions & 1 deletion lib/datadog/ci/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

module Datadog
module CI
VERSION = "0.1.0"
module VERSION
MAJOR = "0"
MINOR = "1"
PATCH = "0"

STRING = [MAJOR, MINOR, PATCH].compact.join(".")

MINIMUM_RUBY_VERSION = "2.1.0"

# Restrict the installation of this gem with untested future versions of Ruby.
#
# This prevents crashes in the native extension code and sends a clear signal to the
# user that this version of the gem is untested for the host Ruby version.
#
# To allow testing with the next unreleased version of Ruby, the version check is performed
# as `< #{MAXIMUM_RUBY_VERSION}`, meaning prereleases of MAXIMUM_RUBY_VERSION are allowed
# but not stable MAXIMUM_RUBY_VERSION releases.
MAXIMUM_RUBY_VERSION = "3.4"
end
end
end
11 changes: 10 additions & 1 deletion sig/datadog/ci/version.rbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module Datadog
module CI
VERSION: "0.1.0"
module VERSION
MAJOR: "0"
MINOR: "1"
PATCH: "0"

STRING: String

MINIMUM_RUBY_VERSION: "2.1.0"
MAXIMUM_RUBY_VERSION: "3.4"
end
end
end
7 changes: 7 additions & 0 deletions spec/datadog/ci/version_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

RSpec.describe Datadog::CI::VERSION do
it "has a version number" do
expect(Datadog::CI::VERSION::STRING).to eq("0.1.0")
end
end
7 changes: 0 additions & 7 deletions spec/datadog/ci_spec.rb

This file was deleted.

0 comments on commit f0b4e91

Please sign in to comment.