From b1bbc324f6425ba2eea457a2c82cc7bca3b98f0d Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 22 Oct 2024 12:50:09 +0200 Subject: [PATCH 1/4] Add publishing via Trusted Publishers --- .github/workflows/publish.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..91d1ea0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +name: Publish Gem + +on: workflow_dispatch + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.2.4' + - uses: rubygems/release-gem@v1 From 36c1448102fe0fdaf7c92853a7afcb033188a29b Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 22 Oct 2024 12:53:24 +0200 Subject: [PATCH 2/4] Remove debugger references --- bin/catadog | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/catadog b/bin/catadog index e78c387..f9c26fa 100755 --- a/bin/catadog +++ b/bin/catadog @@ -8,7 +8,6 @@ require "rack" require "sinatra/base" require "net/http" require "uri" -require "pry" require "json" require "msgpack" require "base64" @@ -290,9 +289,6 @@ module Datadog def handler(req, res) # https://github.com/rack/rack/blob/8f5c885f7e0427b489174a55e6d88463173f22d2/SPEC.rdoc - # binding.pry if /config/.match?(req.path_info) - # binding.pry if /traces/.match?(req.path_info) - env = {} env["REQUEST_METHOD"] = req.request_method From 7b09671724abf6a5037ab579c7f8a345b49dcc1a Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 22 Oct 2024 12:56:31 +0200 Subject: [PATCH 3/4] Add missing `require` --- bin/catadog | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/catadog b/bin/catadog index f9c26fa..774d192 100755 --- a/bin/catadog +++ b/bin/catadog @@ -13,6 +13,7 @@ require "msgpack" require "base64" require "date" require "pathname" +require "stringio" class WEBrick::HTTPServlet::ProcHandler # rubocop:disable Style/Alias From c88cb0789904c82764e9d96fbfd0d5703e770611 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 22 Oct 2024 13:02:48 +0200 Subject: [PATCH 4/4] Update usage --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5194a7a..13d18fb 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,28 @@ Run the following command to start a new Docker container with `catadog`. docker run --rm -d --name catadog ghcr.io/datadog/catadog ``` -### or Ruby Bundler +### Global command + +Run the following commands to install and run `catadog` locally. + +``` +gem install catadog +catadog +``` + +### Per project via a Gemfile + +``` +cat > Gemfile <<'EOF' +source 'https://rubygems.org' + +gem 'catadog' +EOF +bundle install +catadog +``` + +### For `catadog` development Run the following commands to install and run `catadog` locally.