Module: Gorillib::DiffDisplayTools
- Included in:
- DiffDrawer
- Defined in:
- lib/gorillib/diff.rb
Instance Method Summary collapse
-
#b_left ⇒ Object
————————————————————————————————.
- #b_right ⇒ Object
- #decrease_indentation ⇒ Object
- #display_add(itl, itr) ⇒ Object
-
#display_eql(it) ⇒ Object
————————————————————————————————-.
-
#display_hetero(this, other) ⇒ Object
————————————————————————————————-.
- #display_indices(ixl, ixr) ⇒ Object
- #display_key_header(key) ⇒ Object
-
#display_noteql_atoms(this, other) ⇒ Object
————————————————————————————————-.
- #header(str) ⇒ Object
- #increase_indentation ⇒ Object
-
#indent ⇒ Object
————————————————————————————————-.
-
#only_left_key(key) ⇒ Object
————————————————————————————————-.
- #only_right_key(key) ⇒ Object
Instance Method Details
#b_left ⇒ Object
65 66 67 |
# File 'lib/gorillib/diff.rb', line 65 def b_left "[#{header(@left)}]" end |
#b_right ⇒ Object
69 70 71 |
# File 'lib/gorillib/diff.rb', line 69 def b_right "[#{header(@right)}]" end |
#decrease_indentation ⇒ Object
73 74 75 |
# File 'lib/gorillib/diff.rb', line 73 def decrease_indentation @indentation -= @tab_width end |
#display_add(itl, itr) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/gorillib/diff.rb', line 44 def display_add(itl, itr) indent if itl.nil? @stream.puts("#{b_right}: #{itr}") else @stream.puts("#{b_left}: #{itl}") end end |
#display_eql(it) ⇒ Object
40 41 42 |
# File 'lib/gorillib/diff.rb', line 40 def display_eql(it) indent; @stream.puts("#{'='} #{it}") end |
#display_hetero(this, other) ⇒ Object
27 28 29 |
# File 'lib/gorillib/diff.rb', line 27 def display_hetero this, other indent; @stream.puts("#{b_left} class is #{this.class} but #{b_right} class is #{other.class}") end |
#display_indices(ixl, ixr) ⇒ Object
59 60 61 |
# File 'lib/gorillib/diff.rb', line 59 def display_indices(ixl, ixr) indent; @stream.puts("#{b_left} ix: #{ixl}, #{b_right} ix: #{ixr}") end |
#display_key_header(key) ⇒ Object
11 12 13 |
# File 'lib/gorillib/diff.rb', line 11 def display_key_header key indent; @stream.puts("#{key}:") end |
#display_noteql_atoms(this, other) ⇒ Object
33 34 35 36 |
# File 'lib/gorillib/diff.rb', line 33 def display_noteql_atoms this, other indent; @stream.puts("#{b_left}: #{this.inspect}") indent; @stream.puts("#{b_right}: #{other.inspect}") end |
#header(str) ⇒ Object
77 78 79 |
# File 'lib/gorillib/diff.rb', line 77 def header str cyan(str) end |
#increase_indentation ⇒ Object
81 82 83 |
# File 'lib/gorillib/diff.rb', line 81 def increase_indentation @indentation += @tab_width end |
#indent ⇒ Object
55 56 57 |
# File 'lib/gorillib/diff.rb', line 55 def indent @stream.write(" " * @indentation) end |
#only_left_key(key) ⇒ Object
17 18 19 |
# File 'lib/gorillib/diff.rb', line 17 def only_left_key key indent; @stream.puts("only on #{b_left}") end |
#only_right_key(key) ⇒ Object
21 22 23 |
# File 'lib/gorillib/diff.rb', line 21 def only_right_key key indent; @stream.puts("only on #{b_right}") end |