appmap 0.77.0 → 0.77.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/CHANGELOG.md +21 -0
  4. data/Rakefile +30 -4
  5. data/appmap.gemspec +1 -1
  6. data/lib/appmap/config.rb +9 -1
  7. data/lib/appmap/swagger/rake_tasks.rb +6 -1
  8. data/lib/appmap/version.rb +2 -2
  9. data/spec/fixtures/rails7_users_app/.dockerignore +1 -0
  10. data/spec/fixtures/rails7_users_app/.gitattributes +7 -0
  11. data/spec/fixtures/rails7_users_app/.gitignore +31 -0
  12. data/spec/fixtures/rails7_users_app/.rspec +1 -0
  13. data/spec/fixtures/rails7_users_app/.ruby-version +1 -0
  14. data/spec/fixtures/rails7_users_app/Dockerfile +30 -0
  15. data/spec/fixtures/rails7_users_app/Dockerfile.pg +3 -0
  16. data/spec/fixtures/rails7_users_app/Gemfile +99 -0
  17. data/spec/fixtures/rails7_users_app/README.md +24 -0
  18. data/spec/fixtures/rails7_users_app/Rakefile +6 -0
  19. data/spec/fixtures/rails7_users_app/app/assets/config/manifest.js +4 -0
  20. data/spec/fixtures/rails7_users_app/app/assets/images/.keep +0 -0
  21. data/spec/fixtures/rails7_users_app/app/assets/stylesheets/application.css +15 -0
  22. data/spec/fixtures/rails7_users_app/app/channels/application_cable/channel.rb +4 -0
  23. data/spec/fixtures/rails7_users_app/app/channels/application_cable/connection.rb +4 -0
  24. data/spec/fixtures/rails7_users_app/app/controllers/application_controller.rb +2 -0
  25. data/spec/fixtures/rails7_users_app/app/controllers/concerns/.keep +0 -0
  26. data/spec/fixtures/rails7_users_app/app/helpers/application_helper.rb +2 -0
  27. data/spec/fixtures/rails7_users_app/app/javascript/application.js +3 -0
  28. data/spec/fixtures/rails7_users_app/app/javascript/controllers/application.js +9 -0
  29. data/spec/fixtures/rails7_users_app/app/javascript/controllers/hello_controller.js +7 -0
  30. data/spec/fixtures/rails7_users_app/app/javascript/controllers/index.js +11 -0
  31. data/spec/fixtures/rails7_users_app/app/jobs/application_job.rb +7 -0
  32. data/spec/fixtures/rails7_users_app/app/mailers/application_mailer.rb +4 -0
  33. data/spec/fixtures/rails7_users_app/app/models/application_record.rb +3 -0
  34. data/spec/fixtures/rails7_users_app/app/models/concerns/.keep +0 -0
  35. data/spec/fixtures/rails7_users_app/app/models/instance.rb +7 -0
  36. data/spec/fixtures/rails7_users_app/app/models/instructor.rb +7 -0
  37. data/spec/fixtures/rails7_users_app/app/views/layouts/application.html.erb +16 -0
  38. data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.html.erb +13 -0
  39. data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.text.erb +1 -0
  40. data/spec/fixtures/rails7_users_app/appmap.yml +3 -0
  41. data/spec/fixtures/rails7_users_app/bin/bundle +114 -0
  42. data/spec/fixtures/rails7_users_app/bin/importmap +4 -0
  43. data/spec/fixtures/rails7_users_app/bin/rails +4 -0
  44. data/spec/fixtures/rails7_users_app/bin/rake +4 -0
  45. data/spec/fixtures/rails7_users_app/bin/setup +33 -0
  46. data/spec/fixtures/rails7_users_app/config/application.rb +22 -0
  47. data/spec/fixtures/rails7_users_app/config/boot.rb +4 -0
  48. data/spec/fixtures/rails7_users_app/config/cable.yml +10 -0
  49. data/spec/fixtures/rails7_users_app/config/credentials.yml.enc +1 -0
  50. data/spec/fixtures/rails7_users_app/config/database.yml +86 -0
  51. data/spec/fixtures/rails7_users_app/config/environment.rb +5 -0
  52. data/spec/fixtures/rails7_users_app/config/environments/development.rb +70 -0
  53. data/spec/fixtures/rails7_users_app/config/environments/production.rb +93 -0
  54. data/spec/fixtures/rails7_users_app/config/environments/test.rb +60 -0
  55. data/spec/fixtures/rails7_users_app/config/importmap.rb +7 -0
  56. data/spec/fixtures/rails7_users_app/config/initializers/assets.rb +12 -0
  57. data/spec/fixtures/rails7_users_app/config/initializers/content_security_policy.rb +26 -0
  58. data/spec/fixtures/rails7_users_app/config/initializers/filter_parameter_logging.rb +8 -0
  59. data/spec/fixtures/rails7_users_app/config/initializers/inflections.rb +16 -0
  60. data/spec/fixtures/rails7_users_app/config/initializers/permissions_policy.rb +11 -0
  61. data/spec/fixtures/rails7_users_app/config/locales/en.yml +33 -0
  62. data/spec/fixtures/rails7_users_app/config/puma.rb +43 -0
  63. data/spec/fixtures/rails7_users_app/config/routes.rb +6 -0
  64. data/spec/fixtures/rails7_users_app/config/storage.yml +34 -0
  65. data/spec/fixtures/rails7_users_app/config.ru +6 -0
  66. data/spec/fixtures/rails7_users_app/create_app +31 -0
  67. data/spec/fixtures/rails7_users_app/db/migrate/20220328093141_create_instances.rb +8 -0
  68. data/spec/fixtures/rails7_users_app/db/migrate/20220328093154_create_instructors.rb +8 -0
  69. data/spec/fixtures/rails7_users_app/db/schema.rb +27 -0
  70. data/spec/fixtures/rails7_users_app/db/seeds.rb +7 -0
  71. data/spec/fixtures/rails7_users_app/docker-compose.yml +31 -0
  72. data/spec/fixtures/rails7_users_app/lib/assets/.keep +0 -0
  73. data/spec/fixtures/rails7_users_app/lib/tasks/.keep +0 -0
  74. data/spec/fixtures/rails7_users_app/log/.keep +0 -0
  75. data/spec/fixtures/rails7_users_app/public/404.html +67 -0
  76. data/spec/fixtures/rails7_users_app/public/422.html +67 -0
  77. data/spec/fixtures/rails7_users_app/public/500.html +66 -0
  78. data/spec/fixtures/rails7_users_app/public/apple-touch-icon-precomposed.png +0 -0
  79. data/spec/fixtures/rails7_users_app/public/apple-touch-icon.png +0 -0
  80. data/spec/fixtures/rails7_users_app/public/favicon.ico +0 -0
  81. data/spec/fixtures/rails7_users_app/public/robots.txt +1 -0
  82. data/spec/fixtures/rails7_users_app/storage/.keep +0 -0
  83. data/spec/fixtures/rails7_users_app/test/application_system_test_case.rb +5 -0
  84. data/spec/fixtures/rails7_users_app/test/channels/application_cable/connection_test.rb +11 -0
  85. data/spec/fixtures/rails7_users_app/test/controllers/.keep +0 -0
  86. data/spec/fixtures/rails7_users_app/test/fixtures/files/.keep +0 -0
  87. data/spec/fixtures/rails7_users_app/test/fixtures/instances.yml +11 -0
  88. data/spec/fixtures/rails7_users_app/test/fixtures/instructors.yml +11 -0
  89. data/spec/fixtures/rails7_users_app/test/helpers/.keep +0 -0
  90. data/spec/fixtures/rails7_users_app/test/integration/.keep +0 -0
  91. data/spec/fixtures/rails7_users_app/test/mailers/.keep +0 -0
  92. data/spec/fixtures/rails7_users_app/test/models/.keep +0 -0
  93. data/spec/fixtures/rails7_users_app/test/models/instance_test.rb +6 -0
  94. data/spec/fixtures/rails7_users_app/test/models/instructor_test.rb +7 -0
  95. data/spec/fixtures/rails7_users_app/test/system/.keep +0 -0
  96. data/spec/fixtures/rails7_users_app/test/test_helper.rb +13 -0
  97. data/spec/hook_spec.rb +2 -1
  98. data/spec/rails_recording_spec.rb +6 -4
  99. data/spec/rails_spec_helper.rb +7 -0
  100. data/spec/rails_test_spec.rb +45 -0
  101. data/spec/swagger/swagger_spec.rb +2 -2
  102. data/test/expectations/openssl_test_key_sign2-3.1.json +52 -0
  103. data/test/openssl_test.rb +7 -1
  104. metadata +96 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72b52604fce9e01c3e4bc760d12f877a47b846a2f42a3e880dc3fbe3a3caf07b
4
- data.tar.gz: 50428860dafdf6f79add97f9f51787014358b6178f5206ebc915c85dced62eb7
3
+ metadata.gz: 6889544929fdf05360b3e528847aaa1e3c4a423c580b982d5ecbb3403a44f6aa
4
+ data.tar.gz: dad6b337385f4700b0974bf727329afa2bcd4c33f5a17bd951fd9516608a5798
5
5
  SHA512:
6
- metadata.gz: ae7670741f126ccf52fc7916229f29831a4320a673db755ab9c38fa9286e970baa447134c96acab4f443a4115bd8bca8f49552a983212e328bacabd88abd8352
7
- data.tar.gz: 5e7b760bc10d31a40ae44996a9200e1ef6c3976364b4a43e5dd6b7b9b81005f57e1efac758f54b4d8274dc420cc74baebf91629ab12bc2a26b8959642feba56d
6
+ metadata.gz: 197d249f8aa3ca22766168688f3b31e3b9cdf4c16d20227012d77dc5d6d1eb16b7814af8e605b51a5dc5a60ef4861f8cfd3f7089878ff88b046fac59a15b52a3
7
+ data.tar.gz: 0e74d7f95043ea588f0a0ef9aca170765db7475c6009d6471ce2299885b59aca25eb4d87bb72cd7045a2a743b6b8c95fbb6348786d99cb938a269c73189a5234
data/.travis.yml CHANGED
@@ -1,10 +1,13 @@
1
1
  language: ruby
2
2
  dist: bionic
3
3
 
4
+ # NB: if you update the ruby versions here, you also need to update
5
+ # them in the Rakefile.
4
6
  rbenv:
5
7
  - 2.6
6
8
  - 2.7
7
9
  - 3.0
10
+ - 3.1
8
11
 
9
12
  addons:
10
13
  apt:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [0.77.3](https://github.com/applandinc/appmap-ruby/compare/v0.77.2...v0.77.3) (2022-03-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Rescue exceptions when calling Class#to_s ([f59f2f6](https://github.com/applandinc/appmap-ruby/commit/f59f2f6b39664ff050486c88ff1b859ca0db48d8))
7
+
8
+ ## [0.77.2](https://github.com/applandinc/appmap-ruby/compare/v0.77.1...v0.77.2) (2022-03-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Pass the proper openapi-template arg ([05cbfde](https://github.com/applandinc/appmap-ruby/commit/05cbfdebdf80e3df2105a943ad892d5a7df614d7))
14
+
15
+ ## [0.77.1](https://github.com/applandinc/appmap-ruby/compare/v0.77.0...v0.77.1) (2022-03-24)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Add 3.1 as a supported version ([453f6df](https://github.com/applandinc/appmap-ruby/commit/453f6dfc5de29303fc9cbcf60ce0c3499528711c))
21
+
1
22
  # [0.77.0](https://github.com/applandinc/appmap-ruby/compare/v0.76.0...v0.77.0) (2022-03-22)
2
23
 
3
24
 
data/Rakefile CHANGED
@@ -2,6 +2,21 @@ $: << File.join(__dir__, 'lib')
2
2
  require 'appmap/version'
3
3
  GEM_VERSION = AppMap::VERSION
4
4
 
5
+ # Make sure the local version is not behind the one on
6
+ # rubygems.org (it's ok if they're the same).
7
+ #
8
+ # If it is behind, the fixture images won't get updated with the gem
9
+ # built from the local source, so you'll wind up testing the rubygems
10
+ # version instead.
11
+ unless ENV['SKIP_VERSION_CHECK']
12
+ require 'json'
13
+ require 'net/http'
14
+ rubygems_version = JSON.parse(Net::HTTP.get(URI.parse('https://rubygems.org/api/v1/gems/appmap.json')))['version']
15
+ if Gem::Version.new(GEM_VERSION) < Gem::Version.new(rubygems_version)
16
+ raise "#{GEM_VERSION} < #{rubygems_version}. Rebase to avoid build issues."
17
+ end
18
+ end
19
+
5
20
  require 'rake/testtask'
6
21
  require 'rdoc/task'
7
22
 
@@ -13,7 +28,7 @@ Rake::ExtensionTask.new("appmap") do |ext|
13
28
  ext.lib_dir = "lib/appmap"
14
29
  end
15
30
 
16
- RUBY_VERSIONS=%w[2.6 2.7 3.0].select do |version|
31
+ RUBY_VERSIONS=%w[2.6 2.7 3.0 3.1].select do |version|
17
32
  travis_ruby_version = ENV['TRAVIS_RUBY_VERSION']
18
33
  next true unless travis_ruby_version
19
34
 
@@ -24,7 +39,7 @@ RUBY_VERSIONS=%w[2.6 2.7 3.0].select do |version|
24
39
 
25
40
  false
26
41
  end
27
- FIXTURE_APPS=%w[rack_users_app rails6_users_app rails5_users_app]
42
+ FIXTURE_APPS=[:rack_users_app, :rails6_users_app, :rails5_users_app, :rails7_users_app => {:ruby_version => '>= 2.7'}]
28
43
 
29
44
  def run_cmd(*cmd)
30
45
  $stderr.puts "Running: #{cmd}"
@@ -83,7 +98,17 @@ namespace :build do
83
98
  RUBY_VERSIONS.each do |ruby_version|
84
99
  namespace ruby_version do
85
100
  desc "build:fixtures:#{ruby_version}"
86
- FIXTURE_APPS.each do |app|
101
+ FIXTURE_APPS.each do |app_spec|
102
+ app = if app_spec.instance_of?(Hash)
103
+ app_spec = app_spec.flatten
104
+ version_rqt = Gem::Requirement.create(app_spec[1][:ruby_version])
105
+ next unless version_rqt =~ (Gem::Version.new(ruby_version))
106
+ app = app_spec[0]
107
+ else
108
+ app = app_spec
109
+ end.to_s
110
+
111
+
87
112
  desc app
88
113
  task app => ["base:#{ruby_version}"] do
89
114
  build_app_image(app, ruby_version)
@@ -109,12 +134,13 @@ def run_specs(ruby_version, task_args)
109
134
  # description), because it's not intended to be invoked directly
110
135
  RSpec::Core::RakeTask.new("rspec_#{ruby_version}", [:specs]) do |task, args|
111
136
  task.exclude_pattern = 'spec/fixtures/**/*_spec.rb'
137
+ task.rspec_opts = '-f doc'
112
138
  if args.count > 0
113
139
  # There doesn't appear to be a value for +pattern+ that will
114
140
  # cause it to be ignored. Setting it to '' or +nil+ causes an
115
141
  # empty argument to get passed to rspec, which confuses it.
116
142
  task.pattern = 'never match this'
117
- task.rspec_opts = args.to_a.join(' ')
143
+ task.rspec_opts += " " + args.to_a.join(' ')
118
144
  end
119
145
  end
120
146
 
data/appmap.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency 'reverse_markdown'
33
33
 
34
34
  spec.add_development_dependency 'bundler', '>= 1.16'
35
- spec.add_development_dependency 'minitest', '= 5.14.4'
35
+ spec.add_development_dependency 'minitest', '~> 5.14'
36
36
  spec.add_development_dependency 'pry-byebug'
37
37
  spec.add_development_dependency 'rake', '>= 12.3.3'
38
38
  spec.add_development_dependency 'rdoc'
data/lib/appmap/config.rb CHANGED
@@ -450,7 +450,15 @@ module AppMap
450
450
 
451
451
  # Hook a method which is specified by class and method name.
452
452
  def package_for_code_object
453
- class_name = cls.to_s.index('#<Class:') == 0 ? cls.to_s['#<Class:'.length...-1] : cls.name
453
+ class_name = begin
454
+ cls.to_s.index('#<Class:') == 0 ? cls.to_s['#<Class:'.length...-1] : cls.name
455
+ rescue
456
+ # Calling #to_s on some Rails classes
457
+ # (e.g. those generated to represent
458
+ # associations) will raise an exception. Fall
459
+ # back to using the class name.
460
+ cls.name
461
+ end
454
462
  Array(config.gem_hooks[class_name])
455
463
  .find { |hook| hook.include_method?(method.name) }
456
464
  &.package
@@ -20,9 +20,14 @@ module AppMap
20
20
  appmap_js = AppMap::NodeCLI.new(verbose: Rake.verbose == true)
21
21
 
22
22
  FileUtils.mkdir_p configuration.swagger_config.output_dir
23
+ swagger_template = Tempfile.new('swagger_template')
24
+
25
+ swagger_template.write(configuration.swagger_config.template.to_yaml)
26
+ swagger_template.close
23
27
 
24
28
  cmd = %w[swagger]
25
-
29
+ cmd << '--openapi-template' << swagger_template.path
30
+
26
31
  swagger_raw, = appmap_js.command(cmd)
27
32
 
28
33
  gen_swagger = YAML.load(swagger_raw)
@@ -3,11 +3,11 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.77.0'
6
+ VERSION = '0.77.3'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.5.1'
9
9
 
10
- SUPPORTED_RUBY_VERSIONS = %w[2.6 2.7 3.0].freeze
10
+ SUPPORTED_RUBY_VERSIONS = %w[2.6 2.7 3.0 3.1].freeze
11
11
 
12
12
  DEFAULT_APPMAP_DIR = 'tmp/appmap'.freeze
13
13
  DEFAULT_CONFIG_FILE_PATH = 'appmap.yml'.freeze
@@ -0,0 +1 @@
1
+ Gemfile.lock
@@ -0,0 +1,7 @@
1
+ # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
+
3
+ # Mark the database schema as having been generated.
4
+ db/schema.rb linguist-generated
5
+
6
+ # Mark any vendored files as having been vendored.
7
+ vendor/* linguist-vendored
@@ -0,0 +1,31 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore all logfiles and tempfiles.
11
+ /log/*
12
+ /tmp/*
13
+ !/log/.keep
14
+ !/tmp/.keep
15
+
16
+ # Ignore pidfiles, but keep the directory.
17
+ /tmp/pids/*
18
+ !/tmp/pids/
19
+ !/tmp/pids/.keep
20
+
21
+ # Ignore uploaded files in development.
22
+ /storage/*
23
+ !/storage/.keep
24
+ /tmp/storage/*
25
+ !/tmp/storage/
26
+ !/tmp/storage/.keep
27
+
28
+ /public/assets
29
+
30
+ # Ignore master key for decrypting credentials and more.
31
+ /config/master.key
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -0,0 +1 @@
1
+ ruby-3.1.0
@@ -0,0 +1,30 @@
1
+ ARG GEM_VERSION
2
+ ARG RUBY_VERSION
3
+
4
+ FROM appmap:${GEM_VERSION} as appmap
5
+ FROM ruby:${RUBY_VERSION}
6
+
7
+ SHELL ["/bin/bash", "-c"]
8
+
9
+ RUN apt-get update && apt-get install -y vim less
10
+ RUN apt-get install -y postgresql-client
11
+
12
+ RUN mkdir /app
13
+ WORKDIR /app
14
+
15
+ RUN gem install -N bundler
16
+
17
+ COPY Gemfile .
18
+
19
+ RUN bundle
20
+
21
+ COPY . .
22
+
23
+ COPY --from=appmap /pkg/appmap.gem /tmp/
24
+ RUN gem install /tmp/appmap.gem && \
25
+ bundle update --local appmap && \
26
+ bundle binstubs appmap --force
27
+
28
+ EXPOSE 3000
29
+
30
+ HEALTHCHECK --interval=1s --retries=10 CMD curl --fail http://localhost:3000/health || exit 1
@@ -0,0 +1,3 @@
1
+ FROM postgres:10
2
+
3
+ HEALTHCHECK --interval=1s --retries=10 CMD psql -U postgres -c "select 1" || exit 1
@@ -0,0 +1,99 @@
1
+ source "https://rubygems.org"
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
5
+ gem "rails", "~> 7.0.2", ">= 7.0.2.3"
6
+
7
+ # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
8
+ gem "sprockets-rails"
9
+
10
+ # Use postgresql as the database for Active Record
11
+ gem "pg", "~> 1.1"
12
+
13
+ # Use the Puma web server [https://github.com/puma/puma]
14
+ gem "puma", "~> 5.0"
15
+
16
+ # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
17
+ gem "importmap-rails"
18
+
19
+ # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
20
+ gem "turbo-rails"
21
+
22
+ # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
23
+ gem "stimulus-rails"
24
+
25
+ # Build JSON APIs with ease [https://github.com/rails/jbuilder]
26
+ gem "jbuilder"
27
+
28
+ # Use Redis adapter to run Action Cable in production
29
+ # gem "redis", "~> 4.0"
30
+
31
+ # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
32
+ # gem "kredis"
33
+
34
+ # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
35
+ # gem "bcrypt", "~> 3.1.7"
36
+
37
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
38
+ gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
39
+
40
+ # Reduces boot times through caching; required in config/boot.rb
41
+ gem "bootsnap", require: false
42
+
43
+ # Use Sass to process CSS
44
+ # gem "sassc-rails"
45
+
46
+ # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
47
+ # gem "image_processing", "~> 1.2"
48
+
49
+ group :development, :test do
50
+ # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
51
+ gem "debug", platforms: %i[ mri mingw x64_mingw ]
52
+ end
53
+
54
+ group :development do
55
+ # Use console on exceptions pages [https://github.com/rails/web-console]
56
+ gem "web-console"
57
+
58
+ # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
59
+ # gem "rack-mini-profiler"
60
+
61
+ # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
62
+ # gem "spring"
63
+ end
64
+
65
+ group :test do
66
+ # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
67
+ gem "capybara"
68
+ gem "selenium-webdriver"
69
+ gem "webdrivers"
70
+ end
71
+
72
+ appmap_path = \
73
+ # Support debugging inside the container with volume-mounted source
74
+ if File.directory?('/src/appmap-ruby')
75
+ '/src/appmap-ruby'
76
+ elsif File.exist?('../../../appmap.gemspec')
77
+ '../../..'
78
+ end
79
+
80
+ if appmap_path
81
+ # Set the branch parameter, so that 'bundle config local.appmap' will work
82
+ appmap_branch = Dir.chdir appmap_path do
83
+ `git rev-parse --abbrev-ref HEAD`.strip
84
+ end
85
+ end
86
+
87
+ appmap_options = \
88
+ if appmap_path && appmap_branch
89
+ { git: appmap_path, branch: appmap_branch }
90
+ elsif appmap_path
91
+ { path: appmap_path }
92
+ else
93
+ {}
94
+ end.merge(require: %w[appmap])
95
+
96
+ group :development, :test do
97
+ gem 'appmap', appmap_options
98
+ gem 'pry-byebug', '>=0', '< 99'
99
+ end
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative "config/application"
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
3
+ //= link_tree ../../javascript .js
4
+ //= link_tree ../../../vendor/javascript .js
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+ import "@hotwired/turbo-rails"
3
+ import "controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ // Import and register all your controllers from the importmap under controllers/*
2
+
3
+ import { application } from "controllers/application"
4
+
5
+ // Eager load all controllers defined in the import map under controllers/**/*_controller
6
+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7
+ eagerLoadControllersFrom("controllers", application)
8
+
9
+ // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10
+ // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11
+ // lazyLoadControllersFrom("controllers", application)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Instance < ApplicationRecord
4
+ belongs_to :course
5
+ has_and_belongs_to_many :instructor
6
+ end
7
+
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Instructor < ApplicationRecord
4
+ belongs_to :user
5
+ has_and_belongs_to_many :instance
6
+ end
7
+
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>App</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%= javascript_importmap_tags %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= yield %>
15
+ </body>
16
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1,3 @@
1
+ name: rails7_users_app
2
+ packages:
3
+ - path: app