orthoses-rails 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70f9def2ba0ccd5b1537ee8aa3ee68c2700e99d0f134d313069939cc1db3277d
4
- data.tar.gz: 922e2e304b3aa7f5cd34cb215ea3656c6a4c79c34875b7fd7ed691743230ea10
3
+ metadata.gz: a43ce53af9e7aec6ef02751c5649146d817e76770a9b15bb2fb5a24fa1b0447b
4
+ data.tar.gz: 83c78756ff7794059a1001902f887509d8be7b42f116a2ce30b1cdb27d75ff6a
5
5
  SHA512:
6
- metadata.gz: 42f23b91ba796e225541f7da52cc74916a53ef584f1711d95457b0cc239441146678c4ebbb5a271a52710d928f55edba2d5032bec56a4fe9f9b0e47bf7e44c6a
7
- data.tar.gz: 1f9c63c9d2b9b8f11d820a27ef660d61cb727d3a3b3b644afa93fb3b7bdb48dbd150ca7ab96f636d02fb330e2de27c902862e04b89a514f20d5e3d51d5172dc8
6
+ metadata.gz: bce1abdf1faf93222005ba51aa4c74675fc98edef98a546faecd52280bf03ce11dc896379ab7269c3c7bda3be43eddae81cf01ab6fc701e8a2e96d4f841dd7b8
7
+ data.tar.gz: be065396c52d757e110c2668e5eb90ada5f58275376bc93f0e9e4d25be4968735bccae5ace6d2ad7e08c8642b75b1ff5f5bd63b93c4019faba66101f1de34757
@@ -117,11 +117,11 @@ module Orthoses
117
117
  if argument
118
118
  return [:multi, member.types]
119
119
  else
120
- type = member.types.find do |method_type|
120
+ method_type = member.overloads.map(&:method_type).find do |method_type|
121
121
  method_type.type.required_positionals.empty? && method_type.type.required_keywords.empty?
122
122
  end
123
- next unless type
124
- return [:single, type.type.return_type]
123
+ next unless method_type
124
+ return [:single, method_type.type.return_type]
125
125
  end
126
126
  when RBS::AST::Members::Var
127
127
  next unless member.name == name
@@ -35,19 +35,25 @@ module Orthoses
35
35
  -
36
36
  ])
37
37
 
38
+ def add_signature(env, content)
39
+ buffer, directives, decls = RBS::Parser.parse_signature(content.to_rbs)
40
+ env.add_signature(buffer: buffer, directives: directives, decls: decls)
41
+ end
42
+
38
43
  def each_line_from_core_time_definition(store)
39
44
  type_name_time = TypeName("::Time")
40
45
  type_name_time_with_zone = TypeName("::ActiveSupport::TimeWithZone")
41
46
  env = Utils.rbs_environment(collection: true, cache: false)
42
- env << store["Time"].to_decl
43
- env << store["DateAndTime"].to_decl
44
- env << store["DateAndTime::Zones"].to_decl
45
- env << store["DateAndTime::Calculations"].to_decl
46
- env << store["DateAndTime::Compatibility"].to_decl
47
- env << store["ActiveSupport"].to_decl
48
- env << store["ActiveSupport::TimeZone"].to_decl
49
- env << store["ActiveSupport::Duration"].to_decl
50
- env << store["ActiveSupport::TimeWithZone"].to_decl
47
+
48
+ add_signature(env, store["Time"])
49
+ add_signature(env, store["DateAndTime"])
50
+ add_signature(env, store["DateAndTime::Zones"])
51
+ add_signature(env, store["DateAndTime::Calculations"])
52
+ add_signature(env, store["DateAndTime::Compatibility"])
53
+ add_signature(env, store["ActiveSupport"])
54
+ add_signature(env, store["ActiveSupport::TimeZone"])
55
+ add_signature(env, store["ActiveSupport::Duration"])
56
+ add_signature(env, store["ActiveSupport::TimeWithZone"])
51
57
 
52
58
  builder = RBS::DefinitionBuilder.new(env: env.resolve_type_names)
53
59
  one_ancestors = builder.ancestor_builder.one_instance_ancestors(type_name_time)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Orthoses
4
4
  module Rails
5
- VERSION = "0.8.0"
5
+ VERSION = "0.9.0"
6
6
  end
7
7
  end
@@ -32,5 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_dependency "orthoses", "~> 1.0"
35
+ spec.add_dependency "orthoses", ">= 1.6"
36
36
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orthoses-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2023-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orthoses
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '1.6'
27
27
  description: Orthoses middleware collection for Ruby on Rails
28
28
  email:
29
29
  - co000ri@gmail.com
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.3.16
123
+ rubygems_version: 3.4.6
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Orthoses middleware collection for Ruby on Rails