Skip to content

Commit eb8eb66

Browse files
committed
fuck the four different Method#inspect versions across Ruby and, hooray, DIY!
1 parent 84c454e commit eb8eb66

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

lib/trailblazer/developer/render/task_wrap.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,12 @@ def render_task_wrap_step(id, task, level)
6565
end
6666

6767
def render_method(id, method, level)
68-
name = method.to_s.sub("#<Method: ", "")
69-
puts "@@@@@ #{name.inspect}"
70-
m = name.match(/^(.+?)( |\()/)
71-
72-
name = m[1]
68+
class_name = method.owner.to_s # DISCUSS: we're assuming every Method instance refers to a class.
69+
name = class_name.sub("#<Class:", "").sub(">", "")
7370

7471
name = name.sub("Trailblazer::Activity::DSL::Linear::", "") # DISCUSS: too specific.
7572

76-
name = "Method: #{name}"
73+
name = "Method: #{name}.#{method.original_name}"
7774

7875
return id, name
7976
end

0 commit comments

Comments
 (0)