mtrace 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/example.rb +1 -0
  3. data/lib/mtrace.rb +3 -1
  4. data/screenshot.png +0 -0
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/example.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'mtrace'
1
2
  def fib(n)
2
3
  return n if n == 0 or n == 1
3
4
  fib(n-1) + fib(n-2) if n > 1
@@ -2,7 +2,9 @@ mtrace_indent = 0
2
2
  set_trace_func lambda {|event, file, line, id, binding, klass|
3
3
  case event
4
4
  when 'call'
5
- puts "\e[90m| " * mtrace_indent + "\e[35m#{klass}\e[90m#\e[36m#{id} \e[90m#{file}:#{line}\e[0m"
5
+ puts "\e[90m| " * mtrace_indent +
6
+ "\e[35m#{klass}\e[90m#\e[36m#{id} \e[90m#{file}:#{line}\e[0m" +
7
+ "#{' ' * ([10 - mtrace_indent, 1].max)}\e[90mtxmt://open/?url=file://#{ File.expand_path(file).sub(File.expand_path('~'), '~') }&line=#{ line }\e[0m"
6
8
  mtrace_indent += 1
7
9
  when 'return'
8
10
  mtrace_indent -= 1
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - jugyo