Skip to content

Commit

Permalink
Address suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Costa <marco.costa@datadoghq.com>
  • Loading branch information
marcotc committed Jun 21, 2024
1 parent f997743 commit f45084d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/datadog/tracing/contrib/rails/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ module Datadog
module Tracing
module Contrib
module Rails
# Limit the maximum size of the source code captured in the source tag.
MAX_TAG_VALUE_SIZE = 4096
private_constant :MAX_TAG_VALUE_SIZE

# Instruments the `bin/rails runner` command.
# This command executes the provided code with the host Rails application loaded.
# The command can be either:
Expand All @@ -16,6 +12,10 @@ module Rails
# * `inline code`: for code provided directly as a command line argument.
# @see https://guides.rubyonrails.org/v6.1/command_line.html#bin-rails-runner
module Runner
# Limit the maximum size of the source code captured in the source tag.
MAX_TAG_VALUE_SIZE = 4096
private_constant :MAX_TAG_VALUE_SIZE

def runner(code_or_file = nil, *_command_argv)
if code_or_file == '-'
name = Ext::SPAN_RUNNER_STDIN
Expand Down
2 changes: 0 additions & 2 deletions spec/datadog/tracing/contrib/rails/support/base.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'rails/all'
# Loaded by the `bin/rails` script in a real Rails application
require 'rails/command' if Rails::VERSION::MAJOR > 4

require_relative 'controllers'
require_relative 'models'
Expand Down
2 changes: 2 additions & 0 deletions spec/datadog/tracing/contrib/rails/support/rails5.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'rails/all'
# Loaded by the `bin/rails` script in a real Rails application
require 'rails/command'

if ENV['USE_SIDEKIQ']
require 'sidekiq/testing'
Expand Down
2 changes: 2 additions & 0 deletions spec/datadog/tracing/contrib/rails/support/rails6.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'rails/all'
# Loaded by the `bin/rails` script in a real Rails application
require 'rails/command'

if ENV['USE_SIDEKIQ']
require 'sidekiq/testing'
Expand Down

0 comments on commit f45084d

Please sign in to comment.