tapioca 0.4.6 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/README.md +9 -7
  4. data/lib/tapioca/cli.rb +8 -1
  5. data/lib/tapioca/compilers/dsl/action_controller_helpers.rb +38 -39
  6. data/lib/tapioca/compilers/dsl/action_mailer.rb +4 -4
  7. data/lib/tapioca/compilers/dsl/active_record_associations.rb +52 -51
  8. data/lib/tapioca/compilers/dsl/active_record_columns.rb +60 -65
  9. data/lib/tapioca/compilers/dsl/active_record_enum.rb +27 -23
  10. data/lib/tapioca/compilers/dsl/active_record_scope.rb +18 -17
  11. data/lib/tapioca/compilers/dsl/active_record_typed_store.rb +8 -7
  12. data/lib/tapioca/compilers/dsl/active_resource.rb +5 -4
  13. data/lib/tapioca/compilers/dsl/active_support_current_attributes.rb +6 -7
  14. data/lib/tapioca/compilers/dsl/base.rb +14 -10
  15. data/lib/tapioca/compilers/dsl/frozen_record.rb +25 -25
  16. data/lib/tapioca/compilers/dsl/{active_record_identity_cache.rb → identity_cache.rb} +11 -10
  17. data/lib/tapioca/compilers/dsl/protobuf.rb +1 -1
  18. data/lib/tapioca/compilers/dsl/sidekiq_worker.rb +83 -0
  19. data/lib/tapioca/compilers/dsl/smart_properties.rb +1 -1
  20. data/lib/tapioca/compilers/dsl/state_machines.rb +75 -73
  21. data/lib/tapioca/compilers/dsl/url_helpers.rb +9 -5
  22. data/lib/tapioca/compilers/dsl_compiler.rb +5 -5
  23. data/lib/tapioca/compilers/requires_compiler.rb +34 -6
  24. data/lib/tapioca/compilers/sorbet.rb +1 -1
  25. data/lib/tapioca/compilers/symbol_table/symbol_generator.rb +69 -33
  26. data/lib/tapioca/compilers/symbol_table/symbol_loader.rb +1 -1
  27. data/lib/tapioca/compilers/symbol_table_compiler.rb +1 -1
  28. data/lib/tapioca/compilers/todos_compiler.rb +1 -1
  29. data/lib/tapioca/core_ext/class.rb +8 -3
  30. data/lib/tapioca/gemfile.rb +1 -1
  31. data/lib/tapioca/generator.rb +1 -1
  32. data/lib/tapioca/loader.rb +1 -1
  33. data/lib/tapioca/version.rb +1 -1
  34. metadata +4 -3
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: true
2
+ # frozen_string_literal: true
3
3
 
4
4
  require 'json'
5
5
  require 'tempfile'
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: strong
2
+ # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
5
  module Compilers
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: strong
2
+ # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
5
  module Compilers
@@ -1,7 +1,9 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  class Class
5
+ extend T::Sig
6
+
5
7
  # Returns an array with all classes that are < than its receiver.
6
8
  #
7
9
  # class C; end
@@ -15,9 +17,12 @@ class Class
15
17
  #
16
18
  # class D < C; end
17
19
  # C.descendants # => [B, A, D]
20
+ sig { returns(T::Array[Class]) }
18
21
  def descendants
19
- ObjectSpace.each_object(singleton_class).reject do |k|
20
- k.singleton_class? || k == self
22
+ result = ObjectSpace.each_object(singleton_class).reject do |k|
23
+ T.cast(k, Module).singleton_class? || k == self
21
24
  end
25
+
26
+ T.cast(result, T::Array[Class])
22
27
  end
23
28
  end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: strict
2
+ # frozen_string_literal: true
3
3
 
4
4
  require "bundler"
5
5
 
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: strict
2
+ # frozen_string_literal: true
3
3
 
4
4
  require 'pathname'
5
5
  require 'thor'
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
1
  # typed: strict
2
+ # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
5
  class Loader
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.4.6"
5
+ VERSION = "0.4.11"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2020-09-15 00:00:00.000000000 Z
14
+ date: 2021-01-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pry
@@ -116,14 +116,15 @@ files:
116
116
  - lib/tapioca/compilers/dsl/active_record_associations.rb
117
117
  - lib/tapioca/compilers/dsl/active_record_columns.rb
118
118
  - lib/tapioca/compilers/dsl/active_record_enum.rb
119
- - lib/tapioca/compilers/dsl/active_record_identity_cache.rb
120
119
  - lib/tapioca/compilers/dsl/active_record_scope.rb
121
120
  - lib/tapioca/compilers/dsl/active_record_typed_store.rb
122
121
  - lib/tapioca/compilers/dsl/active_resource.rb
123
122
  - lib/tapioca/compilers/dsl/active_support_current_attributes.rb
124
123
  - lib/tapioca/compilers/dsl/base.rb
125
124
  - lib/tapioca/compilers/dsl/frozen_record.rb
125
+ - lib/tapioca/compilers/dsl/identity_cache.rb
126
126
  - lib/tapioca/compilers/dsl/protobuf.rb
127
+ - lib/tapioca/compilers/dsl/sidekiq_worker.rb
127
128
  - lib/tapioca/compilers/dsl/smart_properties.rb
128
129
  - lib/tapioca/compilers/dsl/state_machines.rb
129
130
  - lib/tapioca/compilers/dsl/url_helpers.rb