orthoses-rails 0.3.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -39
  3. data/examples/rails/Rakefile +139 -68
  4. data/examples/rails/config/database.yml +8 -0
  5. data/examples/rails/config/storage.yml +3 -0
  6. data/examples/rails/gemfiles/Gemfile_6_0 +16 -0
  7. data/examples/rails/gemfiles/Gemfile_6_0.lock +172 -0
  8. data/examples/rails/gemfiles/Gemfile_6_1 +15 -0
  9. data/examples/rails/gemfiles/Gemfile_6_1.lock +173 -0
  10. data/examples/rails/gemfiles/Gemfile_7_0 +15 -0
  11. data/examples/rails/gemfiles/Gemfile_7_0.lock +172 -0
  12. data/examples/rails/tasks/active_job.rake +95 -0
  13. data/examples/rails/tasks/active_model.rake +46 -0
  14. data/examples/rails/tasks/active_record.rake +83 -0
  15. data/examples/rails/tasks/active_storage.rake +94 -0
  16. data/examples/rails/tasks/active_support.rake +92 -0
  17. data/lib/orthoses/active_model/has_secure_password.rb +4 -4
  18. data/lib/orthoses/active_model.rb +0 -1
  19. data/lib/orthoses/active_record/delegated_type.rb +50 -0
  20. data/lib/orthoses/active_record/enum.rb +77 -0
  21. data/lib/orthoses/active_record/scope.rb +63 -0
  22. data/lib/orthoses/active_record.rb +3 -1
  23. data/lib/orthoses/active_support/class_attribute.rb +12 -12
  24. data/lib/orthoses/active_support/configurable.rb +36 -0
  25. data/lib/orthoses/active_support/delegation.rb +14 -14
  26. data/lib/orthoses/active_support/mattr_accessor.rb +8 -8
  27. data/lib/orthoses/active_support/time_with_zone.rb +22 -9
  28. data/lib/orthoses/active_support.rb +1 -4
  29. data/lib/orthoses/rails/version.rb +1 -1
  30. data/lib/orthoses/rails.rb +0 -1
  31. data/orthoses-rails.gemspec +1 -1
  32. metadata +22 -89
  33. data/examples/rails/known_sig/action_cable/connection/test_cookie_jar.rbs +0 -2
  34. data/examples/rails/known_sig/action_controller/metal.rbs +0 -4
  35. data/examples/rails/known_sig/action_dispatch/cookies/cookie_jar.rbs +0 -3
  36. data/examples/rails/known_sig/action_dispatch/response.rbs +0 -4
  37. data/examples/rails/patch/drb/drb_undumped.rbs +0 -2
  38. data/examples/rails/patch/drb.rbs +0 -2
  39. data/examples/rails/patch/erubi/engine.rbs +0 -4
  40. data/examples/rails/patch/erubi.rbs +0 -2
  41. data/examples/rails/patch/minitest/kernel.rbs +0 -44
  42. data/examples/rails/patch/minitest/minitest/abstract_reporter.rbs +0 -49
  43. data/examples/rails/patch/minitest/minitest/assertion.rbs +0 -16
  44. data/examples/rails/patch/minitest/minitest/assertions.rbs +0 -545
  45. data/examples/rails/patch/minitest/minitest/backtrace_filter.rbs +0 -16
  46. data/examples/rails/patch/minitest/minitest/bench_spec.rbs +0 -101
  47. data/examples/rails/patch/minitest/minitest/benchmark.rbs +0 -258
  48. data/examples/rails/patch/minitest/minitest/composite_reporter.rbs +0 -25
  49. data/examples/rails/patch/minitest/minitest/expectations.rbs +0 -21
  50. data/examples/rails/patch/minitest/minitest/guard.rbs +0 -64
  51. data/examples/rails/patch/minitest/minitest/mock.rbs +0 -60
  52. data/examples/rails/patch/minitest/minitest/parallel/executor.rbs +0 -42
  53. data/examples/rails/patch/minitest/minitest/parallel/test/class_methods.rbs +0 -6
  54. data/examples/rails/patch/minitest/minitest/parallel/test.rbs +0 -3
  55. data/examples/rails/patch/minitest/minitest/parallel.rbs +0 -2
  56. data/examples/rails/patch/minitest/minitest/pride_io.rbs +0 -54
  57. data/examples/rails/patch/minitest/minitest/pride_lol.rbs +0 -17
  58. data/examples/rails/patch/minitest/minitest/progress_reporter.rbs +0 -11
  59. data/examples/rails/patch/minitest/minitest/reportable.rbs +0 -51
  60. data/examples/rails/patch/minitest/minitest/reporter.rbs +0 -5
  61. data/examples/rails/patch/minitest/minitest/result.rbs +0 -28
  62. data/examples/rails/patch/minitest/minitest/runnable.rbs +0 -131
  63. data/examples/rails/patch/minitest/minitest/skip.rbs +0 -6
  64. data/examples/rails/patch/minitest/minitest/spec/dsl/instance_methods.rbs +0 -48
  65. data/examples/rails/patch/minitest/minitest/spec/dsl.rbs +0 -125
  66. data/examples/rails/patch/minitest/minitest/spec.rbs +0 -10
  67. data/examples/rails/patch/minitest/minitest/statistics_reporter.rbs +0 -76
  68. data/examples/rails/patch/minitest/minitest/summary_reporter.rbs +0 -26
  69. data/examples/rails/patch/minitest/minitest/test/lifecycle_hooks.rbs +0 -92
  70. data/examples/rails/patch/minitest/minitest/test.rbs +0 -76
  71. data/examples/rails/patch/minitest/minitest/unexpected_error.rbs +0 -10
  72. data/examples/rails/patch/minitest/minitest/unit/test_case.rbs +0 -3
  73. data/examples/rails/patch/minitest/minitest/unit.rbs +0 -5
  74. data/examples/rails/patch/minitest/minitest.rbs +0 -966
  75. data/examples/rails/patch/pg/simple_decoder.rbs +0 -4
  76. data/examples/rails/patch/pg.rbs +0 -2
  77. data/examples/rails/patch/qc/queue.rbs +0 -2
  78. data/examples/rails/patch/qc.rbs +0 -2
  79. data/examples/rails/patch/que/job.rbs +0 -2
  80. data/examples/rails/patch/que.rbs +0 -2
  81. data/examples/rails/patch/rack/cache/entity_store.rbs +0 -2
  82. data/examples/rails/patch/rack/cache/meta_store.rbs +0 -2
  83. data/examples/rails/patch/rack/cache.rbs +0 -2
  84. data/examples/rails/patch/rack/session/dalli.rbs +0 -2
  85. data/examples/rails/patch/rack/session.rbs +0 -2
  86. data/examples/rails/patch/rboc.rbs +0 -2
  87. data/examples/rails/patch/rdoc/generator/sdoc.rbs +0 -3
  88. data/examples/rails/patch/rdoc/generator.rbs +0 -2
  89. data/examples/rails/patch/rdoc/task.rbs +0 -2
  90. data/examples/rails/patch/ripper.rbs +0 -2
  91. data/examples/rails/patch/sidekiq/worker.rbs +0 -2
  92. data/examples/rails/patch/sidekiq.rbs +0 -2
  93. data/examples/rails/patch/sneakers/worker.rbs +0 -2
  94. data/examples/rails/patch/sneakers.rbs +0 -2
  95. data/examples/rails/patch/sucker_punch/job.rbs +0 -2
  96. data/examples/rails/patch/sucker_punch.rbs +0 -2
  97. data/examples/rails/patch/thor/actions/create_file.rbs +0 -2
  98. data/examples/rails/patch/thor/actions.rbs +0 -2
  99. data/examples/rails/patch/thor/error.rbs +0 -2
  100. data/examples/rails/patch/thor/group.rbs +0 -2
  101. data/examples/rails/patch/thor.rbs +0 -2
  102. data/lib/orthoses/active_model/known_sig/7.0/serialization.rbs +0 -4
  103. data/lib/orthoses/active_model/known_sig/7.0/validations.rbs +0 -4
  104. data/lib/orthoses/active_model/known_sig.rb +0 -21
  105. data/lib/orthoses/active_record/known_sig/6.0/result.rbs +0 -5
  106. data/lib/orthoses/active_record/known_sig/6.1/result.rbs +0 -5
  107. data/lib/orthoses/active_record/known_sig/7.0/encryption/context.rbs +0 -9
  108. data/lib/orthoses/active_record/known_sig/7.0/result.rbs +0 -5
  109. data/lib/orthoses/active_record/known_sig.rb +0 -21
  110. data/lib/orthoses/active_support/concern.rb +0 -32
  111. data/lib/orthoses/active_support/known_sig/7.0/active_support/callbacks/callback_chain.rbs +0 -9
  112. data/lib/orthoses/active_support/known_sig/7.0/active_support/hash_with_indifferent_access.rbs +0 -6
  113. data/lib/orthoses/active_support/known_sig/7.0/hash_with_indifferent_access.rbs +0 -2
  114. data/lib/orthoses/active_support/known_sig/7.0/time.rbs +0 -68
  115. data/lib/orthoses/active_support/known_sig.rb +0 -21
  116. data/lib/orthoses/rails/known_sig_helper.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c109c955af37e4574528af34d8a3695450abf39f5359729625307c368b961259
4
- data.tar.gz: 29d4ad1bf3e9d4a8d18e3108899c83cd133221d3f2dc1b3f3a6cb2165684c830
3
+ metadata.gz: 46bcd93481527f23bfe512d336313721f7cf17fe67bb124e51e016f59cff14c2
4
+ data.tar.gz: 7a783be26aeeb877069e4c0e431765e274bb07dd25438669ca8dbb58c6417405
5
5
  SHA512:
6
- metadata.gz: f491dab5ce7ce402058fec79a42c1c776434bbb88adedd8928b70031f614ef57051d9501c279c628903269413e55db24e3c9493101e79c758cfb5a202ba41f37
7
- data.tar.gz: 701d609fb62bfa2d9ac0e226090844bc93d526328121516cc07cb3c8424c3f2992b4f365c3cb0680379c972238b68a3fdaa87d36a0c4849803732a5603b09f3f
6
+ metadata.gz: ef3237aa508e90177b76dd160456404cf37dfcd1907b18ad299b1cd2f95e1abd4971762de5a0679850943b220348b7f7528689eef31be84651a30cbb29eb2601
7
+ data.tar.gz: 353ee63dc4a5bd7fa82fa59f571766b842690c09bd98d14e4f3f1defbb77ec14870f361149b3ac0ab6b46cad9b933f02ecaf8190a5824a4e3739b088ba14bea4
data/README.md CHANGED
@@ -5,42 +5,36 @@ Orthoses::Rails automatically generates RBS for methods added by Rails.
5
5
 
6
6
  ## Features
7
7
 
8
- ### Orthoses::ActiveModel::HasSecurePassword
9
-
10
- Add signatures that generated form `ActiveModel::SecurePassword::ClassMethods#has_secure_password`.
11
-
12
- ### Orthoses::ActiveRecord::BelongsTo
13
-
14
- Add signatures that generated form `ActiveRecord::Associations::ClassMethods#belongs_to`.
15
-
16
- ### Orthoses::ActiveRecord::GeneratedAttributeMethods
17
-
18
- Add signatures that generated from DB schema columns.
19
-
20
- ### Orthoses::ActiveRecord::HasMany
21
-
22
- Add signatures that generated form `ActiveRecord::Associations::ClassMethods#has_many`.
23
-
24
- ### Orthoses::ActiveRecord::HasOne
25
-
26
- Add signatures that generated form `ActiveRecord::Associations::ClassMethods#has_one`.
27
-
28
- ### Orthoses::ActiveSupport::ClassAttribute
29
-
30
- Add signatures that generated form `Class#class_attribute`.
31
-
32
- ### Orthoses::ActiveSupport::Concern
33
-
34
- Add signature `extend ActiveSupport::Concern` only.
35
-
36
- ### Orthoses::ActiveSupport::MattrAccessor
37
-
38
- Add signatures that generated form `Module#mattr_accessor`, `Module#mattr_reader` and `Module#mattr_writer`.
39
-
40
- ### Orthoses::ActiveSupport::TimeWithZone
41
-
42
- Add signatures `Time` and `ActiveSupport::TimeWithZone`.
43
- Methods and mixin delegated from `Time` are added to `ActiveSupport::TimeWithZone`.
8
+ ### Orthoses::ActiveModel
9
+
10
+ - `HasSecurePassword`
11
+ - Add signatures that generated form `has_secure_password`.
12
+
13
+ ### Orthoses::ActiveRecord
14
+
15
+ - `BelongsTo`
16
+ - Add signatures that generated form `belongs_to`.
17
+ - `DelegatedType`
18
+ - Add signatures that generated from `delegated_type`
19
+ - `Enum`
20
+ - Add signatures that generated from `enum`
21
+ - `HasMany`
22
+ - Add signatures that generated form `has_many`.
23
+ - `HasOne`
24
+ - Add signatures that generated form `has_one`.
25
+ - `Scope`
26
+ - Add signatures that generated form `scope`.
27
+
28
+ ### Orthoses::ActiveSupport
29
+
30
+ - `ClassAttribute`
31
+ - Add signatures that generated form `class_attribute`.
32
+ - `Configurable`
33
+ - Add signatures that generated from `config_accessor`
34
+ - `Delegation`
35
+ - Add signatures that generated from `delegate`. The type definition of the method or instance variable specified by `to` is required.
36
+ - `MattrAccessor`
37
+ - Add signatures that generated form `mattr_accessor`, `cattr_accessor`, `mattr_reader`, `cattr_reader`, `mattr_writer` and `cattr_writer`.
44
38
 
45
39
  ## Installation
46
40
 
@@ -68,16 +62,14 @@ Orthoses::Builder.new do
68
62
  use YourCustom::Middleware
69
63
  use Orthoses::ActiveModel::HasSecurePassword
70
64
  use Orthoses::ActiveRecord::BelongsTo
71
- use Orthoses::ActiveRecord::GeneratedAttributeMethods
72
65
  use Orthoses::ActiveRecord::HasMany
73
66
  use Orthoses::ActiveRecord::HasOne
74
- use Orthoses::ActiveSupport::Concern
75
67
  use Orthoses::ActiveSupport::ClassAttribute
76
68
  use Orthoses::ActiveSupport::MattrAccessor
77
- use Orthoses::ActiveSupport::TimeWithZone
78
69
  use Orthoses::Mixin
79
70
  use Orthoses::Constant, strict: false
80
71
  use Orthoses::ObjectSpaceAll
72
+ use Orthoses::Autoload
81
73
  run -> () {
82
74
  Rake::Task[:environment].invoke
83
75
  Rails.application.eager_load!
@@ -1,49 +1,26 @@
1
- REPO_ROOT = "#{File.dirname(__FILE__)}/src"
2
- $:.unshift("#{REPO_ROOT}/actioncable/lib")
3
- $:.unshift("#{REPO_ROOT}/actionmailbox/lib")
4
- $:.unshift("#{REPO_ROOT}/actionmailer/lib")
5
- $:.unshift("#{REPO_ROOT}/actionpack/lib")
6
- $:.unshift("#{REPO_ROOT}/actiontext/lib")
7
- $:.unshift("#{REPO_ROOT}/actionview/lib")
8
- $:.unshift("#{REPO_ROOT}/activejob/lib")
9
- $:.unshift("#{REPO_ROOT}/activemodel/lib")
10
- $:.unshift("#{REPO_ROOT}/activerecord/lib")
11
- $:.unshift("#{REPO_ROOT}/activestorage/lib")
12
- $:.unshift("#{REPO_ROOT}/activesupport/lib")
13
- $:.unshift("#{REPO_ROOT}/railties/lib")
14
-
15
- require 'orthoses'
16
- require 'orthoses-rails'
17
- require 'openssl'
18
- require 'cgi'
19
- require 'uri'
20
-
21
- Orthoses.logger.level = :error
22
-
23
- Orthoses::Utils.unautoload!
24
-
25
- def run_child_process
26
- pid = fork do
27
- yield
28
- end
29
- Process.wait(pid)
30
- end
1
+ ## run `$ rake`
31
2
 
32
3
  def switch_branch(name)
33
- cd "src" do
4
+ cd "_src" do
34
5
  sh "git switch #{name}"
35
6
  end
36
7
  end
37
8
 
38
9
  def generate(out_dir, version)
10
+ require 'orthoses'
11
+ require 'orthoses-rails'
12
+ require 'openssl'
13
+ require 'cgi'
14
+ require 'uri'
15
+
16
+ Orthoses.logger.level = :error
17
+
39
18
  loader = -> () {
40
- # require "rails/all"
41
- require "rails/app_updater"
42
- require "active_support"
19
+ require "active_support/all"
43
20
  require "active_record"
44
21
  require "active_job"
45
22
  require "active_model"
46
- require "active_storage"
23
+ require "active_storage/engine"
47
24
  require "action_dispatch"
48
25
  require "action_mailbox"
49
26
  require "action_mailer"
@@ -70,12 +47,21 @@ def generate(out_dir, version)
70
47
  v = rails_mod.respond_to?(:version) ? rails_mod.version : nil
71
48
  puts "loaded #{rails_mod}: v#{v}"
72
49
  end
73
- Orthoses::Utils.unautoload!
50
+ eval(<<~RUBY)
51
+ module Dummy
52
+ class Application < Rails::Application
53
+ config.load_defaults #{version.to_s}
54
+ config.active_storage.service = :local
55
+ end
56
+ end
57
+ RUBY
58
+ ENV['RAILS_ENV'] = 'development'
59
+ Rails.application.initialize!
74
60
  }
75
61
  Orthoses::Builder.new do
76
62
  use Orthoses::CreateFileByName,
77
63
  base_dir: "#{out_dir}/#{version}",
78
- header: "# !!! GENERATED CODE !!!"
64
+ header: "# !!! GENERATED CODE !!!\n# Please see generators/rails-generator"
79
65
  use Orthoses::AvoidRecursiveAncestorError
80
66
  use Orthoses::Filter,
81
67
  if: -> (name, content) {
@@ -88,6 +74,9 @@ def generate(out_dir, version)
88
74
  # FIXME: too hard
89
75
  return false if name.include?("::Generators")
90
76
 
77
+ # Ignore known sig
78
+ return false if Orthoses::Utils.rbs_defined_class?(name, collection: true) && content.body.empty?
79
+
91
80
  true
92
81
  }
93
82
  use Orthoses::Constant,
@@ -102,14 +91,13 @@ def generate(out_dir, version)
102
91
  use middleware, **args
103
92
  end
104
93
  use Orthoses::ActiveRecord::QueryMethods
105
- use Orthoses::ActiveRecord::KnownSig
106
- use Orthoses::ActiveModel::KnownSig
107
- use Orthoses::ObjectSpaceAll
108
94
  use Orthoses::LoadRBS,
109
- paths: Dir.glob('patch/**/*.rbs')
95
+ paths: -> { Orthoses::PathHelper.best_version_paths(::ActiveRecord::VERSION::STRING, "known_sig/activerecord") }
96
+ use Orthoses::LoadRBS,
97
+ paths: -> { Orthoses::PathHelper.best_version_paths(::ActiveModel::VERSION::STRING, "known_sig/activemodel") }
110
98
  use Orthoses::LoadRBS,
111
- paths: Dir.glob('known_sig/**/*.rbs')
112
- # require in method
99
+ paths: -> { Orthoses::PathHelper.best_version_paths(::ActiveSupport::VERSION::STRING, "known_sig/activesupport") }
100
+ # # require in method
113
101
  use Orthoses::Tap do |store|
114
102
  store.delete("DummyERB")
115
103
  store.delete("DummyCompiler")
@@ -192,53 +180,136 @@ def generate(out_dir, version)
192
180
  # MigrationProxy cannot resolve name since class alias.
193
181
  store["ActiveRecord::NullMigration"].header = nil
194
182
  end
183
+ use Orthoses::DelegateClass
184
+ use Orthoses::Attribute
195
185
  use Orthoses::Mixin,
196
186
  if: -> (base_mod, how, mod) {
197
187
  mod != Enumerable # TODO
198
188
  }
199
- use Orthoses::DelegateClass
200
- use Orthoses::Attribute
201
189
  use Orthoses::RBSPrototypeRB,
202
- paths: Dir.glob('src/{railties,action{cable,mailbox,mailer,pack,text,view},active{job,model,record,storage,support}}/lib/**/*.rb'),
190
+ paths: Dir.glob('_src/{railties,action{cable,mailbox,mailer,pack,text,view},active{job,model,record,storage,support}}/{app,lib}/**/*.rb'),
203
191
  constant_filter: -> (member) { false },
204
- mixin_filter: -> (member) { false }
192
+ mixin_filter: -> (member) { false },
193
+ attribute_filter: -> (member) { false }
194
+ use Orthoses::Autoload
205
195
  run loader
206
196
  end.call
207
197
 
208
- sh "rbs --collection ../../rbs_collection.yaml -I #{out_dir}/#{version}/ validate --silent"
209
198
  # $ cat out/7.0/**/*.rbs | wc
210
- # 72210 332252 2551928
199
+ # 69763 339342 2606899
211
200
  end
212
201
 
213
- namespace :generate do
214
- task :v60 do
215
- switch_branch("6-0-stable")
216
- run_child_process { generate("out", "6.0") }
217
- end
202
+ def generate_test_script(gem:, version:, export:, stdlib_dependencies:, gem_dependencies:, rails_dependencies:)
203
+ Pathname(export).join('_scripts').tap(&:mkdir).join('test').write(<<~SHELL)
204
+ #!/usr/bin/env bash
218
205
 
219
- task :v61 do
220
- switch_branch("6-1-stable")
221
- run_child_process { generate("out", "6.1") }
222
- end
206
+ # !!! GENERATED CODE !!!
207
+ # Please see generators/rails-generator
223
208
 
224
- task :v70 do
225
- switch_branch("7-0-stable")
226
- run_child_process { generate("out", "7.0") }
227
- end
209
+ # set -eou => Exit command with non-zero status code, Output logs of every command executed, Treat unset variables as an error when substituting.
210
+ set -eou pipefail
211
+ # Internal Field Separator - Linux shell variable
212
+ IFS=$'\n\t'
213
+ # Print shell input lines
214
+ set -v
215
+
216
+ # Set RBS_DIR variable to change directory to execute type checks using `steep check`
217
+ RBS_DIR=$(cd $(dirname $0)/..; pwd)
218
+ # Set REPO_DIR variable to validate RBS files added to the corresponding folder
219
+ REPO_DIR=$(cd $(dirname $0)/../../..; pwd)
220
+ # Validate RBS files, using the bundler environment present
221
+ bundle exec rbs --repo=$REPO_DIR #{stdlib_dependencies.map{"-r #{_1}"}.join(" ")} \\
222
+ #{gem_dependencies.map{"-r #{_1}"}.join(" ")} \\
223
+ -r #{gem} validate --silent
224
+
225
+ cd ${RBS_DIR}/_test
226
+ # Run type checks
227
+ bundle exec steep check
228
+ SHELL
229
+
230
+ sh "chmod +x #{Pathname(export).join('_scripts').join('test')}"
231
+
232
+ Pathname(export).join('_test').tap(&:mkdir).join('Steepfile').write(<<~RUBY)
233
+ # !!! GENERATED CODE !!!
234
+ # Please see generators/rails-generator
235
+
236
+ D = Steep::Diagnostic
237
+
238
+ target :test do
239
+ signature "."
240
+ check "."
241
+
242
+ repo_path "../../../"
243
+
244
+ #{stdlib_dependencies.map{" library \"#{_1}\""}.join("\n")}
245
+ #{gem_dependencies.map{" library \"#{_1}\""}.join("\n")}
246
+
247
+ library "#{gem}:#{version}"
248
+
249
+ configure_code_diagnostics(D::Ruby.all_error)
250
+ end
251
+ RUBY
228
252
  end
229
253
 
254
+ VERSIONS = %w[
255
+ 6.0
256
+ 6.1
257
+ 7.0
258
+ ]
259
+ Object.private_constant :VERSIONS
260
+
261
+ GEMS = %w[
262
+ active_support
263
+ active_model
264
+ active_record
265
+ active_job
266
+ active_storage
267
+ ]
268
+ Object.private_constant :GEMS
269
+
230
270
  task :clean do
231
271
  FileUtils.rm_rf("out")
232
272
  end
233
273
 
234
- task :test do
235
- sh "steep check"
274
+ namespace :bundle do
275
+ task :update do
276
+ VERSIONS.each do |version|
277
+ sh "BUNDLE_GEMFILE=gemfiles/Gemfile_#{version.tr('.', '_')} bundle update"
278
+ end
279
+ end
280
+ end
281
+
282
+ VERSIONS.each do |version|
283
+ namespace version do
284
+ desc "run all version=#{version}"
285
+ task :all => [
286
+ "#{version}:generate",
287
+ *(GEMS.map{"#{version}:#{_1}:export"}),
288
+ # *(GEMS.map{"#{version}:#{_1}:validate"}),
289
+ # *(GEMS.map{"#{version}:#{_1}:install"})
290
+ ]
291
+
292
+ desc "generate version=#{version}"
293
+ task :generate do |t|
294
+ gemfile = File.expand_path("gemfiles/Gemfile_#{version.tr('.', '_')}")
295
+ sh "BUNDLE_GEMFILE=#{gemfile} bundle install"
296
+ sh "BUNDLE_GEMFILE=#{gemfile} bundle exec rake #{t.name}_exec"
297
+ end
298
+
299
+ task :generate_exec do
300
+ switch_branch("#{version.tr('.', '-')}-stable")
301
+ generate("out", version)
302
+ end
303
+ end
236
304
  end
237
305
 
306
+ load 'tasks/active_job.rake'
307
+ load 'tasks/active_model.rake'
308
+ load 'tasks/active_record.rake'
309
+ load 'tasks/active_storage.rake'
310
+ load 'tasks/active_support.rake'
311
+
238
312
  task default: [
239
313
  :clean,
240
-
241
- 'generate:v60',
242
- 'generate:v61',
243
- 'generate:v70',
314
+ *(VERSIONS.map {"#{_1}:all"})
244
315
  ]
@@ -0,0 +1,8 @@
1
+ development:
2
+ primary: &primary
3
+ adapter: sqlite3
4
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
5
+ timeout: 5000
6
+ database: ':memory:'
7
+ replica:
8
+ <<: *primary
@@ -0,0 +1,3 @@
1
+ local:
2
+ service: Disk
3
+ root: <%= Rails.root.join("storage") %>
@@ -0,0 +1,16 @@
1
+ source "https://rubygems.org"
2
+
3
+ ruby "~> 3.1.0"
4
+
5
+ gemspec path: '../../../'
6
+
7
+ gem "rails", ">= 6.0", "< 6.1"
8
+ gem "sqlite3"
9
+ # gem "orthoses", path: "../../../../orthoses"
10
+
11
+ if RUBY_VERSION >= "3.1"
12
+ gem "net-smtp", require: false
13
+ gem "net-imap", require: false
14
+ gem "net-pop", require: false
15
+ gem "psych", "~> 3"
16
+ end
@@ -0,0 +1,172 @@
1
+ PATH
2
+ remote: ../../..
3
+ specs:
4
+ orthoses-rails (0.4.0)
5
+ orthoses (>= 0.10)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.0.5)
11
+ actionpack (= 6.0.5)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (6.0.5)
15
+ actionpack (= 6.0.5)
16
+ activejob (= 6.0.5)
17
+ activerecord (= 6.0.5)
18
+ activestorage (= 6.0.5)
19
+ activesupport (= 6.0.5)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.0.5)
22
+ actionpack (= 6.0.5)
23
+ actionview (= 6.0.5)
24
+ activejob (= 6.0.5)
25
+ mail (~> 2.5, >= 2.5.4)
26
+ rails-dom-testing (~> 2.0)
27
+ actionpack (6.0.5)
28
+ actionview (= 6.0.5)
29
+ activesupport (= 6.0.5)
30
+ rack (~> 2.0, >= 2.0.8)
31
+ rack-test (>= 0.6.3)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
+ actiontext (6.0.5)
35
+ actionpack (= 6.0.5)
36
+ activerecord (= 6.0.5)
37
+ activestorage (= 6.0.5)
38
+ activesupport (= 6.0.5)
39
+ nokogiri (>= 1.8.5)
40
+ actionview (6.0.5)
41
+ activesupport (= 6.0.5)
42
+ builder (~> 3.1)
43
+ erubi (~> 1.4)
44
+ rails-dom-testing (~> 2.0)
45
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
+ activejob (6.0.5)
47
+ activesupport (= 6.0.5)
48
+ globalid (>= 0.3.6)
49
+ activemodel (6.0.5)
50
+ activesupport (= 6.0.5)
51
+ activerecord (6.0.5)
52
+ activemodel (= 6.0.5)
53
+ activesupport (= 6.0.5)
54
+ activestorage (6.0.5)
55
+ actionpack (= 6.0.5)
56
+ activejob (= 6.0.5)
57
+ activerecord (= 6.0.5)
58
+ marcel (~> 1.0)
59
+ activesupport (6.0.5)
60
+ concurrent-ruby (~> 1.0, >= 1.0.2)
61
+ i18n (>= 0.7, < 2)
62
+ minitest (~> 5.1)
63
+ tzinfo (~> 1.1)
64
+ zeitwerk (~> 2.2, >= 2.2.2)
65
+ builder (3.2.4)
66
+ concurrent-ruby (1.1.10)
67
+ crass (1.0.6)
68
+ digest (3.1.0)
69
+ erubi (1.10.0)
70
+ globalid (1.0.0)
71
+ activesupport (>= 5.0)
72
+ i18n (1.10.0)
73
+ concurrent-ruby (~> 1.0)
74
+ loofah (2.18.0)
75
+ crass (~> 1.0.2)
76
+ nokogiri (>= 1.5.9)
77
+ mail (2.7.1)
78
+ mini_mime (>= 0.1.1)
79
+ marcel (1.0.2)
80
+ method_source (1.0.0)
81
+ mini_mime (1.1.2)
82
+ mini_portile2 (2.8.0)
83
+ minitest (5.16.1)
84
+ net-imap (0.2.3)
85
+ digest
86
+ net-protocol
87
+ strscan
88
+ net-pop (0.1.1)
89
+ digest
90
+ net-protocol
91
+ timeout
92
+ net-protocol (0.1.3)
93
+ timeout
94
+ net-smtp (0.3.1)
95
+ digest
96
+ net-protocol
97
+ timeout
98
+ nio4r (2.5.8)
99
+ nokogiri (1.13.6)
100
+ mini_portile2 (~> 2.8.0)
101
+ racc (~> 1.4)
102
+ orthoses (0.10.0)
103
+ rbs (~> 2.0)
104
+ psych (3.3.2)
105
+ racc (1.6.0)
106
+ rack (2.2.3.1)
107
+ rack-test (2.0.0)
108
+ rack (>= 1.3)
109
+ rails (6.0.5)
110
+ actioncable (= 6.0.5)
111
+ actionmailbox (= 6.0.5)
112
+ actionmailer (= 6.0.5)
113
+ actionpack (= 6.0.5)
114
+ actiontext (= 6.0.5)
115
+ actionview (= 6.0.5)
116
+ activejob (= 6.0.5)
117
+ activemodel (= 6.0.5)
118
+ activerecord (= 6.0.5)
119
+ activestorage (= 6.0.5)
120
+ activesupport (= 6.0.5)
121
+ bundler (>= 1.3.0)
122
+ railties (= 6.0.5)
123
+ sprockets-rails (>= 2.0.0)
124
+ rails-dom-testing (2.0.3)
125
+ activesupport (>= 4.2.0)
126
+ nokogiri (>= 1.6)
127
+ rails-html-sanitizer (1.4.3)
128
+ loofah (~> 2.3)
129
+ railties (6.0.5)
130
+ actionpack (= 6.0.5)
131
+ activesupport (= 6.0.5)
132
+ method_source
133
+ rake (>= 0.8.7)
134
+ thor (>= 0.20.3, < 2.0)
135
+ rake (13.0.6)
136
+ rbs (2.6.0)
137
+ sprockets (4.1.0)
138
+ concurrent-ruby (~> 1.0)
139
+ rack (> 1, < 3)
140
+ sprockets-rails (3.4.2)
141
+ actionpack (>= 5.2)
142
+ activesupport (>= 5.2)
143
+ sprockets (>= 3.0.0)
144
+ sqlite3 (1.4.4)
145
+ strscan (3.0.3)
146
+ thor (1.2.1)
147
+ thread_safe (0.3.6)
148
+ timeout (0.3.0)
149
+ tzinfo (1.2.9)
150
+ thread_safe (~> 0.1)
151
+ websocket-driver (0.7.5)
152
+ websocket-extensions (>= 0.1.0)
153
+ websocket-extensions (0.1.5)
154
+ zeitwerk (2.6.0)
155
+
156
+ PLATFORMS
157
+ ruby
158
+
159
+ DEPENDENCIES
160
+ net-imap
161
+ net-pop
162
+ net-smtp
163
+ orthoses-rails!
164
+ psych (~> 3)
165
+ rails (>= 6.0, < 6.1)
166
+ sqlite3
167
+
168
+ RUBY VERSION
169
+ ruby 3.1.1p18
170
+
171
+ BUNDLED WITH
172
+ 2.3.9
@@ -0,0 +1,15 @@
1
+ source "https://rubygems.org"
2
+
3
+ ruby "~> 3.1.0"
4
+
5
+ gemspec path: '../../../'
6
+
7
+ gem "rails", ">= 6.1", "< 7"
8
+ gem "sqlite3"
9
+ # gem "orthoses", path: "../../../../orthoses"
10
+
11
+ if RUBY_VERSION >= "3.1"
12
+ gem "net-smtp", require: false
13
+ gem "net-imap", require: false
14
+ gem "net-pop", require: false
15
+ end