Skip to content

Commit 2e3db95

Browse files
committed
update cops
1 parent 4db0888 commit 2e3db95

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

lib/githubchart.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def initialize(params = {})
6565

6666
def render(type)
6767
raise(NameError, "Format #{type} is unsupported.") unless GithubChart.supports? type
68-
send("render_#{type}".to_sym)
68+
send(:"render_#{type}")
6969
end
7070

7171
private

lib/githubchart/svg.rb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,10 @@ module GithubChart
1212
##
1313
# Convert stats into SVG
1414
class Chart
15-
private
16-
1715
CUBE_SIZE = 12
1816
X_PAD = 27
1917
Y_PAD = 20
2018

21-
def render_svg
22-
grid = matrix
23-
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) + X_PAD,
24-
height: (CUBE_SIZE * grid.row_size) + Y_PAD)
25-
svg_add_points grid, chart
26-
svg_add_weekdays chart
27-
svg_add_months chart
28-
chart.to_s
29-
end
30-
31-
def render_svg_square
32-
grid = matrix.minor(0, 7, -7, 7)
33-
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) - 2,
34-
height: (CUBE_SIZE * grid.row_size) - 2)
35-
svg_add_points grid, chart, 0, 0
36-
chart.to_s
37-
end
38-
3919
##
4020
# Define shared label style
4121

@@ -57,6 +37,26 @@ def render_svg_square
5737

5838
SVG_MONTH_STYLE = SVG_SHARED_STYLE.dup.merge('font-size': '10px').freeze
5939

40+
private
41+
42+
def render_svg
43+
grid = matrix
44+
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) + X_PAD,
45+
height: (CUBE_SIZE * grid.row_size) + Y_PAD)
46+
svg_add_points grid, chart
47+
svg_add_weekdays chart
48+
svg_add_months chart
49+
chart.to_s
50+
end
51+
52+
def render_svg_square
53+
grid = matrix.minor(0, 7, -7, 7)
54+
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) - 2,
55+
height: (CUBE_SIZE * grid.row_size) - 2)
56+
svg_add_points grid, chart, 0, 0
57+
chart.to_s
58+
end
59+
6060
def svg_point_style(point)
6161
{
6262
fill: @colors[@stats.quartile(point.score)],

spec/githubchart_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
end
4848
end
4949

50-
describe ::Integer do
50+
describe Integer do
5151
describe '#ordinalize' do
5252
it 'returns a spoken string for a number' do
5353
[

0 commit comments

Comments
 (0)