appmap 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '02814a0f9d0927d19c2d341a22d8f8ec66b83bc022833a09a7777ce81ec4edfc'
4
- data.tar.gz: 11b2786d88e360fc78e046675ae799e7106625dd02b4a3070c3835bfe8feea05
3
+ metadata.gz: ce006905408a0ee15ccaee33ecb13e8bfbf1bc7b93f3cc4cbb105e2be9849bee
4
+ data.tar.gz: 4f73e289a332301d6efbf0c7e8985b5e62a8a030f90c4265b221fc1d67c801be
5
5
  SHA512:
6
- metadata.gz: c852ae464d52f9f29ef9222fa1627f99b4f5baf1907b1cd54cbfb969ff2323cb19e0d5b53bad1356518ec21a07243ea71237ad831a62ffe825a2601cca1a5cf7
7
- data.tar.gz: 49c5ba0d0c20d8bee6e4c768544ab6abe0f0f0d71a1a59bc04fcf867e93bc743eda4cc94f7505c0a1194c07e95e2b8e7f875a42b16aa3da2a21068a61ba42a10
6
+ metadata.gz: 86108afa917712908800f9303368ee48c8b0bf7d66892e6aadd76a18d76d355106f751984579bf57f9fdd876f7e4071f75a0d6cdf4fd90dfa5ce90a93d1ed9a1
7
+ data.tar.gz: b62b7793fd03c9d3cb43792b0a9b056547b4dd9f75a6b31f582a12d7a19cfdf4eaee7f566b27eaaf9a36dd4477afa396184b31bc753858b979ac5fb6804d3027
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [0.50.0](https://github.com/applandinc/appmap-ruby/compare/v0.49.0...v0.50.0) (2021-06-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Remove appmap configuration in test cases which now occurs automatically ([7391c4c](https://github.com/applandinc/appmap-ruby/commit/7391c4c36ed80f98a6b82ccd43f05de488e7cd2f))
7
+
8
+
9
+ ### Features
10
+
11
+ * Direct minitest and rspec startup messages to the Rails log, when available ([15f6444](https://github.com/applandinc/appmap-ruby/commit/15f6444b0fad3ce7d9e91273b6a1116e470c2a89))
12
+ * Enroll railtie, rspec, and minitest helpers automatically ([1709374](https://github.com/applandinc/appmap-ruby/commit/1709374ee7b5183482c55cf4c7386266fa517262))
13
+ * railtie enrolls the app in remote recording ([3a1f8aa](https://github.com/applandinc/appmap-ruby/commit/3a1f8aac1d83c4df04b5da55ed33d418235e348b))
14
+
1
15
  # [0.49.0](https://github.com/applandinc/appmap-ruby/compare/v0.48.2...v0.49.0) (2021-06-16)
2
16
 
3
17
 
data/lib/appmap.rb CHANGED
@@ -51,6 +51,14 @@ module AppMap
51
51
  end
52
52
  end
53
53
 
54
+ def info(msg)
55
+ if defined?(::Rails) && defined?(::Rails.logger)
56
+ ::Rails.logger.info msg
57
+ else
58
+ warn msg
59
+ end
60
+ end
61
+
54
62
  # Used to start tracing, stop tracing, and record events.
55
63
  def tracing
56
64
  @tracing ||= Trace::Tracing.new
@@ -97,5 +105,17 @@ module AppMap
97
105
  end
98
106
  end
99
107
 
100
- require 'appmap/railtie' if defined?(::Rails::Railtie)
108
+ if defined?(::Rails::Railtie)
109
+ require 'appmap/railtie'
110
+ end
111
+
112
+ if defined?(::RSpec)
113
+ require 'appmap/rspec'
114
+ end
115
+
116
+ # defined?(::Minitest) returns nil...
117
+ if Gem.loaded_specs['minitest']
118
+ require 'appmap/minitest'
119
+ end
120
+
101
121
  AppMap.initialize if ENV['APPMAP'] == 'true'
@@ -54,15 +54,21 @@ module AppMap
54
54
 
55
55
  @recordings_by_test = {}
56
56
  @event_methods = Set.new
57
+ @recording_count = 0
57
58
 
58
59
  class << self
59
60
  def init
60
- warn 'Configuring AppMap recorder for Minitest'
61
-
62
61
  FileUtils.mkdir_p APPMAP_OUTPUT_DIR
63
62
  end
64
63
 
64
+ def first_recording?
65
+ @recording_count == 0
66
+ end
67
+
65
68
  def begin_test(test, name)
69
+ AppMap.info 'Configuring AppMap recorder for Minitest' if first_recording?
70
+ @recording_count += 1
71
+
66
72
  @recordings_by_test[test.object_id] = Recording.new(test, name)
67
73
  end
68
74
 
@@ -3,6 +3,13 @@
3
3
  module AppMap
4
4
  # Railtie connects the AppMap recorder to Rails-specific features.
5
5
  class Railtie < ::Rails::Railtie
6
+ initializer 'appmap.remote_recording' do
7
+ require 'appmap/middleware/remote_recording'
8
+ Rails.application.config.middleware.insert_after \
9
+ Rails::Rack::Logger,
10
+ AppMap::Middleware::RemoteRecording
11
+ end
12
+
6
13
  # appmap.subscribe subscribes to ActiveSupport Notifications so that they can be recorded as
7
14
  # AppMap events.
8
15
  initializer 'appmap.subscribe' do |_| # params: app
data/lib/appmap/rspec.rb CHANGED
@@ -139,15 +139,21 @@ module AppMap
139
139
 
140
140
  @recordings_by_example = {}
141
141
  @event_methods = Set.new
142
+ @recording_count = 0
142
143
 
143
144
  class << self
144
145
  def init
145
- warn 'Configuring AppMap recorder for RSpec'
146
-
147
146
  FileUtils.mkdir_p APPMAP_OUTPUT_DIR
148
147
  end
149
148
 
149
+ def first_recording?
150
+ @recording_count == 0
151
+ end
152
+
150
153
  def begin_spec(example)
154
+ AppMap.info 'Configuring AppMap recorder for RSpec' if first_recording?
155
+ @recording_count += 1
156
+
151
157
  @recordings_by_example[example.object_id] = Recording.new(example)
152
158
  end
153
159
 
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.49.0'
6
+ VERSION = '0.50.0'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.5.1'
9
9
  end
@@ -21,14 +21,6 @@ when 'activerecord'
21
21
  require 'database_cleaner-active_record' if Rails.env.test?
22
22
  end
23
23
 
24
- require 'appmap/railtie' if defined?(AppMap)
25
-
26
- # require "active_storage/engine"
27
- # require "action_mailer/railtie"
28
- # require "action_cable/engine"
29
- # require "sprockets/railtie"
30
- # require "rails/test_unit/railtie"
31
-
32
24
  # Require the gems listed in Gemfile, including any gems
33
25
  # you've limited to :test, :development, or :production.
34
26
  Bundler.require(*Rails.groups)
@@ -7,8 +7,6 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
7
7
  require 'rspec/rails'
8
8
  # Add additional requires below this line. Rails is not loaded until this point!
9
9
 
10
- require 'appmap/rspec'
11
-
12
10
  # Requires supporting ruby files with custom matchers and macros, etc, in
13
11
  # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
14
12
  # run as spec files by default. This means that files in spec/support that end
@@ -21,14 +21,6 @@ when 'activerecord'
21
21
  require 'database_cleaner-active_record' if Rails.env.test?
22
22
  end
23
23
 
24
- require 'appmap/railtie' if defined?(AppMap)
25
-
26
- # require "active_storage/engine"
27
- # require "action_mailer/railtie"
28
- # require "action_cable/engine"
29
- # require "sprockets/railtie"
30
- # require "rails/test_unit/railtie"
31
-
32
24
  # Require the gems listed in Gemfile, including any gems
33
25
  # you've limited to :test, :development, or :production.
34
26
  Bundler.require(*Rails.groups)
@@ -7,8 +7,6 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
7
7
  require 'rspec/rails'
8
8
  # Add additional requires below this line. Rails is not loaded until this point!
9
9
 
10
- require 'appmap/rspec'
11
-
12
10
  # Requires supporting ruby files with custom matchers and macros, etc, in
13
11
  # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
14
12
  # run as spec files by default. This means that files in spec/support that end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-16 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -455,7 +455,6 @@ files:
455
455
  - spec/fixtures/rails5_users_app/config/initializers/filter_parameter_logging.rb
456
456
  - spec/fixtures/rails5_users_app/config/initializers/inflections.rb
457
457
  - spec/fixtures/rails5_users_app/config/initializers/mime_types.rb
458
- - spec/fixtures/rails5_users_app/config/initializers/record_button.rb
459
458
  - spec/fixtures/rails5_users_app/config/initializers/wrap_parameters.rb
460
459
  - spec/fixtures/rails5_users_app/config/locales/en.yml
461
460
  - spec/fixtures/rails5_users_app/config/routes.rb
@@ -527,7 +526,6 @@ files:
527
526
  - spec/fixtures/rails6_users_app/config/initializers/filter_parameter_logging.rb
528
527
  - spec/fixtures/rails6_users_app/config/initializers/inflections.rb
529
528
  - spec/fixtures/rails6_users_app/config/initializers/mime_types.rb
530
- - spec/fixtures/rails6_users_app/config/initializers/record_button.rb
531
529
  - spec/fixtures/rails6_users_app/config/initializers/wrap_parameters.rb
532
530
  - spec/fixtures/rails6_users_app/config/locales/en.yml
533
531
  - spec/fixtures/rails6_users_app/config/routes.rb
@@ -1,3 +0,0 @@
1
- require 'appmap/middleware/remote_recording'
2
- Rails.application.config.middleware.insert_after Rails::Rack::Logger, AppMap::Middleware::RemoteRecording \
3
- unless Rails.env.test?
@@ -1,3 +0,0 @@
1
- require 'appmap/middleware/remote_recording'
2
- Rails.application.config.middleware.insert_after Rails::Rack::Logger, AppMap::Middleware::RemoteRecording \
3
- unless Rails.env.test?