kurangu 0.0.8 → 0.0.9

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/signature.rb +5 -2
  3. data/lib/trace.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b865407c12e193a82d44ff98340ad395b4cf1fd8
4
- data.tar.gz: dbef6cd12b4b4187e070b1c0951e29836b467fbc
3
+ metadata.gz: 7ec20260877ae23ba6d5a2fa4e57a53dd703746d
4
+ data.tar.gz: 2d9c55264b168bedb566b72265ba7dcd10d1481c
5
5
  SHA512:
6
- metadata.gz: f40a07094d28f21f337183ad5405dcf6172049532cca8949f24cb05d805d173114376d4611688073a39f24af9bfcc0da2b915f1386848f75d49aff1665826995
7
- data.tar.gz: c8b15b45e951120b729bad1163706a448b32ab74eb5137e9e650e42328de72c5c20c4bcd0765b999509062e0467d46cec1d3d8dc790027dd91d50854ce9fa8cc
6
+ metadata.gz: a056fd987348548a9432742d2bf5033d2a98bf8b7832464dc2aa63f6c8ccfa3769d78da0c4142a9b51611a399db91be3cef118cf72385c2f1902f4c165b8959c
7
+ data.tar.gz: e91f82c29a47ceaa43c804c448a7c8501279f2a5943f30560e1d850f900daf88f3347ea7df2b359022a2f6c0fb617c519d656c6ef5286ac11c8cf2970e03f52a
@@ -1,6 +1,8 @@
1
1
  class MethodSignature
2
- def initialize(line, parameters)
2
+ def initialize(line, class_name, method_id, parameters)
3
3
  @line = line
4
+ @class_name = class_name
5
+ @method_id = method_id
4
6
  @parameters = parameters
5
7
  # For each parameter signature (key), store a set of return types (value)
6
8
  @signatures = Hash.new { | h, k | h[k] = Set.new }
@@ -19,7 +21,8 @@ class MethodSignature
19
21
 
20
22
  def to_s
21
23
  signatures = @signatures.to_a.map { |a|
22
- "#{@line} type '(#{a[0]}) -> #{a[1].to_a.join(" or ")}'"
24
+ prefix = "#{@class_name}, :#{@method_id}"
25
+ "#{@line} type #{prefix}, '(#{a[0]}) -> #{a[1].to_a.join(" or ")}'"
23
26
  }
24
27
  signatures.join("\n")
25
28
  end
@@ -24,7 +24,7 @@ trace_return = TracePoint.new(:return) do |t|
24
24
  line = t.self.method(t.method_id).source_location[1]
25
25
  if !signatures.key?(s)
26
26
  parameters = t.self.method(t.method_id).parameters
27
- signatures[s] = MethodSignature.new(line, parameters)
27
+ signatures[s] = MethodSignature.new(line, t.defined_class, t.method_id, parameters)
28
28
  end
29
29
  signatures[s].add(args, t.return_value.class, t.self)
30
30
  path = "#{t.path}.annotations"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kurangu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arpith Siromoney