instana 1.192.1 → 1.193.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +200 -133
- data/.gitignore +3 -0
- data/.rubocop.yml +10 -1145
- data/.rubocop_todo.yml +1140 -0
- data/Appraisals +103 -0
- data/Gemfile +14 -32
- data/LICENSE +2 -1
- data/Rakefile +19 -39
- data/benchmarks/10k-rack-traces.rb +3 -0
- data/benchmarks/Gemfile +4 -0
- data/benchmarks/id_generation.rb +4 -0
- data/benchmarks/opentracing.rb +4 -0
- data/benchmarks/rack_vanilla_vs_traced.rb +3 -0
- data/benchmarks/stackprof_rack_tracing.rb +3 -0
- data/benchmarks/time_processing.rb +4 -0
- data/bin/console +8 -4
- data/examples/opentracing.rb +4 -0
- data/examples/tracing.rb +4 -0
- data/extras/license_header.rb +44 -0
- data/gemfiles/.bundle/config +1 -2
- data/gemfiles/cuba_30.gemfile +18 -0
- data/gemfiles/dalli_20.gemfile +18 -0
- data/gemfiles/excon_02.gemfile +18 -0
- data/gemfiles/graphql_10.gemfile +18 -0
- data/gemfiles/grpc_10.gemfile +18 -0
- data/gemfiles/net_http_01.gemfile +17 -0
- data/gemfiles/rack_16.gemfile +18 -0
- data/gemfiles/rack_20.gemfile +18 -0
- data/gemfiles/rails_42.gemfile +21 -0
- data/gemfiles/rails_50.gemfile +21 -0
- data/gemfiles/rails_52.gemfile +21 -0
- data/gemfiles/rails_60.gemfile +21 -0
- data/gemfiles/redis_40.gemfile +18 -0
- data/gemfiles/resque_122.gemfile +19 -0
- data/gemfiles/resque_20.gemfile +18 -0
- data/gemfiles/rest_client_16.gemfile +18 -0
- data/gemfiles/rest_client_20.gemfile +18 -0
- data/gemfiles/roda_20.gemfile +18 -0
- data/gemfiles/roda_30.gemfile +18 -0
- data/gemfiles/sidekiq_42.gemfile +18 -0
- data/gemfiles/sidekiq_50.gemfile +18 -0
- data/gemfiles/sinatra_14.gemfile +18 -0
- data/instana.gemspec +5 -7
- data/lib/instana.rb +3 -0
- data/lib/instana/activator.rb +44 -0
- data/lib/instana/activators/action_cable.rb +24 -0
- data/lib/instana/activators/action_controller_api.rb +21 -0
- data/lib/instana/activators/action_controller_base.rb +21 -0
- data/lib/instana/activators/action_view.rb +21 -0
- data/lib/instana/activators/active_record.rb +21 -0
- data/lib/instana/activators/cuba.rb +21 -0
- data/lib/instana/activators/dalli.rb +23 -0
- data/lib/instana/activators/excon.rb +20 -0
- data/lib/instana/activators/graphql.rb +22 -0
- data/lib/instana/activators/grpc_client.rb +20 -0
- data/lib/instana/activators/grpc_server.rb +20 -0
- data/lib/instana/activators/net_http.rb +20 -0
- data/lib/instana/activators/rack.rb +16 -0
- data/lib/instana/activators/rails.rb +18 -0
- data/lib/instana/activators/redis.rb +20 -0
- data/lib/instana/activators/resque_client.rb +21 -0
- data/lib/instana/activators/resque_worker.rb +33 -0
- data/lib/instana/activators/rest_client.rb +20 -0
- data/lib/instana/activators/roda.rb +21 -0
- data/lib/instana/activators/sidekiq_client.rb +24 -0
- data/lib/instana/activators/sidekiq_worker.rb +24 -0
- data/lib/instana/activators/sinatra.rb +21 -0
- data/lib/instana/agent.rb +3 -0
- data/lib/instana/agent/helpers.rb +3 -0
- data/lib/instana/agent/hooks.rb +3 -0
- data/lib/instana/agent/tasks.rb +3 -0
- data/lib/instana/base.rb +3 -0
- data/lib/instana/collector.rb +3 -0
- data/lib/instana/collectors/gc.rb +3 -0
- data/lib/instana/collectors/memory.rb +3 -0
- data/lib/instana/collectors/thread.rb +3 -0
- data/lib/instana/config.rb +3 -0
- data/lib/instana/frameworks/cuba.rb +9 -13
- data/lib/instana/frameworks/rails.rb +22 -32
- data/lib/instana/frameworks/roda.rb +10 -13
- data/lib/instana/frameworks/sinatra.rb +4 -8
- data/lib/instana/helpers.rb +3 -0
- data/lib/instana/instrumentation/action_cable.rb +53 -0
- data/lib/instana/instrumentation/action_controller.rb +84 -0
- data/lib/instana/instrumentation/action_view.rb +30 -0
- data/lib/instana/instrumentation/active_record.rb +50 -0
- data/lib/instana/instrumentation/dalli.rb +10 -18
- data/lib/instana/instrumentation/excon.rb +54 -57
- data/lib/instana/instrumentation/graphql.rb +19 -18
- data/lib/instana/instrumentation/grpc.rb +73 -66
- data/lib/instana/instrumentation/instrumented_request.rb +6 -1
- data/lib/instana/instrumentation/net-http.rb +46 -47
- data/lib/instana/instrumentation/rack.rb +4 -0
- data/lib/instana/instrumentation/redis.rb +13 -18
- data/lib/instana/instrumentation/resque.rb +17 -50
- data/lib/instana/instrumentation/rest-client.rb +5 -17
- data/lib/instana/instrumentation/sidekiq-client.rb +3 -9
- data/lib/instana/instrumentation/sidekiq-worker.rb +3 -9
- data/lib/instana/opentracing/carrier.rb +3 -0
- data/lib/instana/opentracing/tracer.rb +3 -0
- data/lib/instana/rack.rb +4 -0
- data/lib/instana/secrets.rb +10 -7
- data/lib/instana/setup.rb +6 -1
- data/lib/instana/thread_local.rb +3 -0
- data/lib/instana/tracer.rb +3 -0
- data/lib/instana/tracing/processor.rb +3 -0
- data/lib/instana/tracing/span.rb +3 -0
- data/lib/instana/tracing/span_context.rb +3 -0
- data/lib/instana/util.rb +4 -41
- data/lib/instana/version.rb +4 -1
- data/lib/oj_check.rb +3 -0
- data/lib/opentracing.rb +3 -0
- data/test/activator_test.rb +30 -0
- data/test/agent/agent_test.rb +3 -0
- data/test/benchmarks/bench_id_generation.rb +3 -0
- data/test/benchmarks/bench_opentracing.rb +3 -0
- data/test/config_test.rb +3 -0
- data/test/frameworks/cuba_test.rb +41 -40
- data/test/frameworks/roda_test.rb +43 -41
- data/test/frameworks/sinatra_test.rb +64 -64
- data/test/instana_test.rb +3 -0
- data/test/instrumentation/dalli_test.rb +3 -0
- data/test/instrumentation/excon_test.rb +4 -0
- data/test/instrumentation/graphql_test.rb +3 -0
- data/test/instrumentation/grpc_test.rb +5 -1
- data/test/instrumentation/{net-http_test.rb → net_http_test.rb} +4 -0
- data/test/instrumentation/{instrumented_request_test.rb → rack_instrumented_request_test.rb} +4 -1
- data/test/{frameworks → instrumentation}/rack_test.rb +3 -1
- data/test/instrumentation/rails_action_cable_test.rb +131 -0
- data/test/{frameworks/rails/actioncontroller_test.rb → instrumentation/rails_action_controller_test.rb} +40 -21
- data/test/instrumentation/rails_action_view_test.rb +151 -0
- data/test/instrumentation/rails_active_record_test.rb +122 -0
- data/test/instrumentation/redis_test.rb +3 -0
- data/test/instrumentation/resque_test.rb +6 -11
- data/test/instrumentation/{rest-client_test.rb → rest_client_test.rb} +9 -0
- data/test/instrumentation/sidekiq-client_test.rb +4 -0
- data/test/instrumentation/sidekiq-worker_test.rb +4 -0
- data/test/secrets_test.rb +3 -0
- data/test/support/apps/active_record/active_record.rb +24 -0
- data/test/{servers/grpc_50051.rb → support/apps/grpc/boot.rb} +4 -1
- data/test/{apps → support/apps/grpc}/grpc_server.rb +3 -0
- data/test/{servers/rackapp_6511.rb → support/apps/http_endpoint/boot.rb} +3 -0
- data/test/{servers/rails_3205.rb → support/apps/rails/boot.rb} +10 -13
- data/test/{models → support/apps/rails/models}/block.rb +4 -1
- data/test/{models → support/apps/rails/models}/block6.rb +3 -0
- data/test/support/apps/resque/boot.rb +5 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_error_job.rb +3 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_fast_job.rb +3 -0
- data/test/support/apps/sidekiq/boot.rb +25 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_1.rb +3 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_2.rb +3 -0
- data/test/{servers → support/apps}/sidekiq/worker.rb +5 -2
- data/test/support/helpers.rb +97 -0
- data/test/test_helper.rb +27 -144
- data/test/tracing/custom_test.rb +3 -0
- data/test/tracing/id_management_test.rb +4 -0
- data/test/tracing/opentracing_test.rb +3 -0
- data/test/tracing/tracer_async_test.rb +3 -0
- data/test/tracing/tracer_test.rb +3 -0
- metadata +105 -96
- data/gemfiles/libraries.gemfile +0 -73
- data/gemfiles/rails32.gemfile +0 -51
- data/gemfiles/rails42.gemfile +0 -50
- data/gemfiles/rails50.gemfile +0 -52
- data/gemfiles/rails52.gemfile +0 -52
- data/gemfiles/rails60.gemfile +0 -72
- data/lib/instana/frameworks/instrumentation/abstract_mysql_adapter.rb +0 -58
- data/lib/instana/frameworks/instrumentation/action_controller.rb +0 -194
- data/lib/instana/frameworks/instrumentation/action_view.rb +0 -43
- data/lib/instana/frameworks/instrumentation/active_record.rb +0 -27
- data/lib/instana/frameworks/instrumentation/mysql2_adapter.rb +0 -87
- data/lib/instana/frameworks/instrumentation/mysql_adapter.rb +0 -62
- data/lib/instana/frameworks/instrumentation/postgresql_adapter.rb +0 -103
- data/lib/instana/instrumentation.rb +0 -25
- data/lib/instana/test.rb +0 -43
- data/test/apps/cuba.rb +0 -19
- data/test/apps/roda.rb +0 -13
- data/test/apps/sinatra.rb +0 -9
- data/test/frameworks/rails/actionview3_test.rb +0 -210
- data/test/frameworks/rails/actionview4_test.rb +0 -208
- data/test/frameworks/rails/actionview5_test.rb +0 -221
- data/test/frameworks/rails/activerecord_test.rb +0 -279
- data/test/servers/helpers/sidekiq_worker_initializer.rb +0 -27
data/Appraisals
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
appraise 'cuba-30' do
|
5
|
+
gem 'cuba', '>= 3.0', '< 4.0'
|
6
|
+
end
|
7
|
+
|
8
|
+
appraise 'dalli-20' do
|
9
|
+
gem 'dalli', '>= 2.0', '< 3.0'
|
10
|
+
end
|
11
|
+
|
12
|
+
appraise 'excon-02' do
|
13
|
+
gem 'excon', '>= 0.21.0', '< 1.0'
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise 'grpc-10' do
|
17
|
+
gem 'grpc', '>= 1.0', '< 2.0'
|
18
|
+
end
|
19
|
+
|
20
|
+
appraise 'graphql-10' do
|
21
|
+
gem 'graphql', '>= 1.0', '< 2.0'
|
22
|
+
end
|
23
|
+
|
24
|
+
appraise 'rack-16' do
|
25
|
+
gem 'rack', '~> 1.6'
|
26
|
+
end
|
27
|
+
|
28
|
+
appraise 'rack-20' do
|
29
|
+
gem 'rack', '>= 2.0', '< 3.0'
|
30
|
+
end
|
31
|
+
|
32
|
+
appraise 'rails-42' do
|
33
|
+
gem 'rails', '>= 4.2', '< 5.0'
|
34
|
+
gem 'mysql2', '0.4.10'
|
35
|
+
gem 'pg', '~> 0.21'
|
36
|
+
gem 'sqlite3', '~> 1.3', '< 1.4'
|
37
|
+
end
|
38
|
+
|
39
|
+
appraise 'rails-50' do
|
40
|
+
gem 'rails', '>= 5.0', '< 5.1'
|
41
|
+
gem 'mysql2', '0.4.10'
|
42
|
+
gem 'pg'
|
43
|
+
gem 'sqlite3', '~> 1.3', '< 1.4'
|
44
|
+
end
|
45
|
+
|
46
|
+
appraise 'rails-52' do
|
47
|
+
gem 'rails', '>= 5.2', '< 6.0'
|
48
|
+
gem 'mysql2', '0.4.10'
|
49
|
+
gem 'pg'
|
50
|
+
gem 'sqlite3', '~> 1.3', '< 1.4'
|
51
|
+
end
|
52
|
+
|
53
|
+
appraise 'rails-60' do
|
54
|
+
gem 'rails', '>= 6.0', '< 6.1'
|
55
|
+
gem 'mysql2', '0.4.10'
|
56
|
+
gem 'pg'
|
57
|
+
gem 'sqlite3', '~> 1.4'
|
58
|
+
end
|
59
|
+
|
60
|
+
appraise 'redis-40' do
|
61
|
+
gem 'redis', '>= 4.0.0', '< 5.0'
|
62
|
+
end
|
63
|
+
|
64
|
+
appraise 'rest-client-16' do
|
65
|
+
gem 'rest-client', '>= 1.6', '< 2.0'
|
66
|
+
end
|
67
|
+
|
68
|
+
appraise 'rest-client-20' do
|
69
|
+
gem 'rest-client', '>= 2.0', '< 3.0'
|
70
|
+
end
|
71
|
+
|
72
|
+
appraise 'resque-122' do
|
73
|
+
gem 'resque', '>= 1.22', '< 2.0'
|
74
|
+
gem 'redis', '~> 3.3', '>= 3.3.5'
|
75
|
+
end
|
76
|
+
|
77
|
+
appraise 'resque-20' do
|
78
|
+
gem 'resque', '>= 2.0', '< 3.0'
|
79
|
+
end
|
80
|
+
|
81
|
+
appraise 'roda-20' do
|
82
|
+
gem 'roda', '>= 2.0', '< 3.0'
|
83
|
+
end
|
84
|
+
|
85
|
+
appraise 'roda-30' do
|
86
|
+
gem 'roda', '>= 3.0', '< 4.0'
|
87
|
+
end
|
88
|
+
|
89
|
+
appraise 'net-http-01' do
|
90
|
+
# gem 'net-http', '~> 0.1.1'
|
91
|
+
end
|
92
|
+
|
93
|
+
appraise 'sinatra-14' do
|
94
|
+
gem 'sinatra', '1.4.7'
|
95
|
+
end
|
96
|
+
|
97
|
+
appraise 'sidekiq-42' do
|
98
|
+
gem 'sidekiq', '~> 4.2.10'
|
99
|
+
end
|
100
|
+
|
101
|
+
appraise 'sidekiq-50' do
|
102
|
+
gem 'sidekiq', '>= 5.0', '< 6.0'
|
103
|
+
end
|
data/Gemfile
CHANGED
@@ -1,41 +1,23 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2016
|
3
|
+
|
1
4
|
source 'https://rubygems.org'
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
gem 'webmock'
|
9
|
-
gem 'puma'
|
6
|
+
gem 'rake'
|
7
|
+
gem 'minitest', '5.9.1'
|
8
|
+
gem 'minitest-reporters'
|
9
|
+
gem 'webmock'
|
10
|
+
gem 'puma'
|
10
11
|
|
11
|
-
|
12
|
-
if RUBY_VERSION < '2.2'
|
13
|
-
gem 'rack', '~> 1.6'
|
14
|
-
end
|
15
|
-
gem 'rack-test'
|
12
|
+
gem 'rubocop', '~> 1.9'
|
16
13
|
|
17
|
-
|
18
|
-
|
14
|
+
# Rack v2 dropped support for Ruby 2.2 and higher.
|
15
|
+
if RUBY_VERSION < '2.2'
|
16
|
+
gem 'rack', '~> 1.6'
|
19
17
|
end
|
18
|
+
gem 'rack-test'
|
20
19
|
|
21
|
-
|
22
|
-
gem 'ruby-debug', :platforms => [:mri_18, :jruby]
|
23
|
-
gem 'debugger', :platform => :mri_19
|
24
|
-
gem 'stackprof', :platform => [:mri_19, :mri_20]
|
25
|
-
|
26
|
-
if RUBY_VERSION > '1.8.7'
|
27
|
-
gem 'pry'
|
28
|
-
|
29
|
-
if RUBY_VERSION < '2.2'
|
30
|
-
gem 'byebug', '< 9.1.0', :platform => [:mri_19, :mri_20]
|
31
|
-
gem 'pry-byebug', :platform => [:mri_19, :mri_20]
|
32
|
-
else
|
33
|
-
gem 'pry-byebug', :platform => :ruby
|
34
|
-
end
|
35
|
-
else
|
36
|
-
gem 'pry', '0.9.12.4'
|
37
|
-
end
|
38
|
-
end
|
20
|
+
gem 'simplecov', '~> 0.21.2'
|
39
21
|
|
40
22
|
# instana.gemspec
|
41
23
|
gemspec
|
data/LICENSE
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) Copyright IBM Corp. 2021
|
4
|
+
Copyright (c) 2017 Instana, Inc. https://www.instana.com/
|
4
5
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/Rakefile
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2016
|
3
|
+
|
4
|
+
require 'bundler/gem_tasks'
|
5
|
+
require 'rake/testtask'
|
6
|
+
|
7
|
+
require 'json'
|
3
8
|
|
4
9
|
Rake::TestTask.new(:test) do |t|
|
5
10
|
t.verbose = false
|
@@ -8,43 +13,18 @@ Rake::TestTask.new(:test) do |t|
|
|
8
13
|
|
9
14
|
t.libs << "test"
|
10
15
|
t.libs << "lib"
|
11
|
-
|
12
|
-
|
13
|
-
'
|
14
|
-
'test/{
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
when /rails5/
|
23
|
-
t.test_files = %w(test/frameworks/rails/activerecord_test.rb
|
24
|
-
test/frameworks/rails/actioncontroller_test.rb
|
25
|
-
test/frameworks/rails/actionview5_test.rb)
|
26
|
-
when /rails42/
|
27
|
-
t.test_files = %w(test/frameworks/rails/activerecord_test.rb
|
28
|
-
test/frameworks/rails/actioncontroller_test.rb
|
29
|
-
test/frameworks/rails/actionview4_test.rb)
|
30
|
-
when /rails32/
|
31
|
-
t.test_files = %w(test/frameworks/rails/activerecord_test.rb
|
32
|
-
test/frameworks/rails/actioncontroller_test.rb
|
33
|
-
test/frameworks/rails/actionview3_test.rb)
|
34
|
-
when /libraries/
|
35
|
-
t.test_files = Dir['test/{instrumentation,frameworks}/*_test.rb']
|
16
|
+
|
17
|
+
if ENV['APPRAISAL_INITIALIZED']
|
18
|
+
appraised_group = File.basename(ENV['BUNDLE_GEMFILE']).split(/_[0-9]+\./).first
|
19
|
+
suite_files = Dir['test/{instrumentation,frameworks}/*_test.rb']
|
20
|
+
|
21
|
+
t.test_files = suite_files.select { |f| File.basename(f).start_with?(appraised_group) }
|
22
|
+
else
|
23
|
+
t.test_files = Dir[
|
24
|
+
'test/*_test.rb',
|
25
|
+
'test/{agent,tracing}/*_test.rb'
|
26
|
+
]
|
36
27
|
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
task :environment do
|
41
|
-
ENV['INSTANA_DEBUG'] = 'true'
|
42
|
-
Bundler.require(:default, :development)
|
43
|
-
end
|
44
|
-
|
45
|
-
task :console => :environment do
|
46
|
-
ARGV.clear
|
47
|
-
Pry.start
|
48
28
|
end
|
49
29
|
|
50
|
-
task :default => :
|
30
|
+
task :default => :test
|
data/benchmarks/Gemfile
CHANGED
data/benchmarks/id_generation.rb
CHANGED
data/benchmarks/opentracing.rb
CHANGED
data/bin/console
CHANGED
data/examples/opentracing.rb
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
# to `OpenTracing.global_tracer`. Once the gem is loaded, you can
|
5
5
|
# immediately start making OpenTracing calls.
|
6
6
|
#
|
7
|
+
|
8
|
+
# (c) Copyright IBM Corp. 2021
|
9
|
+
# (c) Copyright Instana Inc. 2018
|
10
|
+
|
7
11
|
require "opentracing"
|
8
12
|
|
9
13
|
entry_span = OpenTracing.start_span("HandMadeRackServer")
|
data/examples/tracing.rb
CHANGED
@@ -17,6 +17,10 @@
|
|
17
17
|
# points in webservers (e.g. rack), it will initialize tracing and instrument the passed
|
18
18
|
# block. <incoming_id> is a hash for continuing remote traces (remote in terms
|
19
19
|
# of service calls, or message queues).
|
20
|
+
|
21
|
+
# (c) Copyright IBM Corp. 2021
|
22
|
+
# (c) Copyright Instana Inc. 2016
|
23
|
+
|
20
24
|
Instana::Tracer.start_or_continue_trace(:my_block_name, {}, incoming_context) do
|
21
25
|
# Code block
|
22
26
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
module RuboCop
|
7
|
+
module Cop
|
8
|
+
module Instana
|
9
|
+
# Ensures the license header is present in each ruby file
|
10
|
+
class LicenseHeader < Base
|
11
|
+
extend AutoCorrector
|
12
|
+
|
13
|
+
MSG = 'The license header should be present in each file.'.freeze
|
14
|
+
HEADER = '(c) Copyright IBM Corp.'.freeze
|
15
|
+
HEADER_TEMPLATE = <<~HERE.freeze
|
16
|
+
# (c) Copyright IBM Corp. %d
|
17
|
+
# (c) Copyright Instana Inc. %d
|
18
|
+
HERE
|
19
|
+
|
20
|
+
def on_new_investigation
|
21
|
+
first_statement = processed_source.tokens.detect { |t| t.type != :tCOMMENT }
|
22
|
+
file_name = first_statement.pos.source_buffer.name
|
23
|
+
header_comment = processed_source.comments.detect do |comment|
|
24
|
+
first_statement_line = first_statement.pos.line
|
25
|
+
comment_line = comment.loc.line
|
26
|
+
|
27
|
+
(comment_line < first_statement_line) && comment.text.include?(HEADER)
|
28
|
+
end
|
29
|
+
|
30
|
+
return if header_comment
|
31
|
+
|
32
|
+
add_offense(first_statement.pos) do |corrector|
|
33
|
+
current_year = Time.now.year
|
34
|
+
created_time = `git log --diff-filter=A --follow --format=%aD -1 -- #{file_name}`
|
35
|
+
created_year = created_time.empty? ? current_year : Time.parse(created_time).year
|
36
|
+
|
37
|
+
header_text = format(HEADER_TEMPLATE, current_year, created_year)
|
38
|
+
corrector.insert_before(first_statement.pos, "\n#{header_text}\n")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/gemfiles/.bundle/config
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
# (c) Copyright IBM Corp. 2021
|
4
|
+
# (c) Copyright Instana Inc. 2021
|
5
|
+
|
6
|
+
source "https://rubygems.org"
|
7
|
+
|
8
|
+
gem "rake"
|
9
|
+
gem "minitest", "5.9.1"
|
10
|
+
gem "minitest-reporters"
|
11
|
+
gem "webmock"
|
12
|
+
gem "puma"
|
13
|
+
gem "rubocop", "~> 1.9"
|
14
|
+
gem "rack-test"
|
15
|
+
gem "simplecov", "~> 0.21.2"
|
16
|
+
gem "cuba", ">= 3.0", "< 4.0"
|
17
|
+
|
18
|
+
gemspec path: "../"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
# (c) Copyright IBM Corp. 2021
|
4
|
+
# (c) Copyright Instana Inc. 2021
|
5
|
+
|
6
|
+
source "https://rubygems.org"
|
7
|
+
|
8
|
+
gem "rake"
|
9
|
+
gem "minitest", "5.9.1"
|
10
|
+
gem "minitest-reporters"
|
11
|
+
gem "webmock"
|
12
|
+
gem "puma"
|
13
|
+
gem "rubocop", "~> 1.9"
|
14
|
+
gem "rack-test"
|
15
|
+
gem "simplecov", "~> 0.21.2"
|
16
|
+
gem "dalli", ">= 2.0", "< 3.0"
|
17
|
+
|
18
|
+
gemspec path: "../"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
# (c) Copyright IBM Corp. 2021
|
4
|
+
# (c) Copyright Instana Inc. 2021
|
5
|
+
|
6
|
+
source "https://rubygems.org"
|
7
|
+
|
8
|
+
gem "rake"
|
9
|
+
gem "minitest", "5.9.1"
|
10
|
+
gem "minitest-reporters"
|
11
|
+
gem "webmock"
|
12
|
+
gem "puma"
|
13
|
+
gem "rubocop", "~> 1.9"
|
14
|
+
gem "rack-test"
|
15
|
+
gem "simplecov", "~> 0.21.2"
|
16
|
+
gem "excon", ">= 0.21.0", "< 1.0"
|
17
|
+
|
18
|
+
gemspec path: "../"
|