Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datadog updates #4

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ source 'https://rubygems.org'

gemspec

group :development do
gem 'irb'
end

group :test do
gem 'base64'
gem 'pry'
gem 'rake'
gem 'rspec'
gem 'simplecov'
end

group :datadog do
gem 'aws-sdk-core'
gem 'ddtrace'
gem 'datadog'
gem 'datadog-lambda'
gem 'ostruct'
gem 'rexml'
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ rescue => err
end
```

### Zero Dependencies
### (Near) Zero Dependencies

Finally, `yake` does not depend on any other gems, using the Ruby stdlib only. This helps keep your Lambda packages slim & speedy.
Finally, `yake` does not depend on any 3rd party gems. The only exceptions are the `json` and `logger` gems, which are being removed from the Ruby stdlib in Ruby v3.5. This helps keep your Lambda packages slim & speedy.

## Support Helpers

Expand Down
15 changes: 7 additions & 8 deletions lib/yake/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ class Formatter < ::Logger::Formatter
Format = "%s %s %s\n"

def call(severity, time, progname, msg)
Format % [ severity, progname.nil? ? '-' : "RequestId: #{ progname }", msg2str(msg).strip ]
Format % [
severity,
progname.nil? ? '-' : "RequestId: #{ progname }",
msg2str(msg).strip
]
end
end
end

class << self
attr_writer :logger, :pretty

def logger
@logger ||= Logger.new
end

def pretty?
@pretty == true
end
def logger = @logger ||= Logger.new
def pretty? = @pretty == true
end
end
2 changes: 1 addition & 1 deletion lib/yake/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Yake
VERSION = '1.1.1'
VERSION = '1.2.0'
end
11 changes: 4 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
require 'simplecov'
SimpleCov.start

require 'base64'

require 'yake/api'
require 'yake/datadog'
require 'yake/support'

ENV['DD_ENHANCED_METRICS'] = '0'
case Datadog::Lambda::VERSION::MAJOR
when 1
Datadog.configure { |c| c.tracer.enabled = false }
else
Datadog.configure { |c| c.tracing.enabled = false }
end
ENV['DD_LOG_LEVEL'] = 'WARN'
Datadog.configure { |c| c.tracing.enabled = true }

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
Expand Down
2 changes: 2 additions & 0 deletions yake.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ Gem::Specification.new do |spec|
spec.files = Dir['README*', 'LICENSE*', 'lib/**/*']

spec.required_ruby_version = '>= 3.2.0'
spec.add_dependency 'json'
spec.add_dependency 'logger'
end
Loading