Skip to content

Commit 7335d6b

Browse files
committed
Fix the incomplete commit at ed4daf0
1 parent d5085b5 commit 7335d6b

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/unicode_plot/plot.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def annotate_row!(loc, row_index, value, color: :normal)
103103
end
104104
end
105105

106-
def render(out)
107-
Renderer.render(out, self)
106+
def render(out, newline: true)
107+
Renderer.render(out, self, newline)
108108
end
109109

110110
COLOR_CYCLE = [

lib/unicode_plot/renderer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def print_border_bottom(out, padding, length, border=:solid, color: :light_black
5959
class Renderer
6060
include BorderPrinter
6161

62-
def self.render(out, plot, newline: true)
63-
new(plot).render(out, newline: newline)
62+
def self.render(out, plot, newline)
63+
new(plot).render(out, newline)
6464
end
6565

6666
def initialize(plot)
@@ -71,7 +71,7 @@ def initialize(plot)
7171
attr_reader :plot
7272
attr_reader :out
7373

74-
def render(out, newline: true)
74+
def render(out, newline)
7575
@out = out
7676
init_render
7777

test/test-histogram.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def setup
99

1010
test("default") do
1111
plot = UnicodePlot.histogram(@x)
12-
_, output = with_term { plot.render($stdout, newline: false) }
12+
_, output = with_term { plot.render($stdout) }
1313
assert_equal("\n", output[-1])
1414
assert_equal(fixture_path("histogram/default.txt").read,
1515
output.chomp)

test/test-lineplot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def setup
173173
assert_equal(fixture_path("lineplot/parameters3.txt").read,
174174
output)
175175
output = StringIO.open do |sio|
176-
plot.render(sio)
176+
plot.render(sio, newline: false)
177177
sio.close
178178
sio.string
179179
end

test/test-scatterplot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def setup
125125
assert_equal(fixture_path("scatterplot/parameters3.txt").read,
126126
output)
127127
output = StringIO.open do |sio|
128-
plot.render(sio)
128+
plot.render(sio, newline: false)
129129
sio.close
130130
sio.string
131131
end

0 commit comments

Comments
 (0)