orthoses-fiddle 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/orthoses/fiddle/importer.rb +7 -5
- data/lib/orthoses/fiddle/version.rb +1 -1
- data/sig/orthoses/fiddle.rbs +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 384b9bee1f9c1a609784df991623095857d98c1d7c7baf8adff24d5cc06de9f0
|
4
|
+
data.tar.gz: 9353ac7c08598443ecd8ae5053e074e8be4f849a01d001467d79383a9a122c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77fb107d95d661f8e207f10cec7ea622f7fae2fe844058d3cb56a2dbae81ef145498c673f60f94be65913c3b81821de46f8125e7c3ef076aac87b6179618de92
|
7
|
+
data.tar.gz: 4509423043ce0055dfca81a9a65bab5962a6b506f526b1c990f6755e5004a600e34e8b674c574783c6ac1f2a4bb8bc26fe10f076c41cde452e9ba32ec7be46ce
|
data/README.md
CHANGED
@@ -21,15 +21,13 @@ end
|
|
21
21
|
|
22
22
|
## Installation
|
23
23
|
|
24
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
25
|
-
|
26
24
|
Install the gem and add to the application's Gemfile by executing:
|
27
25
|
|
28
|
-
$ bundle add
|
26
|
+
$ bundle add orthoses-fiddle
|
29
27
|
|
30
28
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
31
29
|
|
32
|
-
$ gem install
|
30
|
+
$ gem install orthoses-fiddle
|
33
31
|
|
34
32
|
## Usage
|
35
33
|
|
@@ -1,20 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'fiddle/import'
|
4
|
+
|
3
5
|
module Orthoses
|
4
6
|
module Fiddle
|
5
7
|
class Importer
|
8
|
+
include ::Fiddle::Types
|
9
|
+
|
6
10
|
def initialize(loader)
|
7
11
|
@loader = loader
|
8
12
|
end
|
9
13
|
|
10
14
|
def call
|
11
|
-
extern = CallTracer
|
12
|
-
store = extern.trace(
|
15
|
+
extern = CallTracer.new
|
16
|
+
store = extern.trace(::Fiddle::Importer.instance_method(:extern)) do
|
13
17
|
@loader.call
|
14
18
|
end
|
15
19
|
|
16
|
-
self.class.include ::Fiddle::Types
|
17
|
-
|
18
20
|
extern.captures.each do |capture|
|
19
21
|
base_name = Utils.module_name(capture.method.receiver) or next
|
20
22
|
signature = capture.argument[:signature]
|
@@ -45,7 +47,7 @@ module Orthoses
|
|
45
47
|
'String'
|
46
48
|
when VARIADIC
|
47
49
|
unless before
|
48
|
-
|
50
|
+
raise "Found unexpected signature"
|
49
51
|
end
|
50
52
|
"*#{fiddle_to_rbs(before)}"
|
51
53
|
else
|
data/sig/orthoses/fiddle.rbs
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
module Orthoses
|
2
2
|
module Fiddle
|
3
3
|
VERSION: String
|
4
|
-
|
4
|
+
class Importer
|
5
|
+
@loader: Orthoses::_Call
|
6
|
+
def initialize: (Orthoses::_Call loader) -> void
|
7
|
+
def call: () -> Orthoses::store
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def fiddle_to_rbs: (Integer fiddle_type, ?before: Integer?) -> String
|
12
|
+
end
|
5
13
|
end
|
6
14
|
end
|