Skip to content

Commit 383ba0a

Browse files
committed
feat: Remove server process recording from doc and tests
1 parent dd9e383 commit 383ba0a

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,6 @@ If you are using Ruby on Rails, require the railtie after Rails is loaded.
8383
require 'appmap/railtie' if defined?(AppMap).
8484
```
8585

86-
**application.rb**
87-
88-
Add this line to *application.rb*, to enable server recording with `APPMAP_RECORD=true`:
89-
90-
```ruby
91-
module MyApp
92-
class Application < Rails::Application
93-
...
94-
95-
config.appmap.enabled = true if ENV['APPMAP_RECORD']
96-
97-
...
98-
end
99-
end
100-
```
101-
10286
# Configuration
10387

10488
When you run your program, the `appmap` gem reads configuration settings from `appmap.yml`. Here's a sample configuration

spec/fixtures/rails5_users_app/config/application.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class Application < Rails::Application
3838
# Initialize configuration defaults for originally generated Rails version.
3939
config.load_defaults 5.2
4040

41-
config.appmap.enabled = true if ENV['APPMAP'] == 'true' && !Rails.env.test?
42-
4341
# Settings in config/environments/* take precedence over those specified here.
4442
# Application configuration can go into files in config/initializers
4543
# -- all .rb files in that directory are automatically loaded after loading

spec/fixtures/rails6_users_app/config/application.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class Application < Rails::Application
3838
# Initialize configuration defaults for originally generated Rails version.
3939
config.load_defaults 5.2
4040

41-
config.appmap.enabled = true if ENV['APPMAP'] == 'true' && !Rails.env.test?
42-
4341
# Settings in config/environments/* take precedence over those specified here.
4442
# Application configuration can go into files in config/initializers
4543
# -- all .rb files in that directory are automatically loaded after loading

spec/railtie_spec.rb

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
include_context 'Rails app pg database', 'spec/fixtures/rails5_users_app' do
55
let(:env) { {} }
66

7-
let(:cmd) { %(docker-compose run --rm -e RAILS_ENV -e APPMAP app ./bin/rails r "puts Rails.configuration.appmap.enabled.inspect") }
7+
let(:cmd) { %(docker-compose run --rm -e RAILS_ENV=development -e APPMAP app ./bin/rails r "puts AppMap.instance_variable_get('@configuration').nil?") }
88
let(:command_capture2) do
99
require 'open3'
1010
Open3.capture3(env, cmd, chdir: fixture_dir).tap do |result|
@@ -23,20 +23,16 @@
2323
let(:command_output) { command_capture2[0].strip }
2424
let(:command_result) { command_capture2[2] }
2525

26-
it 'is disabled by default' do
27-
expect(command_output).to eq('nil')
26+
describe 'with APPMAP=false' do
27+
let(:env) { { 'APPMAP' => 'false' } }
28+
it 'is disabled' do
29+
expect(command_output).to eq('true')
30+
end
2831
end
29-
3032
describe 'with APPMAP=true' do
3133
let(:env) { { 'APPMAP' => 'true' } }
3234
it 'is enabled' do
33-
expect(command_output.split("\n")).to include('true')
34-
end
35-
context 'and RAILS_ENV=test' do
36-
let(:env) { { 'APPMAP' => 'true', 'RAILS_ENV' => 'test' } }
37-
it 'is disabled' do
38-
expect(command_output).to eq('nil')
39-
end
35+
expect(command_output).to eq('false')
4036
end
4137
end
4238
end

0 commit comments

Comments
 (0)