ir_b 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ir_b.rb +16 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/lib/ir_b.rb
CHANGED
@@ -27,6 +27,22 @@ end
|
|
27
27
|
module IrB
|
28
28
|
class << self
|
29
29
|
def -(_binding)
|
30
|
+
file = _binding.eval '__FILE__'
|
31
|
+
ir_b_line = _binding.eval '__LINE__'
|
32
|
+
puts "#{file}:#{ir_b_line} \e[90mtxmt://open/?url=file://#{ File.expand_path file }&line=#{ ir_b_line }\e[0m"
|
33
|
+
|
34
|
+
File.open(file).each_with_index do |line, index|
|
35
|
+
line_n = index + 1
|
36
|
+
next unless line_n > (ir_b_line - 6)
|
37
|
+
break if line_n > (ir_b_line + 5)
|
38
|
+
if line_n == ir_b_line
|
39
|
+
color = "\e[100m"
|
40
|
+
else
|
41
|
+
color = "\e[90m"
|
42
|
+
end
|
43
|
+
puts color + "#{line_n.to_s.rjust(5)}: #{line.strip} \e[0m"
|
44
|
+
end
|
45
|
+
|
30
46
|
IRB.start_session(_binding)
|
31
47
|
end
|
32
48
|
end
|