orthoses-rails 0.8.0 → 1.0.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -65
  3. data/lib/generators/orthoses/rails/install_generator.rb +18 -0
  4. data/lib/orthoses/active_record/belongs_to.rb +15 -4
  5. data/lib/orthoses/active_record/enum.rb +5 -0
  6. data/lib/orthoses/active_record/generated_attribute_methods.rb +47 -55
  7. data/lib/orthoses/active_record/has_many.rb +15 -4
  8. data/lib/orthoses/active_record/has_one.rb +12 -2
  9. data/lib/orthoses/active_record/relation.rb +56 -0
  10. data/lib/orthoses/active_record.rb +36 -0
  11. data/lib/orthoses/active_support/delegation.rb +20 -9
  12. data/lib/orthoses/active_support/time_with_zone.rb +35 -28
  13. data/lib/orthoses/rails/application.rb +33 -0
  14. data/lib/orthoses/rails/version.rb +1 -1
  15. data/lib/orthoses/rails.rb +3 -2
  16. metadata +10 -47
  17. data/examples/rails/Gemfile +0 -16
  18. data/examples/rails/Gemfile.lock +0 -179
  19. data/examples/rails/Rakefile +0 -328
  20. data/examples/rails/config/database.yml +0 -8
  21. data/examples/rails/config/storage.yml +0 -3
  22. data/examples/rails/known_sig/actionpack/7.0/action_controller/metal.rbs +0 -4
  23. data/examples/rails/known_sig/activemodel/7.0/active_model/serialization.rbs +0 -4
  24. data/examples/rails/known_sig/activemodel/7.0/active_model/validations.rbs +0 -4
  25. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation.rbs +0 -49
  26. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation_class_methods.rbs +0 -45
  27. data/examples/rails/known_sig/activerecord/6.0/active_record/result.rbs +0 -5
  28. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation.rbs +0 -49
  29. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation_class_methods.rbs +0 -45
  30. data/examples/rails/known_sig/activerecord/6.1/active_record/result.rbs +0 -5
  31. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation.rbs +0 -49
  32. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation_class_methods.rbs +0 -45
  33. data/examples/rails/known_sig/activerecord/7.0/active_record/encryption/context.rbs +0 -9
  34. data/examples/rails/known_sig/activerecord/7.0/active_record/result.rbs +0 -5
  35. data/examples/rails/known_sig/activesupport/7.0/active_support/callbacks/callback_chain.rbs +0 -9
  36. data/examples/rails/known_sig/activesupport/7.0/active_support/duration.rbs +0 -4
  37. data/examples/rails/known_sig/activesupport/7.0/active_support/hash_with_indifferent_access.rbs +0 -6
  38. data/examples/rails/known_sig/activesupport/7.0/active_support/multibyte/chars.rbs +0 -7
  39. data/examples/rails/known_sig/activesupport/7.0/active_support/time_with_zone.rbs +0 -5
  40. data/examples/rails/known_sig/activesupport/7.0/active_support/time_zone.rbs +0 -3
  41. data/examples/rails/known_sig/activesupport/7.0/date.rbs +0 -6
  42. data/examples/rails/known_sig/activesupport/7.0/date_and_time/zones.rbs +0 -4
  43. data/examples/rails/known_sig/activesupport/7.0/hash_with_indifferent_access.rbs +0 -2
  44. data/examples/rails/known_sig/activesupport/7.0/integer.rbs +0 -9
  45. data/examples/rails/known_sig/activesupport/7.0/numeric.rbs +0 -15
  46. data/examples/rails/known_sig/activesupport/7.0/string.rbs +0 -4
  47. data/examples/rails/known_sig/activesupport/7.0/time.rbs +0 -46
  48. data/examples/rails/tasks/action_pack.rake +0 -141
  49. data/examples/rails/tasks/action_view.rake +0 -77
  50. data/examples/rails/tasks/active_job.rake +0 -99
  51. data/examples/rails/tasks/active_model.rake +0 -46
  52. data/examples/rails/tasks/active_record.rake +0 -88
  53. data/examples/rails/tasks/active_storage.rake +0 -94
  54. data/examples/rails/tasks/active_support.rake +0 -99
  55. data/examples/rails/tasks/railties.rake +0 -34
  56. data/orthoses-rails.gemspec +0 -36
@@ -1,3 +0,0 @@
1
- local:
2
- service: Disk
3
- root: <%= Rails.root.join("storage") %>
@@ -1,4 +0,0 @@
1
- module ActionController
2
- class Metal < AbstractController::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ActiveModel::Serialization
2
- # https://github.com/ruby/rbs/issues/1008
3
- def send: (Object::name name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
4
- end
@@ -1,4 +0,0 @@
1
- module ActiveModel::Validations
2
- # https://github.com/ruby/rbs/issues/1008
3
- def send: (Object::name name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
4
- end
@@ -1,49 +0,0 @@
1
- interface _ActiveRecord_Relation[Model, PrimaryKey]
2
- def all: () -> self
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> self
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> self
8
- def not: (*untyped) -> self
9
- def exists?: (*untyped) -> bool
10
- def order: (*untyped) -> self
11
- def group: (*Symbol | String) -> untyped
12
- def distinct: () -> self
13
- def or: (self) -> self
14
- def merge: (self) -> self
15
- def joins: (*String | Symbol) -> self
16
- | (Hash[untyped, untyped]) -> self
17
- def left_joins: (*String | Symbol) -> self
18
- | (Hash[untyped, untyped]) -> self
19
- def left_outer_joins: (*String | Symbol) -> self
20
- | (Hash[untyped, untyped]) -> self
21
- def includes: (*String | Symbol) -> self
22
- | (Hash[untyped, untyped]) -> self
23
- def eager_load: (*String | Symbol) -> self
24
- | (Hash[untyped, untyped]) -> self
25
- def preload: (*String | Symbol) -> self
26
- | (Hash[untyped, untyped]) -> self
27
- def find_by: (*untyped) -> Model?
28
- def find_by!: (*untyped) -> Model
29
- def find: (PrimaryKey id) -> Model
30
- | (Array[PrimaryKey]) -> Array[Model]
31
- | (*PrimaryKey) -> Array[Model]
32
- | () { (Model) -> boolish } -> Model?
33
- def first: () -> Model?
34
- | (Integer count) -> Array[Model]
35
- def first!: () -> Model
36
- def last: () -> Model?
37
- | (Integer count) -> Array[Model]
38
- def last!: () -> Model
39
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
40
- def limit!: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
41
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
42
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
43
- def destroy_all: () -> untyped
44
- def delete_all: () -> untyped
45
- def update_all: (*untyped) -> untyped
46
- def each: () { (Model) -> void } -> self
47
- def select: (*Symbol | String) -> self
48
- | () { (Model) -> boolish } -> Array[Model]
49
- end
@@ -1,45 +0,0 @@
1
- interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
2
- def all: () -> Relation
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> Relation
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> Relation
8
- def exists?: (*untyped) -> bool
9
- def order: (*untyped) -> Relation
10
- def group: (*Symbol | String) -> untyped
11
- def distinct: () -> self
12
- def or: (Relation) -> Relation
13
- def merge: (Relation) -> Relation
14
- def joins: (*String | Symbol) -> self
15
- | (Hash[untyped, untyped]) -> self
16
- def left_joins: (*String | Symbol) -> self
17
- | (Hash[untyped, untyped]) -> self
18
- def left_outer_joins: (*String | Symbol) -> self
19
- | (Hash[untyped, untyped]) -> self
20
- def includes: (*String | Symbol) -> self
21
- | (Hash[untyped, untyped]) -> self
22
- def eager_load: (*String | Symbol) -> self
23
- | (Hash[untyped, untyped]) -> self
24
- def preload: (*String | Symbol) -> self
25
- | (Hash[untyped, untyped]) -> self
26
- def find_by: (*untyped) -> Model?
27
- def find_by!: (*untyped) -> Model
28
- def find: (PrimaryKey id) -> Model
29
- | (Array[PrimaryKey]) -> Array[Model]
30
- | (*PrimaryKey) -> Array[Model]
31
- def first: () -> Model?
32
- | (Integer count) -> Array[Model]
33
- def first!: () -> Model
34
- def last: () -> Model?
35
- | (Integer count) -> Array[Model]
36
- def last!: () -> Model
37
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> Relation
38
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
39
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
40
- def destroy_all: () -> untyped
41
- def delete_all: () -> untyped
42
- def update_all: (*untyped) -> untyped
43
- def select: (*Symbol | String) -> Relation
44
- | () { (Model) -> boolish } -> Array[Model]
45
- end
@@ -1,5 +0,0 @@
1
- class ActiveRecord::Result
2
- include Enumerable[Hash[String, untyped]]
3
- def each: () -> Enumerator[Hash[String, untyped], Array[Hash[String, untyped]]]
4
- | () { (Hash[String, untyped]) -> void } -> Array[Hash[String, untyped]]
5
- end
@@ -1,49 +0,0 @@
1
- interface _ActiveRecord_Relation[Model, PrimaryKey]
2
- def all: () -> self
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> self
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> self
8
- def not: (*untyped) -> self
9
- def exists?: (*untyped) -> bool
10
- def order: (*untyped) -> self
11
- def group: (*Symbol | String) -> untyped
12
- def distinct: () -> self
13
- def or: (self) -> self
14
- def merge: (self) -> self
15
- def joins: (*String | Symbol) -> self
16
- | (Hash[untyped, untyped]) -> self
17
- def left_joins: (*String | Symbol) -> self
18
- | (Hash[untyped, untyped]) -> self
19
- def left_outer_joins: (*String | Symbol) -> self
20
- | (Hash[untyped, untyped]) -> self
21
- def includes: (*String | Symbol) -> self
22
- | (Hash[untyped, untyped]) -> self
23
- def eager_load: (*String | Symbol) -> self
24
- | (Hash[untyped, untyped]) -> self
25
- def preload: (*String | Symbol) -> self
26
- | (Hash[untyped, untyped]) -> self
27
- def find_by: (*untyped) -> Model?
28
- def find_by!: (*untyped) -> Model
29
- def find: (PrimaryKey id) -> Model
30
- | (Array[PrimaryKey]) -> Array[Model]
31
- | (*PrimaryKey) -> Array[Model]
32
- | () { (Model) -> boolish } -> Model?
33
- def first: () -> Model?
34
- | (Integer count) -> Array[Model]
35
- def first!: () -> Model
36
- def last: () -> Model?
37
- | (Integer count) -> Array[Model]
38
- def last!: () -> Model
39
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
40
- def limit!: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
41
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
42
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
43
- def destroy_all: () -> untyped
44
- def delete_all: () -> untyped
45
- def update_all: (*untyped) -> untyped
46
- def each: () { (Model) -> void } -> self
47
- def select: (*Symbol | String) -> self
48
- | () { (Model) -> boolish } -> Array[Model]
49
- end
@@ -1,45 +0,0 @@
1
- interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
2
- def all: () -> Relation
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> Relation
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> Relation
8
- def exists?: (*untyped) -> bool
9
- def order: (*untyped) -> Relation
10
- def group: (*Symbol | String) -> untyped
11
- def distinct: () -> self
12
- def or: (Relation) -> Relation
13
- def merge: (Relation) -> Relation
14
- def joins: (*String | Symbol) -> self
15
- | (Hash[untyped, untyped]) -> self
16
- def left_joins: (*String | Symbol) -> self
17
- | (Hash[untyped, untyped]) -> self
18
- def left_outer_joins: (*String | Symbol) -> self
19
- | (Hash[untyped, untyped]) -> self
20
- def includes: (*String | Symbol) -> self
21
- | (Hash[untyped, untyped]) -> self
22
- def eager_load: (*String | Symbol) -> self
23
- | (Hash[untyped, untyped]) -> self
24
- def preload: (*String | Symbol) -> self
25
- | (Hash[untyped, untyped]) -> self
26
- def find_by: (*untyped) -> Model?
27
- def find_by!: (*untyped) -> Model
28
- def find: (PrimaryKey id) -> Model
29
- | (Array[PrimaryKey]) -> Array[Model]
30
- | (*PrimaryKey) -> Array[Model]
31
- def first: () -> Model?
32
- | (Integer count) -> Array[Model]
33
- def first!: () -> Model
34
- def last: () -> Model?
35
- | (Integer count) -> Array[Model]
36
- def last!: () -> Model
37
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> Relation
38
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
39
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
40
- def destroy_all: () -> untyped
41
- def delete_all: () -> untyped
42
- def update_all: (*untyped) -> untyped
43
- def select: (*Symbol | String) -> Relation
44
- | () { (Model) -> boolish } -> Array[Model]
45
- end
@@ -1,5 +0,0 @@
1
- class ActiveRecord::Result
2
- include Enumerable[Hash[String, untyped]]
3
- def each: () -> Enumerator[Hash[String, untyped], Array[Hash[String, untyped]]]
4
- | () { (Hash[String, untyped]) -> void } -> Array[Hash[String, untyped]]
5
- end
@@ -1,49 +0,0 @@
1
- interface _ActiveRecord_Relation[Model, PrimaryKey]
2
- def all: () -> self
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> self
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> self
8
- def not: (*untyped) -> self
9
- def exists?: (*untyped) -> bool
10
- def order: (*untyped) -> self
11
- def group: (*Symbol | String) -> untyped
12
- def distinct: () -> self
13
- def or: (self) -> self
14
- def merge: (self) -> self
15
- def joins: (*String | Symbol) -> self
16
- | (Hash[untyped, untyped]) -> self
17
- def left_joins: (*String | Symbol) -> self
18
- | (Hash[untyped, untyped]) -> self
19
- def left_outer_joins: (*String | Symbol) -> self
20
- | (Hash[untyped, untyped]) -> self
21
- def includes: (*String | Symbol) -> self
22
- | (Hash[untyped, untyped]) -> self
23
- def eager_load: (*String | Symbol) -> self
24
- | (Hash[untyped, untyped]) -> self
25
- def preload: (*String | Symbol) -> self
26
- | (Hash[untyped, untyped]) -> self
27
- def find_by: (*untyped) -> Model?
28
- def find_by!: (*untyped) -> Model
29
- def find: (PrimaryKey id) -> Model
30
- | (Array[PrimaryKey]) -> Array[Model]
31
- | (*PrimaryKey) -> Array[Model]
32
- | () { (Model) -> boolish } -> Model?
33
- def first: () -> Model?
34
- | (Integer count) -> Array[Model]
35
- def first!: () -> Model
36
- def last: () -> Model?
37
- | (Integer count) -> Array[Model]
38
- def last!: () -> Model
39
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
40
- def limit!: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
41
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
42
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
43
- def destroy_all: () -> untyped
44
- def delete_all: () -> untyped
45
- def update_all: (*untyped) -> untyped
46
- def each: () { (Model) -> void } -> self
47
- def select: (*Symbol | String) -> self
48
- | () { (Model) -> boolish } -> Array[Model]
49
- end
@@ -1,45 +0,0 @@
1
- interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
2
- def all: () -> Relation
3
- def ids: () -> Array[PrimaryKey]
4
- def none: () -> Relation
5
- def pluck: (Symbol | String column) -> Array[untyped]
6
- | (*Symbol | String columns) -> Array[Array[untyped]]
7
- def where: (*untyped) -> Relation
8
- def exists?: (*untyped) -> bool
9
- def order: (*untyped) -> Relation
10
- def group: (*Symbol | String) -> untyped
11
- def distinct: () -> self
12
- def or: (Relation) -> Relation
13
- def merge: (Relation) -> Relation
14
- def joins: (*String | Symbol) -> self
15
- | (Hash[untyped, untyped]) -> self
16
- def left_joins: (*String | Symbol) -> self
17
- | (Hash[untyped, untyped]) -> self
18
- def left_outer_joins: (*String | Symbol) -> self
19
- | (Hash[untyped, untyped]) -> self
20
- def includes: (*String | Symbol) -> self
21
- | (Hash[untyped, untyped]) -> self
22
- def eager_load: (*String | Symbol) -> self
23
- | (Hash[untyped, untyped]) -> self
24
- def preload: (*String | Symbol) -> self
25
- | (Hash[untyped, untyped]) -> self
26
- def find_by: (*untyped) -> Model?
27
- def find_by!: (*untyped) -> Model
28
- def find: (PrimaryKey id) -> Model
29
- | (Array[PrimaryKey]) -> Array[Model]
30
- | (*PrimaryKey) -> Array[Model]
31
- def first: () -> Model?
32
- | (Integer count) -> Array[Model]
33
- def first!: () -> Model
34
- def last: () -> Model?
35
- | (Integer count) -> Array[Model]
36
- def last!: () -> Model
37
- def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> Relation
38
- def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
39
- def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (self) -> void } -> nil
40
- def destroy_all: () -> untyped
41
- def delete_all: () -> untyped
42
- def update_all: (*untyped) -> untyped
43
- def select: (*Symbol | String) -> Relation
44
- | () { (Model) -> boolish } -> Array[Model]
45
- end
@@ -1,9 +0,0 @@
1
- # attr_accessor in #each
2
- class ActiveRecord::Encryption::Context
3
- attr_accessor key_provider: untyped
4
- attr_accessor key_generator: untyped
5
- attr_accessor cipher: untyped
6
- attr_accessor message_serializer: untyped
7
- attr_accessor encryptor: untyped
8
- attr_accessor frozen_encryption: untyped
9
- end
@@ -1,5 +0,0 @@
1
- class ActiveRecord::Result
2
- include Enumerable[Hash[String, untyped]]
3
- def each: () -> Enumerator[Hash[String, untyped], Array[Hash[String, untyped]]]
4
- | () { (Hash[String, untyped]) -> void } -> Array[Hash[String, untyped]]
5
- end
@@ -1,9 +0,0 @@
1
- module ActiveSupport
2
- module Callbacks
3
- class CallbackChain
4
- include Enumerable[::ActiveSupport::Callbacks::Callback]
5
- def each: () -> Enumerator[::ActiveSupport::Callbacks::Callback, Array[::ActiveSupport::Callbacks::Callback]]
6
- | () { (::ActiveSupport::Callbacks::Callback) -> void } -> Array[::ActiveSupport::Callbacks::Callback]
7
- end
8
- end
9
- end
@@ -1,4 +0,0 @@
1
- class ActiveSupport::Duration
2
- def since: (?untyped time) -> ::ActiveSupport::TimeWithZone
3
- def ago: (?untyped time) -> ::ActiveSupport::TimeWithZone
4
- end
@@ -1,6 +0,0 @@
1
- module ActiveSupport
2
- class HashWithIndifferentAccess[K, V] < ::Hash[K, V]
3
- def []=: (K key, V value) -> untyped
4
- def []: (K key) -> V
5
- end
6
- end
@@ -1,7 +0,0 @@
1
- module ActiveSupport
2
- module Multibyte
3
- class Chars
4
- attr_reader wrapped_string: ::String
5
- end
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- class ActiveSupport::TimeWithZone
2
- def +: (ActiveSupport::Duration other) -> self
3
- def -: (self other) -> Float
4
- | (ActiveSupport::Duration other) -> self
5
- end
@@ -1,3 +0,0 @@
1
- class ActiveSupport::TimeZone
2
- def now: () -> ActiveSupport::TimeWithZone
3
- end
@@ -1,6 +0,0 @@
1
- class Date
2
- def +: (ActiveSupport::Duration other) -> self
3
- | ...
4
- def -: (ActiveSupport::Duration other) -> self
5
- | ...
6
- end
@@ -1,4 +0,0 @@
1
- module DateAndTime::Zones
2
- def in_time_zone: (?(ActiveSupport::TimeZone | String) zone) -> ::ActiveSupport::TimeWithZone
3
- | (false? zone) -> ::Time
4
- end
@@ -1,2 +0,0 @@
1
- class HashWithIndifferentAccess[K, V] < ActiveSupport::HashWithIndifferentAccess[K, V]
2
- end
@@ -1,9 +0,0 @@
1
- class Integer < ::Numeric
2
- # 2.months # => 2 months
3
- def months: () -> ActiveSupport::Duration
4
-
5
- # Returns a Duration instance matching the number of years provided.
6
- #
7
- # 2.years # => 2 years
8
- def years: () -> ActiveSupport::Duration
9
- end
@@ -1,15 +0,0 @@
1
- class Numeric
2
- def kilobytes: () -> self
3
- def megabytes: () -> self
4
- def gigabytes: () -> self
5
- def terabytes: () -> self
6
- def petabytes: () -> self
7
- def exabytes: () -> self
8
- def seconds: () -> ActiveSupport::Duration
9
- def minutes: () -> ActiveSupport::Duration
10
- def hours: () -> ActiveSupport::Duration
11
- def days: () -> ActiveSupport::Duration
12
- def weeks: () -> ActiveSupport::Duration
13
- def fortnights: () -> ActiveSupport::Duration
14
- def in_milliseconds: () -> self
15
- end
@@ -1,4 +0,0 @@
1
- class String
2
- def in_time_zone: (?(ActiveSupport::TimeZone | String) zone) -> ::ActiveSupport::TimeWithZone
3
- | (false? zone) -> ::Time
4
- end
@@ -1,46 +0,0 @@
1
- class Time
2
- # Returns <tt>Time.zone.now</tt> when <tt>Time.zone</tt> or <tt>config.time_zone</tt> are set, otherwise just returns <tt>Time.now</tt>.
3
- def self.current: () -> ActiveSupport::TimeWithZone # strictly `(ActiveSupport::TimeWithZone | Time)` but it's inconvenient
4
- def self.zone: () -> ActiveSupport::TimeZone # strictly `ActiveSupport::TimeWithZone?` but it's inconvenient
5
-
6
- def ago: (untyped other) -> self
7
- def advance: (untyped options) -> self
8
- def change: (untyped options) -> self
9
- def in_time_zone: (?(ActiveSupport::TimeZone | String) new_zone) -> ::ActiveSupport::TimeWithZone
10
- | (false? zone) -> ::Time
11
- def +: (ActiveSupport::Duration other) -> self
12
- | ...
13
- def -: (ActiveSupport::Duration other) -> self
14
- | ...
15
- def beginning_of_day: () -> self
16
- def beginning_of_hour: () -> self
17
- def beginning_of_minute: () -> self
18
- def compare_with_coercion: (untyped other) -> (-1 | 0 | 1 | nil)
19
- def compare_without_coercion: (untyped other) -> (-1 | 0 | 1 | nil)
20
- def end_of_day: () -> self
21
- def end_of_hour: () -> self
22
- def end_of_minute: () -> self
23
- def eql_with_coercion: (untyped other) -> bool
24
- def eql_without_coercion: (untyped other) -> bool
25
- def middle_of_day: () -> self
26
- def minus_with_coercion: (Time | self arg0) -> Float
27
- | (Numeric arg0) -> self
28
- def minus_with_duration: (Time | self arg0) -> Float
29
- | (Numeric arg0) -> self
30
- def minus_without_coercion: (Time | self arg0) -> Float
31
- | (Numeric arg0) -> self
32
- def minus_without_duration: (Time | self arg0) -> Float
33
- | (Numeric arg0) -> self
34
- def next_day: () -> self
35
- def next_month: () -> self
36
- def next_year: () -> self
37
- def plus_without_duration: (Time | self arg0) -> Float
38
- | (Numeric arg0) -> self
39
- def prev_day: () -> self
40
- def prev_month: () -> self
41
- def prev_year: () -> self
42
- def seconds_since_midnight: () -> Float
43
- def seconds_until_end_of_day: () -> Integer
44
- def sec_fraction: () -> (Integer | Rational)
45
- def to_default_s: () -> String
46
- end
@@ -1,141 +0,0 @@
1
- stdlib_dependencies = %w[benchmark date digest json logger monitor mutex_m pathname singleton time minitest securerandom ipaddr did_you_mean]
2
- gem_dependencies = %w[nokogiri i18n rack rails-dom-testing]
3
- rails_dependencies = %w[activesupport actionview]
4
-
5
- VERSIONS.each do |version|
6
- namespace version do
7
- namespace :action_pack do
8
- export = "export/actionpack/#{version}"
9
-
10
- desc "export to #{export}"
11
- task :export do
12
- sh "rm -fr #{export}"
13
- sh "mkdir -p #{export}"
14
-
15
- sh "cp -a out/#{version}/action_pack.rbs #{export}"
16
- sh "cp -a out/#{version}/action_pack #{export}"
17
- sh "cp -a out/#{version}/action_controller.rbs #{export}"
18
- sh "cp -a out/#{version}/action_controller #{export}"
19
- sh "cp -a out/#{version}/action_dispatch.rbs #{export}"
20
- sh "cp -a out/#{version}/action_dispatch #{export}"
21
- sh "cp -a out/#{version}/abstract_controller.rbs #{export}"
22
- sh "cp -a out/#{version}/abstract_controller #{export}"
23
- sh "cp -a out/#{version}/mime.rbs #{export}"
24
- sh "cp -a out/#{version}/mime #{export}"
25
-
26
- sh "rm #{export}/action_controller/railtie.rbs"
27
- sh "rm #{export}/action_dispatch/railtie.rbs"
28
-
29
- Pathname(export).join("EXTERNAL_TODO.rbs").write(<<~RBS)
30
- # !!! GENERATED CODE !!!
31
- # Please see generators/rails-generator
32
-
33
- class Ripper
34
- end
35
-
36
- class Delegator
37
- end
38
-
39
- class SimpleDelegator < ::Delegator
40
- end
41
-
42
- class ActionDispatch::Cookies::CookieJar
43
- def to_h: () -> Hash[untyped, untyped]
44
- end
45
-
46
- module Rack
47
- module Cache
48
- class EntityStore
49
- end
50
- class MetaStore
51
- end
52
- end
53
- module Session
54
- class Dalli
55
- end
56
- end
57
- module Test
58
- class UploadedFile
59
- end
60
- end
61
- end
62
-
63
- module Rails
64
- module Dom
65
- module Testing
66
- module Assertions
67
- include Rails::Dom::Testing::Assertions::SelectorAssertions
68
-
69
- include Rails::Dom::Testing::Assertions::DomAssertions
70
-
71
- extend ActiveSupport::Concern
72
-
73
- module DomAssertions
74
- public
75
-
76
- def assert_dom_equal: (untyped expected, untyped actual, ?untyped message) -> untyped
77
-
78
- def assert_dom_not_equal: (untyped expected, untyped actual, ?untyped message) -> untyped
79
-
80
- private
81
-
82
- def fragment: (untyped text) -> untyped
83
- end
84
-
85
- module SelectorAssertions
86
- include Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
87
-
88
- public
89
-
90
- def assert_select: (*untyped args) { (*untyped) -> untyped } -> untyped
91
-
92
- def assert_select_email: () { (*untyped) -> untyped } -> untyped
93
-
94
- def assert_select_encoded: (?untyped element) { (*untyped) -> untyped } -> untyped
95
-
96
- def css_select: (*untyped args) -> untyped
97
-
98
- private
99
-
100
- def assert_size_match!: (untyped size, untyped equals, untyped css_selector, ?untyped message) -> untyped
101
-
102
- def document_root_element: () -> untyped
103
-
104
- def nest_selection: (untyped selection) { (untyped) -> untyped } -> untyped
105
-
106
- def nodeset: (untyped node) -> untyped
107
-
108
- module CountDescribable
109
- extend ActiveSupport::Concern
110
-
111
- private
112
-
113
- def count_description: (untyped min, untyped max, untyped count) -> untyped
114
-
115
- def pluralize_element: (untyped quantity) -> untyped
116
- end
117
- end
118
- end
119
- end
120
- end
121
- end
122
- RBS
123
- end
124
-
125
- desc "validate version=#{version} gem=action_pack"
126
- task :validate do
127
- stdlib_opt = stdlib_dependencies.map{"-r #{_1}"}.join(" ")
128
- gem_opt = gem_dependencies.map{"-I ../../.gem_rbs_collection/#{_1}"}.join(" ")
129
- rails_opt = rails_dependencies.map{"-I export/#{_1}/#{version}"}.join(" ")
130
- sh "rbs #{stdlib_opt} #{gem_opt} #{rails_opt} -I #{export} validate --silent"
131
- end
132
-
133
- desc "install to ../../../gems/actionpack/#{version}"
134
- task :install do
135
- install_to = File.expand_path("../../../gems/actionpack/#{version}", __dir__)
136
- sh "rm -fr #{install_to}"
137
- sh "cp -a #{export} #{install_to}"
138
- end
139
- end
140
- end
141
- end