rbs_rails 0.4.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/ci.yml +18 -0
  4. data/.gitignore +3 -1
  5. data/.gitmodules +0 -0
  6. data/CHANGELOG.md +13 -0
  7. data/Gemfile +2 -2
  8. data/README.md +24 -43
  9. data/Rakefile +2 -1
  10. data/Steepfile +12 -1
  11. data/bin/add-type-params.rb +2 -1
  12. data/bin/gem_rbs +94 -0
  13. data/bin/postprocess.rb +1 -1
  14. data/bin/rbs +29 -2
  15. data/bin/rbs-prototype-rb.rb +59 -6
  16. data/lib/rbs_rails.rb +4 -0
  17. data/lib/rbs_rails/active_record.rb +74 -46
  18. data/lib/rbs_rails/dependency_builder.rb +43 -0
  19. data/lib/rbs_rails/rake_task.rb +73 -0
  20. data/lib/rbs_rails/util.rb +25 -0
  21. data/lib/rbs_rails/version.rb +1 -1
  22. data/rbs_rails.gemspec +3 -2
  23. data/sig/fileutils.rbs +1 -0
  24. data/sig/rake.rbs +6 -0
  25. data/sig/rbs_rails/active_record.rbs +8 -2
  26. data/sig/rbs_rails/dependency_builder.rbs +9 -0
  27. data/sig/rbs_rails/rake_task.rbs +26 -0
  28. data/sig/rbs_rails/util.rbs +11 -0
  29. metadata +30 -46
  30. data/.travis.yml +0 -11
  31. data/assets/sig/action_controller.rbs +0 -49
  32. data/assets/sig/action_mailer.rbs +0 -8
  33. data/assets/sig/active_record.rbs +0 -137
  34. data/assets/sig/builtin.rbs +0 -7
  35. data/assets/sig/capybara.rbs +0 -14
  36. data/assets/sig/concurrent.rbs +0 -4
  37. data/assets/sig/erb.rbs +0 -4
  38. data/assets/sig/erubi.rbs +0 -4
  39. data/assets/sig/generated/actionpack.rbs +0 -11831
  40. data/assets/sig/generated/actionview.rbs +0 -10591
  41. data/assets/sig/generated/activejob.rbs +0 -1920
  42. data/assets/sig/generated/activemodel.rbs +0 -4214
  43. data/assets/sig/generated/activerecord-meta-programming.rbs +0 -98
  44. data/assets/sig/generated/activerecord.rbs +0 -24602
  45. data/assets/sig/generated/activesupport.rbs +0 -12613
  46. data/assets/sig/generated/railties.rbs +0 -4687
  47. data/assets/sig/i18n.rbs +0 -4
  48. data/assets/sig/libxml.rbs +0 -10
  49. data/assets/sig/minitest.rbs +0 -13
  50. data/assets/sig/nokogiri.rbs +0 -8
  51. data/assets/sig/patches/README.md +0 -4
  52. data/assets/sig/patches/for_actionpack.rbs +0 -74
  53. data/assets/sig/patches/for_actionview.rbs +0 -19
  54. data/assets/sig/patches/for_activemodel.rbs +0 -11
  55. data/assets/sig/patches/for_activerecord.rbs +0 -84
  56. data/assets/sig/patches/for_activesupport.rbs +0 -48
  57. data/assets/sig/patches/for_railties.rbs +0 -30
  58. data/assets/sig/pg.rbs +0 -5
  59. data/assets/sig/que.rbs +0 -4
  60. data/assets/sig/queue_classic.rbs +0 -4
  61. data/assets/sig/racc.rbs +0 -4
  62. data/assets/sig/rack-test.rbs +0 -6
  63. data/assets/sig/rack.rbs +0 -47
  64. data/assets/sig/rails.rbs +0 -14
  65. data/assets/sig/rdoc.rbs +0 -9
  66. data/assets/sig/sidekiq.rbs +0 -4
  67. data/assets/sig/sneakers.rbs +0 -4
  68. data/assets/sig/stdlib.rbs +0 -24
  69. data/assets/sig/sucker_punch.rbs +0 -4
  70. data/assets/sig/thor.rbs +0 -12
  71. data/assets/sig/tzinfo.rbs +0 -4
  72. data/bin/generate_rbs_from_rails_source_code.rb +0 -195
@@ -1,4 +0,0 @@
1
- module I18n
2
- class Config
3
- end
4
- end
@@ -1,10 +0,0 @@
1
- # is it correct?
2
-
3
- module LibXML
4
- end
5
- module LibXML::XML
6
- end
7
- module LibXML::XML::SaxParser
8
- end
9
- module LibXML::XML::SaxParser::Callbacks
10
- end
@@ -1,13 +0,0 @@
1
- module Minitest
2
- class Test
3
- end
4
-
5
- class SummaryReporter
6
- end
7
-
8
- class StatisticsReporter
9
- end
10
-
11
- module Assertions
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- module Nokogiri
2
- end
3
- module Nokogiri::XML
4
- end
5
- module Nokogiri::XML::SAX
6
- end
7
- class Nokogiri::XML::SAX::Document
8
- end
@@ -1,4 +0,0 @@
1
- # patches
2
-
3
- This directory has monkey patches for RBS to make to pass `rbs validate`.
4
- These patches are unnecessary ideally, but we need them for some reasons, such as RBS's bug.
@@ -1,74 +0,0 @@
1
-
2
- module AbstractController
3
- class Base
4
- # alias bug: https://github.com/ruby/rbs/issues/458
5
- def send: (String | Symbol name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
6
-
7
- # bug: rbs prototype rb isn't aware of `class << self` for attr_reader
8
- # https://github.com/rails/rails/blob/fbe2433be6e052a1acac63c7faf287c52ed3c5ba/actionpack/lib/abstract_controller/base.rb#L34-L35
9
- def self.abstract: () -> untyped
10
- end
11
- end
12
-
13
- module ActionController
14
- class Metal
15
- # alias bug?: https://github.com/ruby/rbs/issues/458
16
- def status: -> untyped
17
- end
18
-
19
- class LiveTestResponse < Live::Response
20
- # alias bug?: https://github.com/ruby/rbs/issues/458
21
- def successful?: -> untyped
22
- def not_found?: -> untyped
23
- def server_error?: -> untyped
24
- end
25
- end
26
-
27
- module ActionDispatch
28
- class Response
29
- # alias bug: https://github.com/ruby/rbs/issues/458
30
- attr_accessor cache_control: untyped
31
-
32
- # alias bug: https://github.com/ruby/rbs/issues/458
33
- def location: () -> untyped
34
- end
35
-
36
- class Cookies
37
- class CookieJar
38
- # alias bug: https://github.com/ruby/rbs/issues/458
39
- def to_h: () -> ::Hash[untyped, untyped]
40
- | [T, U] () { (untyped) -> [T, U] } -> ::Hash[T, U]
41
- end
42
- end
43
-
44
- module Journey
45
- module Nodes
46
- class Terminal < Node
47
- # alias bug: https://github.com/ruby/rbs/issues/458
48
- def left: () -> untyped
49
- end
50
- end
51
- end
52
-
53
- module Routing
54
- class Mapper
55
- module Resources
56
- class SingletonResource < Resource
57
- # alias bug: https://github.com/ruby/rbs/issues/458
58
- attr_reader path: untyped
59
- end
60
- end
61
- end
62
-
63
- class OptionRedirect < Redirect
64
- # alias bug: https://github.com/ruby/rbs/issues/458
65
- attr_reader block: untyped
66
- end
67
-
68
- class RouteSet
69
- # alias bug: https://github.com/ruby/rbs/issues/458
70
- def to_s: () -> String
71
- end
72
- end
73
- end
74
-
@@ -1,19 +0,0 @@
1
-
2
- module ActionView
3
- class OutputBuffer < ActiveSupport::SafeBuffer
4
- # alias bug: https://github.com/ruby/rbs/issues/458
5
- def safe_concat: (untyped value) -> untyped
6
- end
7
-
8
- class LookupContext
9
- class DetailsKey
10
- # alias bug: https://github.com/ruby/rbs/issues/458
11
- def equal?: (untyped other) -> bool
12
- end
13
- end
14
-
15
- class Resolver
16
- # Defined with meta-programming
17
- def self.caching: () -> untyped
18
- end
19
- end
@@ -1,11 +0,0 @@
1
- module ActiveModel
2
- module Serialization
3
- # alias bug: https://github.com/ruby/rbs/issues/458
4
- def `send`: (String name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
5
- end
6
-
7
- module Validations
8
- # alias bug: https://github.com/ruby/rbs/issues/458
9
- def `send`: (String name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
10
- end
11
- end
@@ -1,84 +0,0 @@
1
- module ActiveRecord
2
- class Relation
3
- # alias bug: https://github.com/ruby/rbs/issues/458
4
- def lock_value: () -> untyped
5
- end
6
-
7
- module QueryMethods
8
- # It is defined with meta programming
9
- def extending_values: () -> untyped
10
- end
11
-
12
- module ConnectionAdapters
13
- module PostgreSQL
14
- module OID
15
- class Uuid < ActiveModel::Type::Value
16
- # alias bug: https://github.com/ruby/rbs/issues/458
17
- def deserialize: (*untyped) -> untyped
18
- end
19
- end
20
- end
21
- end
22
-
23
- module ConnectionAdapters
24
- class PostgreSQLAdapter < AbstractAdapter
25
- def database_version: (*untyped) -> untyped
26
- end
27
- end
28
-
29
- class Migration
30
- class CommandRecorder
31
- # They are defined with meta programming
32
- def add_reference: (*untyped) -> untyped
33
- def remove_reference: (*untyped) -> untyped
34
- def invert_add_reference: (*untyped) -> untyped
35
- def invert_remove_reference: (*untyped) -> untyped
36
- end
37
- end
38
-
39
- class Result
40
- # alias bug: https://github.com/ruby/rbs/issues/458
41
- def map: [U] () { (untyped arg0) -> U } -> ::Array[U]
42
- | () -> ::Enumerator[untyped, ::Array[untyped]]
43
- end
44
- end
45
-
46
- module Arel
47
- module Nodes
48
- class Quoted < Arel::Nodes::Unary
49
- # alias bug: https://github.com/ruby/rbs/issues/458
50
- def value: () -> untyped
51
- end
52
-
53
- class Equality < Arel::Nodes::Binary
54
- # alias bug: https://github.com/ruby/rbs/issues/458
55
- def left: () -> untyped
56
- # alias bug: https://github.com/ruby/rbs/issues/458
57
- def right: () -> untyped
58
- end
59
-
60
- class TableAlias < Arel::Nodes::Binary
61
- # alias bug: https://github.com/ruby/rbs/issues/458
62
- def left: () -> untyped
63
- # alias bug: https://github.com/ruby/rbs/issues/458
64
- def right: () -> untyped
65
- end
66
-
67
- class UnqualifiedColumn < Arel::Nodes::Unary
68
- # alias bug: https://github.com/ruby/rbs/issues/458
69
- def expr: () -> untyped
70
- # alias bug: https://github.com/ruby/rbs/issues/458
71
- def expr=: (untyped) -> untyped
72
- end
73
-
74
- class ValuesList < Unary
75
- # alias bug: https://github.com/ruby/rbs/issues/458
76
- def expr: () -> untyped
77
- end
78
-
79
- class With < Arel::Nodes::Unary
80
- # alias bug: https://github.com/ruby/rbs/issues/458
81
- def expr: () -> untyped
82
- end
83
- end
84
- end
@@ -1,48 +0,0 @@
1
- class Object
2
- # Object#sum is actually not defined, but rbs prototype rb generates it mistakenly due to `class << Benchmark`.
3
- # So we need to define it to suppress the alias error.
4
- def sum: () -> untyped
5
- end
6
-
7
- class Time
8
- # alias bug: https://github.com/ruby/rbs/issues/458
9
- def xmlschema: (?::Integer fraction_digits) -> ::String
10
- end
11
-
12
- module ActiveSupport
13
- class TestCase < ::Minitest::Test
14
- # alias bug: https://github.com/ruby/rbs/issues/458
15
- def name: () -> untyped
16
- def assert_raises: (*untyped) -> untyped
17
- def refute_empty: (*untyped) -> untyped
18
- def refute_equal: (*untyped) -> untyped
19
- def refute_in_delta: (*untyped) -> untyped
20
- def refute_in_epsilon: (*untyped) -> untyped
21
- def refute_includes: (*untyped) -> untyped
22
- def refute_instance_of: (*untyped) -> untyped
23
- def refute_kind_of: (*untyped) -> untyped
24
- def refute_match: (*untyped) -> untyped
25
- def refute_nil: (*untyped) -> untyped
26
- def refute_operator: (*untyped) -> untyped
27
- def refute_predicate: (*untyped) -> untyped
28
- def refute_respond_to: (*untyped) -> untyped
29
- def refute_same: (*untyped) -> untyped
30
- end
31
-
32
- module Notifications
33
- class Fanout
34
- module Subscribers
35
- class AllMessages
36
- # alias bug: https://github.com/ruby/rbs/issues/458
37
- def ===: (untyped) -> bool
38
- end
39
- end
40
- end
41
- end
42
-
43
- class TimeWithZone
44
- # alias bug: https://github.com/ruby/rbs/issues/458
45
- def <: (untyped) -> bool
46
- def >: (untyped) -> bool
47
- end
48
- end
@@ -1,30 +0,0 @@
1
-
2
- module Rails
3
- class Application < Engine
4
- # alias bug: https://github.com/ruby/rbs/issues/458
5
- def app: () -> untyped
6
- end
7
-
8
- class Engine < Railtie
9
- # bug: rbs prototype rb isn't aware of `class << self` for attr_*
10
- def self.isolated: () -> untyped
11
- def self.isolated=: (untyped) -> untyped
12
-
13
- # alias bug: https://github.com/ruby/rbs/issues/458
14
- def self.railtie_name: (?untyped? name) -> untyped
15
- end
16
-
17
- module Generators
18
- class PluginGenerator < AppBase
19
- # alias bug: https://github.com/ruby/rbs/issues/458
20
- def app_path: () -> untyped
21
- end
22
- end
23
-
24
- module Initializable
25
- class Collection[T] < Array[T]
26
- def each: () -> ::Enumerator[T, self]
27
- | () { (T item) -> void } -> self
28
- end
29
- end
30
- end
@@ -1,5 +0,0 @@
1
- module PG
2
- class Connection
3
- def async_exec: (*untyped) -> untyped
4
- end
5
- end
@@ -1,4 +0,0 @@
1
- module Que
2
- class Job
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- class QC
2
- class Queue
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module Racc
2
- class Parser
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- module Rack
2
- module Test
3
- class UploadedFile
4
- end
5
- end
6
- end
@@ -1,47 +0,0 @@
1
- module Rack
2
- class Server
3
- end
4
-
5
- class Response
6
- module Helpers
7
- def location: () -> untyped
8
- end
9
- end
10
-
11
- class Request
12
- module Helpers
13
- end
14
-
15
- module Env
16
- end
17
- end
18
-
19
- module Session
20
- module Abstract
21
- class SessionHash
22
- end
23
-
24
- class PersistedSecure
25
- class SecureSessionHash
26
- end
27
- end
28
-
29
- class Persisted
30
- end
31
- end
32
-
33
- class SessionId
34
- end
35
-
36
- class Dalli
37
- end
38
- end
39
-
40
- module Cache
41
- class MetaStore
42
- end
43
-
44
- class EntityStore
45
- end
46
- end
47
- end
@@ -1,14 +0,0 @@
1
- module Rails
2
- overload def self.env: () -> ActiveSupport::StringInquirer
3
-
4
- module Dom
5
- module Testing
6
- module Assertions
7
- end
8
- end
9
- end
10
- end
11
-
12
- class Rails::Application
13
- def routes: () -> untyped
14
- end
@@ -1,9 +0,0 @@
1
- module RDoc
2
- module Generator
3
- class SDoc
4
- end
5
- end
6
-
7
- class Task
8
- end
9
- end
@@ -1,4 +0,0 @@
1
- module Sidekiq
2
- module Worker
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module Sneakers
2
- module Worker
3
- end
4
- end
@@ -1,24 +0,0 @@
1
- module DRb
2
- end
3
-
4
- module DRb::DRbUndumped
5
- end
6
-
7
- module TSort
8
- end
9
-
10
- class SimpleDelegator
11
- end
12
-
13
- module Gem
14
- class Version
15
- end
16
- end
17
-
18
- module OpenSSL
19
- class Cipher
20
- end
21
- end
22
-
23
- module FileUtils
24
- end