appmap 0.37.0 → 0.40.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 +4 -4
- data/.dockerignore +1 -1
- data/.rubocop.yml +12 -1
- data/.travis.yml +2 -23
- data/CHANGELOG.md +24 -0
- data/CONTRIBUTING.md +22 -0
- data/README.md +79 -50
- data/Rakefile +3 -3
- data/lib/appmap/class_map.rb +25 -8
- data/lib/appmap/config.rb +22 -10
- data/lib/appmap/event.rb +16 -1
- data/lib/appmap/hook.rb +11 -3
- data/lib/appmap/hook/method.rb +18 -12
- data/lib/appmap/rails/request_handler.rb +25 -4
- data/lib/appmap/railtie.rb +1 -5
- data/lib/appmap/trace.rb +18 -7
- data/lib/appmap/version.rb +2 -2
- data/spec/abstract_controller_base_spec.rb +132 -67
- data/spec/fixtures/hook/instance_method.rb +4 -0
- data/spec/fixtures/hook/labels.rb +6 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/.dockerignore +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/.gitignore +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/.rspec +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/.ruby-version +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/Dockerfile +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/Dockerfile.pg +0 -0
- data/spec/fixtures/rails5_users_app/Gemfile +50 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/Rakefile +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/api/users_controller.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/application_controller.rb +0 -0
- data/spec/fixtures/{rails4_users_app/app/assets/images → rails5_users_app/app/controllers/concerns}/.keep +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/health_controller.rb +0 -0
- data/spec/fixtures/rails5_users_app/app/controllers/users_controller.rb +13 -0
- data/spec/fixtures/{rails4_users_app/app/models → rails5_users_app/app/models/activerecord}/user.rb +0 -0
- data/spec/fixtures/{rails4_users_app/app/controllers → rails5_users_app/app/models}/concerns/.keep +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/app/models/sequel/user.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/app/views/layouts/application.html.haml +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/app/views/users/index.html.haml +0 -0
- data/spec/fixtures/rails5_users_app/appmap.yml +4 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/appmap +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/byebug +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/gli +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/htmldiff +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ldiff +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/nokogiri +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rackup +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rails +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rake +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rspec +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ruby-parse +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ruby-rewrite +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/sequel +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/setup +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/sprockets +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/thor +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/update +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config.ru +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/application.rb +2 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/boot.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/credentials.yml.enc +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/database.yml +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environment.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/development.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/production.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/test.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/application_controller_renderer.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/cors.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/config/initializers/filter_parameter_logging.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/config/initializers/inflections.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/config/initializers/mime_types.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/record_button.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/wrap_parameters.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/config/locales/en.yml +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/config/routes.rb +1 -2
- data/spec/fixtures/{rails_users_app → rails5_users_app}/create_app +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/db/migrate/20190728211408_create_users.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/db/schema.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/docker-compose.yml +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/features/api_users.feature +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/env.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/hooks.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/steps.rb +0 -0
- data/spec/fixtures/{rails4_users_app/app/mailers → rails5_users_app/lib/tasks}/.keep +0 -0
- data/spec/fixtures/{rails4_users_app/app/models → rails5_users_app/log}/.keep +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/public/robots.txt +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/controllers/users_controller_api_spec.rb +1 -1
- data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_spec.rb +27 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/models/user_spec.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/rails_helper.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails5_users_app}/spec/spec_helper.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails5_users_app}/users_app/.gitignore +0 -0
- data/spec/fixtures/rails6_users_app/.dockerignore +1 -0
- data/spec/fixtures/rails6_users_app/.gitignore +39 -0
- data/spec/fixtures/rails6_users_app/.rspec +1 -0
- data/spec/fixtures/rails6_users_app/.ruby-version +1 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/Dockerfile +3 -4
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/Dockerfile.pg +1 -1
- data/spec/fixtures/{rails_users_app → rails6_users_app}/Gemfile +3 -4
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/Rakefile +1 -1
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/app/controllers/api/users_controller.rb +1 -1
- data/spec/fixtures/rails6_users_app/app/controllers/application_controller.rb +2 -0
- data/spec/fixtures/{rails4_users_app/app/models → rails6_users_app/app/controllers}/concerns/.keep +0 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/app/controllers/health_controller.rb +1 -1
- data/spec/fixtures/rails6_users_app/app/controllers/users_controller.rb +13 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/app/models/activerecord/user.rb +0 -0
- data/spec/fixtures/{rails4_users_app/lib/assets → rails6_users_app/app/models/concerns}/.keep +0 -0
- data/spec/fixtures/rails6_users_app/app/models/sequel/user.rb +25 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/app/views/layouts/application.html.haml +0 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/app/views/users/index.html.haml +0 -0
- data/spec/fixtures/rails6_users_app/appmap.yml +5 -0
- data/spec/fixtures/rails6_users_app/bin/appmap +29 -0
- data/spec/fixtures/rails6_users_app/bin/byebug +29 -0
- data/spec/fixtures/rails6_users_app/bin/gli +29 -0
- data/spec/fixtures/rails6_users_app/bin/htmldiff +29 -0
- data/spec/fixtures/rails6_users_app/bin/ldiff +29 -0
- data/spec/fixtures/rails6_users_app/bin/nokogiri +29 -0
- data/spec/fixtures/rails6_users_app/bin/rackup +29 -0
- data/spec/fixtures/rails6_users_app/bin/rails +4 -0
- data/spec/fixtures/rails6_users_app/bin/rake +29 -0
- data/spec/fixtures/rails6_users_app/bin/rspec +29 -0
- data/spec/fixtures/rails6_users_app/bin/ruby-parse +29 -0
- data/spec/fixtures/rails6_users_app/bin/ruby-rewrite +29 -0
- data/spec/fixtures/rails6_users_app/bin/sequel +29 -0
- data/spec/fixtures/rails6_users_app/bin/setup +25 -0
- data/spec/fixtures/rails6_users_app/bin/sprockets +29 -0
- data/spec/fixtures/rails6_users_app/bin/thor +29 -0
- data/spec/fixtures/rails6_users_app/bin/update +25 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config.ru +2 -1
- data/spec/fixtures/rails6_users_app/config/application.rb +53 -0
- data/spec/fixtures/rails6_users_app/config/boot.rb +3 -0
- data/spec/fixtures/rails6_users_app/config/credentials.yml.enc +1 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/database.yml +2 -2
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/environment.rb +1 -1
- data/spec/fixtures/rails6_users_app/config/environments/development.rb +40 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/environments/production.rb +19 -30
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/environments/test.rb +5 -11
- data/spec/fixtures/rails6_users_app/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/fixtures/rails6_users_app/config/initializers/cors.rb +16 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/config/initializers/filter_parameter_logging.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/config/initializers/inflections.rb +0 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/config/initializers/mime_types.rb +0 -0
- data/spec/fixtures/rails6_users_app/config/initializers/record_button.rb +3 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/initializers/wrap_parameters.rb +1 -6
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/locales/en.yml +10 -0
- data/spec/fixtures/{rails_users_app → rails6_users_app}/config/routes.rb +1 -1
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/create_app +7 -3
- data/spec/fixtures/rails6_users_app/db/migrate/20190728211408_create_users.rb +9 -0
- data/spec/fixtures/rails6_users_app/db/schema.rb +23 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/docker-compose.yml +3 -1
- data/spec/fixtures/rails6_users_app/features/api_users.feature +13 -0
- data/spec/fixtures/rails6_users_app/features/support/env.rb +4 -0
- data/spec/fixtures/rails6_users_app/features/support/hooks.rb +11 -0
- data/spec/fixtures/rails6_users_app/features/support/steps.rb +18 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/lib/tasks/.keep +0 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/log/.keep +0 -0
- data/spec/fixtures/rails6_users_app/public/robots.txt +1 -0
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_api_spec.rb +29 -0
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_spec.rb +27 -0
- data/spec/fixtures/rails6_users_app/spec/models/user_spec.rb +39 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app}/spec/rails_helper.rb +3 -32
- data/spec/fixtures/{rails_users_app → rails6_users_app}/spec/spec_helper.rb +0 -0
- data/spec/fixtures/{rails4_users_app → rails6_users_app/users_app}/.gitignore +8 -1
- data/spec/hook_spec.rb +111 -57
- data/spec/rails_spec_helper.rb +5 -5
- data/spec/railtie_spec.rb +31 -32
- data/spec/record_sql_rails_pg_spec.rb +62 -63
- data/spec/remote_recording_spec.rb +90 -89
- data/spec/rspec_feature_metadata_spec.rb +17 -18
- data/spec/spec_helper.rb +1 -0
- metadata +148 -139
- data/spec/abstract_controller4_base_spec.rb +0 -67
- data/spec/fixtures/rails4_users_app/.rbenv-gemsets +0 -2
- data/spec/fixtures/rails4_users_app/.ruby-version +0 -1
- data/spec/fixtures/rails4_users_app/Gemfile +0 -77
- data/spec/fixtures/rails4_users_app/README.rdoc +0 -28
- data/spec/fixtures/rails4_users_app/app/assets/javascripts/application.js +0 -16
- data/spec/fixtures/rails4_users_app/app/assets/stylesheets/application.css +0 -15
- data/spec/fixtures/rails4_users_app/app/controllers/application_controller.rb +0 -5
- data/spec/fixtures/rails4_users_app/app/controllers/users_controller.rb +0 -5
- data/spec/fixtures/rails4_users_app/app/helpers/application_helper.rb +0 -2
- data/spec/fixtures/rails4_users_app/appmap.yml +0 -3
- data/spec/fixtures/rails4_users_app/bin/rails +0 -9
- data/spec/fixtures/rails4_users_app/bin/setup +0 -29
- data/spec/fixtures/rails4_users_app/bin/spring +0 -17
- data/spec/fixtures/rails4_users_app/config/application.rb +0 -26
- data/spec/fixtures/rails4_users_app/config/boot.rb +0 -3
- data/spec/fixtures/rails4_users_app/config/environments/development.rb +0 -41
- data/spec/fixtures/rails4_users_app/config/initializers/assets.rb +0 -11
- data/spec/fixtures/rails4_users_app/config/initializers/cookies_serializer.rb +0 -3
- data/spec/fixtures/rails4_users_app/config/initializers/session_store.rb +0 -3
- data/spec/fixtures/rails4_users_app/config/initializers/to_time_preserves_timezone.rb +0 -10
- data/spec/fixtures/rails4_users_app/config/secrets.yml +0 -22
- data/spec/fixtures/rails4_users_app/db/migrate/20191127112304_create_users.rb +0 -10
- data/spec/fixtures/rails4_users_app/db/schema.rb +0 -26
- data/spec/fixtures/rails4_users_app/db/seeds.rb +0 -7
- data/spec/fixtures/rails4_users_app/public/404.html +0 -67
- data/spec/fixtures/rails4_users_app/public/422.html +0 -67
- data/spec/fixtures/rails4_users_app/public/500.html +0 -66
- data/spec/fixtures/rails4_users_app/public/favicon.ico +0 -0
- data/spec/fixtures/rails4_users_app/public/robots.txt +0 -5
- data/spec/fixtures/rails4_users_app/spec/controllers/users_controller_api_spec.rb +0 -49
- data/spec/fixtures/rails4_users_app/test/fixtures/users.yml +0 -9
- data/spec/fixtures/rails_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails_users_app/app/controllers/users_controller.rb +0 -5
- data/spec/fixtures/rails_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails_users_app/appmap.yml +0 -3
- data/spec/fixtures/rails_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails_users_app/log/.keep +0 -0
- data/spec/record_sql_rails4_pg_spec.rb +0 -76
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
include FileUtils
|
|
4
|
+
|
|
5
|
+
# path to your application root.
|
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
|
7
|
+
|
|
8
|
+
def system!(*args)
|
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
chdir APP_ROOT do
|
|
13
|
+
# This script is a way to update your development environment automatically.
|
|
14
|
+
# Add necessary update steps to this file.
|
|
15
|
+
|
|
16
|
+
puts '== Installing dependencies =='
|
|
17
|
+
system! 'gem install bundler --conservative'
|
|
18
|
+
system('bundle check') || system!('bundle install')
|
|
19
|
+
|
|
20
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
21
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
22
|
+
|
|
23
|
+
puts "\n== Restarting application server =="
|
|
24
|
+
system! 'bin/rails restart'
|
|
25
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require_relative 'boot'
|
|
2
|
+
|
|
3
|
+
def orm_module
|
|
4
|
+
ENV['ORM_MODULE'] || 'sequel'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require "rails"
|
|
8
|
+
# Pick the frameworks you want:
|
|
9
|
+
require "active_model/railtie"
|
|
10
|
+
require "active_job/railtie"
|
|
11
|
+
require "action_controller/railtie"
|
|
12
|
+
require "action_view/railtie"
|
|
13
|
+
|
|
14
|
+
case orm_module
|
|
15
|
+
when 'sequel'
|
|
16
|
+
require 'sequel-rails'
|
|
17
|
+
require 'sequel_secure_password'
|
|
18
|
+
when 'activerecord'
|
|
19
|
+
require 'active_record/railtie'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
require 'appmap/railtie' if defined?(AppMap)
|
|
23
|
+
|
|
24
|
+
# require "active_storage/engine"
|
|
25
|
+
# require "action_mailer/railtie"
|
|
26
|
+
# require "action_cable/engine"
|
|
27
|
+
# require "sprockets/railtie"
|
|
28
|
+
# require "rails/test_unit/railtie"
|
|
29
|
+
|
|
30
|
+
# Require the gems listed in Gemfile, including any gems
|
|
31
|
+
# you've limited to :test, :development, or :production.
|
|
32
|
+
Bundler.require(*Rails.groups)
|
|
33
|
+
|
|
34
|
+
module UsersApp
|
|
35
|
+
class Application < Rails::Application
|
|
36
|
+
# Initialize configuration defaults for originally generated Rails version.
|
|
37
|
+
config.load_defaults 5.2
|
|
38
|
+
|
|
39
|
+
config.appmap.enabled = true if ENV['APPMAP'] == 'true' && !Rails.env.test?
|
|
40
|
+
|
|
41
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
42
|
+
# Application configuration can go into files in config/initializers
|
|
43
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
|
44
|
+
# the framework and any gems in your application.
|
|
45
|
+
|
|
46
|
+
# Only loads a smaller set of middleware suitable for API only apps.
|
|
47
|
+
# Middleware like session, flash, cookies can be added back manually.
|
|
48
|
+
# Skip views, helpers and assets when generating a new resource.
|
|
49
|
+
config.api_only = true
|
|
50
|
+
|
|
51
|
+
config.autoload_paths << File.join(Rails.root, "app/models/#{orm_module}")
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fvHJWgAisxKdEtPejF1DMotrGxwK5QwUVQRqOvkI7+olbFTlcZMah2cfLAupIMKEZKXwx3ui+kNWDbMv1/JYxiMQfsvDZPx/yXD4k0IENYMILaMApFfxco5cjerEHCOZb+TJxOCTKGHD1ckt8zwNbBOA6mN1P8sbs3IXRc8bz/2FG/ILQvNIsvMO2ODb8WEeIp5N3dWkkk2pPJqwodBpoHHqcycTMru/pNl+V8BHEgfjMOIzdHpz2M1A2F4vOOCWx4vL2onZJXMDta3p9FZoypGZLr5X37+/B9fM+dJhWNz2Bvrlq8amdbKmOfSjehUAsSePj+nBY8zu0ZeNx4t7/3JBOKQ8PTSvovTgw71IeZckavz1dyyPatJ3d7ngrC7x2/VKt/JP1nAaf+5kBEjaARuM0+VewXZiO7Y5--ze5FclBM0tyGg/Ql--+S/6aIP52fpUTSoTQlw5nA==
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Rails.application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
|
+
|
|
4
|
+
# In the development environment your application's code is reloaded on
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
|
7
|
+
config.cache_classes = false
|
|
8
|
+
|
|
9
|
+
# Do not eager load code on boot.
|
|
10
|
+
config.eager_load = false
|
|
11
|
+
|
|
12
|
+
# Show full error reports.
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
|
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
|
16
|
+
# Run rails dev:cache to toggle caching.
|
|
17
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
|
18
|
+
config.action_controller.perform_caching = true
|
|
19
|
+
|
|
20
|
+
config.cache_store = :memory_store
|
|
21
|
+
config.public_file_server.headers = {
|
|
22
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
|
23
|
+
}
|
|
24
|
+
else
|
|
25
|
+
config.action_controller.perform_caching = false
|
|
26
|
+
|
|
27
|
+
config.cache_store = :null_store
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Print deprecation notices to the Rails logger.
|
|
31
|
+
config.active_support.deprecation = :log
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Raises error for missing translations
|
|
35
|
+
# config.action_view.raise_on_missing_translations = true
|
|
36
|
+
|
|
37
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
38
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
39
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
40
|
+
end
|
|
@@ -14,28 +14,16 @@ Rails.application.configure do
|
|
|
14
14
|
config.consider_all_requests_local = false
|
|
15
15
|
config.action_controller.perform_caching = true
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
# NGINX, varnish or squid.
|
|
21
|
-
# config.action_dispatch.rack_cache = true
|
|
17
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
|
18
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
|
19
|
+
# config.require_master_key = true
|
|
22
20
|
|
|
23
21
|
# Disable serving static files from the `/public` folder by default since
|
|
24
22
|
# Apache or NGINX already handles this.
|
|
25
|
-
config.
|
|
23
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
|
26
24
|
|
|
27
|
-
#
|
|
28
|
-
config.
|
|
29
|
-
# config.assets.css_compressor = :sass
|
|
30
|
-
|
|
31
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
32
|
-
config.assets.compile = false
|
|
33
|
-
|
|
34
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
|
35
|
-
# yet still be able to expire them through the digest params.
|
|
36
|
-
config.assets.digest = true
|
|
37
|
-
|
|
38
|
-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
25
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
26
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
|
39
27
|
|
|
40
28
|
# Specifies the header that your server uses for sending files.
|
|
41
29
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
|
@@ -49,20 +37,14 @@ Rails.application.configure do
|
|
|
49
37
|
config.log_level = :debug
|
|
50
38
|
|
|
51
39
|
# Prepend all log lines with the following tags.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# Use a different logger for distributed setups.
|
|
55
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
40
|
+
config.log_tags = [ :request_id ]
|
|
56
41
|
|
|
57
42
|
# Use a different cache store in production.
|
|
58
43
|
# config.cache_store = :mem_cache_store
|
|
59
44
|
|
|
60
|
-
#
|
|
61
|
-
# config.
|
|
62
|
-
|
|
63
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
|
64
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
65
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
45
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
|
46
|
+
# config.active_job.queue_adapter = :resque
|
|
47
|
+
# config.active_job.queue_name_prefix = "users_app_#{Rails.env}"
|
|
66
48
|
|
|
67
49
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
68
50
|
# the I18n.default_locale when a translation cannot be found).
|
|
@@ -74,6 +56,13 @@ Rails.application.configure do
|
|
|
74
56
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
75
57
|
config.log_formatter = ::Logger::Formatter.new
|
|
76
58
|
|
|
77
|
-
#
|
|
78
|
-
|
|
59
|
+
# Use a different logger for distributed setups.
|
|
60
|
+
# require 'syslog/logger'
|
|
61
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
|
62
|
+
|
|
63
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
64
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
|
65
|
+
logger.formatter = config.log_formatter
|
|
66
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
|
67
|
+
end
|
|
79
68
|
end
|
|
@@ -12,9 +12,11 @@ Rails.application.configure do
|
|
|
12
12
|
# preloads Rails for running tests, you may have to set it to true.
|
|
13
13
|
config.eager_load = false
|
|
14
14
|
|
|
15
|
-
# Configure
|
|
16
|
-
config.
|
|
17
|
-
config.
|
|
15
|
+
# Configure public file server for tests with Cache-Control for performance.
|
|
16
|
+
config.public_file_server.enabled = true
|
|
17
|
+
config.public_file_server.headers = {
|
|
18
|
+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
# Show full error reports and disable caching.
|
|
20
22
|
config.consider_all_requests_local = true
|
|
@@ -26,14 +28,6 @@ Rails.application.configure do
|
|
|
26
28
|
# Disable request forgery protection in test environment.
|
|
27
29
|
config.action_controller.allow_forgery_protection = false
|
|
28
30
|
|
|
29
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
30
|
-
# The :test delivery method accumulates sent emails in the
|
|
31
|
-
# ActionMailer::Base.deliveries array.
|
|
32
|
-
config.action_mailer.delivery_method = :test
|
|
33
|
-
|
|
34
|
-
# Randomize the order test cases are executed.
|
|
35
|
-
config.active_support.test_order = :random
|
|
36
|
-
|
|
37
31
|
# Print deprecation notices to the stderr.
|
|
38
32
|
config.active_support.deprecation = :stderr
|
|
39
33
|
|
data/spec/fixtures/{rails_users_app → rails6_users_app}/config/initializers/backtrace_silencers.rb
RENAMED
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Avoid CORS issues when API is called from the frontend app.
|
|
4
|
+
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
|
|
5
|
+
|
|
6
|
+
# Read more: https://github.com/cyu/rack-cors
|
|
7
|
+
|
|
8
|
+
# Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
|
9
|
+
# allow do
|
|
10
|
+
# origins 'example.com'
|
|
11
|
+
#
|
|
12
|
+
# resource '*',
|
|
13
|
+
# headers: :any,
|
|
14
|
+
# methods: [:get, :post, :put, :patch, :delete, :options, :head]
|
|
15
|
+
# end
|
|
16
|
+
# end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/fixtures/{rails4_users_app → rails6_users_app}/config/initializers/wrap_parameters.rb
RENAMED
|
@@ -5,10 +5,5 @@
|
|
|
5
5
|
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
|
8
|
-
wrap_parameters format: [:json]
|
|
8
|
+
wrap_parameters format: [:json]
|
|
9
9
|
end
|
|
10
|
-
|
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
|
13
|
-
# self.include_root_in_json = true
|
|
14
|
-
# end
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
#
|
|
17
17
|
# This would use the information in config/locales/es.yml.
|
|
18
18
|
#
|
|
19
|
+
# The following keys must be escaped otherwise they will not be retrieved by
|
|
20
|
+
# the default I18n backend:
|
|
21
|
+
#
|
|
22
|
+
# true, false, on, off, yes, no
|
|
23
|
+
#
|
|
24
|
+
# Instead, surround them with single quotes.
|
|
25
|
+
#
|
|
26
|
+
# en:
|
|
27
|
+
# 'true': 'foo'
|
|
28
|
+
#
|
|
19
29
|
# To learn more, please read the Rails Internationalization guide
|
|
20
30
|
# available at http://guides.rubyonrails.org/i18n.html.
|
|
21
31
|
|
|
@@ -16,8 +16,12 @@ if [[ $? != 0 ]]; then
|
|
|
16
16
|
exit 1
|
|
17
17
|
fi
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
psql -h pg -U postgres -c "create database app_development"
|
|
20
|
+
psql -h pg -U postgres -c "create database app_test"
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
set -e
|
|
23
|
+
|
|
24
|
+
RAILS_ENV=development ./bin/rake db:migrate
|
|
25
|
+
RAILS_ENV=test ./bin/rake db:migrate
|
|
23
26
|
|
|
27
|
+
echo "INSERT INTO users ( login ) VALUES ( 'admin' ) " | psql -h pg -U postgres app_development
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Sequel.migration do
|
|
2
|
+
change do
|
|
3
|
+
create_table(:schema_migrations) do
|
|
4
|
+
column :filename, "text", :null=>false
|
|
5
|
+
|
|
6
|
+
primary_key [:filename]
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
create_table(:users) do
|
|
10
|
+
primary_key :id
|
|
11
|
+
column :login, "text", :null=>false
|
|
12
|
+
column :password_digest, "bytea"
|
|
13
|
+
|
|
14
|
+
index [:login], :name=>:users_login_key, :unique=>true
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
Sequel.migration do
|
|
19
|
+
change do
|
|
20
|
+
self << "SET search_path TO \"$user\", public"
|
|
21
|
+
self << "INSERT INTO \"schema_migrations\" (\"filename\") VALUES ('20190728211408_create_users.rb')"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -13,11 +13,13 @@ services:
|
|
|
13
13
|
build:
|
|
14
14
|
context: .
|
|
15
15
|
dockerfile: Dockerfile
|
|
16
|
-
image:
|
|
16
|
+
image: rails-app:${RUBY_VERSION}
|
|
17
17
|
command:
|
|
18
18
|
[ "./bin/rails", "server", "-b", "0.0.0.0", "webrick" ]
|
|
19
19
|
environment:
|
|
20
20
|
RAILS_ENV:
|
|
21
|
+
ORM_MODULE:
|
|
22
|
+
APPMAP:
|
|
21
23
|
volumes:
|
|
22
24
|
- .:/src/app
|
|
23
25
|
ports:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Feature: /api/users
|
|
2
|
+
|
|
3
|
+
@appmap-disable
|
|
4
|
+
Scenario: A user can be created
|
|
5
|
+
When I create a user
|
|
6
|
+
Then the response status should be 201
|
|
7
|
+
|
|
8
|
+
Scenario: When a user is created, it should be in the user list
|
|
9
|
+
Given I create a user
|
|
10
|
+
And the response status should be 201
|
|
11
|
+
When I list the users
|
|
12
|
+
Then the response status should be 200
|
|
13
|
+
And the response should include the user
|