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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/ir_b.rb +16 -0
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
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
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
+ - 1
7
8
  - 0
8
- - 0
9
- version: 1.0.0
9
+ version: 1.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - jugyo