Skip to content

Commit e1acc5d

Browse files
author
Joel Courtney
committed
Rubocop applied
1 parent e8786d6 commit e1acc5d

File tree

13 files changed

+395
-365
lines changed

13 files changed

+395
-365
lines changed

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ruby '2.5.3'
24

35
source 'https://rubygems.org' do
@@ -7,4 +9,8 @@ source 'https://rubygems.org' do
79
gem 'rack'
810
gem 'sass'
911
gem 'sinatra'
12+
13+
group :development do
14+
gem 'rubocop'
15+
end
1016
end

Gemfile.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
ast (2.4.0)
45
coffee-script (2.4.1)
56
coffee-script-source
67
execjs
@@ -10,16 +11,31 @@ GEM
1011
haml (5.0.4)
1112
temple (>= 0.8.0)
1213
tilt
14+
jaro_winkler (1.5.1)
1315
linguistics (2.1.0)
1416
loggability (~> 0.11)
1517
loggability (0.14.0)
1618
mustermann (1.0.3)
19+
parallel (1.12.1)
20+
parser (2.5.3.0)
21+
ast (~> 2.4.0)
22+
powerpack (0.1.2)
1723
rack (2.0.6)
1824
rack-protection (2.0.4)
1925
rack
26+
rainbow (3.0.0)
2027
rb-fsevent (0.10.3)
2128
rb-inotify (0.9.10)
2229
ffi (>= 0.5.0, < 2)
30+
rubocop (0.61.1)
31+
jaro_winkler (~> 1.5.1)
32+
parallel (~> 1.10)
33+
parser (>= 2.5, != 2.5.1.1)
34+
powerpack (~> 0.1)
35+
rainbow (>= 2.2.2, < 4.0)
36+
ruby-progressbar (~> 1.7)
37+
unicode-display_width (~> 1.4.0)
38+
ruby-progressbar (1.10.0)
2339
sass (3.7.2)
2440
sass-listen (~> 4.0.0)
2541
sass-listen (4.0.0)
@@ -32,6 +48,7 @@ GEM
3248
tilt (~> 2.0)
3349
temple (0.8.0)
3450
tilt (2.0.9)
51+
unicode-display_width (1.4.0)
3552

3653
PLATFORMS
3754
ruby
@@ -41,6 +58,7 @@ DEPENDENCIES
4158
haml!
4259
linguistics!
4360
rack!
61+
rubocop!
4462
sass!
4563
sinatra!
4664

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Calendar

config.ru

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
require_relative './jmc_calendar'
2-
3-
run Sinatra::Application
1+
# frozen_string_literal: true
2+
3+
require_relative './jmc_calendar'
4+
5+
run Sinatra::Application

jmc_calendar.rb

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
1-
require 'rubygems'
2-
require 'sinatra'
3-
4-
require 'haml'
5-
set :haml, format: :html5
6-
require 'sass'
7-
require 'coffee-script'
8-
9-
require 'linguistics'
10-
Linguistics::use( :en )
11-
12-
# ----------------------------------
13-
# Index - This uses the current date
14-
# ----------------------------------
15-
get '/' do
16-
# TODO: use of GMT over server timezone; Localised timezone support
17-
params[:tz] ||= 0
18-
# /TODO
19-
20-
@today = Date.today
21-
@year = @today.year
22-
@start = @today
23-
# Manage start and end of calendar
24-
# Start
25-
if @today.month == 1
26-
@start = Date.new(@today.year - 1,12,1)
27-
else
28-
@start = Date.new(@today.year,@today.month-1,1)
29-
end
30-
@end = @start>>(12)
31-
32-
haml :index
33-
end
34-
35-
# ----------------------------------
36-
# Year - calendar for a particular year
37-
# ----------------------------------
38-
get %r{\/(\d+)} do
39-
# TODO: use of GMT over server timezone; Localised timezone support
40-
params[:tz] ||= 0
41-
# /TODO
42-
@year = params[:captures][0].to_i
43-
haml :annual
44-
end
45-
46-
# ----------------------------------
47-
# SCSS Custom Styling
48-
# ----------------------------------
49-
50-
get '/css/styles.css' do
51-
sass :styles
52-
end
1+
# frozen_string_literal: true
2+
3+
require 'rubygems'
4+
require 'sinatra'
5+
6+
require 'haml'
7+
require 'sass'
8+
require 'coffee-script'
9+
10+
require 'linguistics'
11+
12+
set :haml, format: :html5
13+
Linguistics.use(:en)
14+
15+
# ----------------------------------
16+
# Index - This uses the current date
17+
# ----------------------------------
18+
get '/' do
19+
# TODO: use of GMT over server timezone; Localised timezone support
20+
params[:tz] ||= 0
21+
# /TODO
22+
23+
@today = Date.today
24+
@year = @today.year
25+
@start = @today
26+
# Manage start and end of calendar
27+
# Start
28+
@start = if @today.month == 1
29+
Date.new(@today.year - 1, 12, 1)
30+
else
31+
Date.new(@today.year, @today.month - 1, 1)
32+
end
33+
@end = @start >> 12
34+
35+
haml :index
36+
end
37+
38+
# ----------------------------------
39+
# Year - calendar for a particular year
40+
# ----------------------------------
41+
get %r{\/(\d+)} do
42+
# TODO: use of GMT over server timezone; Localised timezone support
43+
params[:tz] ||= 0
44+
# /TODO
45+
@year = params[:captures][0].to_i
46+
haml :annual
47+
end
48+
49+
# ----------------------------------
50+
# SCSS Custom Styling
51+
# ----------------------------------
52+
53+
get '/css/styles.css' do
54+
sass :styles
55+
end

public/css/blueprint/src/forms.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
-------------------------------------------------------------- */
1212

1313
/*
14-
A special hack is included for IE8 since it does not apply padding
15-
correctly on fieldsets
14+
A special hack is included for IE8 since it does not apply padding
15+
correctly on fieldsets
1616
*/
1717
label { font-weight: bold; }
1818
fieldset { padding:0 1.4em 1.4em 1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; }
@@ -69,13 +69,13 @@ form.inline p { margin-bottom:0; }
6969
.alert,
7070
.notice,
7171
.success,
72-
.info { padding: 0.8em; margin-bottom: 1em; border: 2px solid #ddd; }
72+
.info { padding: 0.8em; margin-bottom: 1em; border: 2px solid #ddd; }
7373

7474
.error, .alert { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; }
7575
.notice { background: #fff6bf; color: #514721; border-color: #ffd324; }
7676
.success { background: #e6efc2; color: #264409; border-color: #c6d880; }
77-
.info { background: #d5edf8; color: #205791; border-color: #92cae4; }
77+
.info { background: #d5edf8; color: #205791; border-color: #92cae4; }
7878
.error a, .alert a { color: #8a1f11; }
7979
.notice a { color: #514721; }
8080
.success a { color: #264409; }
81-
.info a { color: #205791; }
81+
.info a { color: #205791; }

public/css/blueprint/src/print.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ a:link, a:visited {
7373
}
7474

7575
/*
76-
This has been the source of many questions in the past. This
77-
snippet of CSS appends the URL of each link within the text.
78-
The idea is that users printing your webpage will want to know
79-
the URLs they go to. If you want to remove this functionality,
80-
comment out this snippet and make sure to re-compress your files.
76+
This has been the source of many questions in the past. This
77+
snippet of CSS appends the URL of each link within the text.
78+
The idea is that users printing your webpage will want to know
79+
the URLs they go to. If you want to remove this functionality,
80+
comment out this snippet and make sure to re-compress your files.
8181
*/
8282
a:link:after, a:visited:after {
8383
content: " (" attr(href) ")";

public/css/blueprint/src/reset.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
-------------------------------------------------------------- */
77

88
html {
9-
margin:0;
10-
padding:0;
11-
border:0;
9+
margin:0;
10+
padding:0;
11+
border:0;
1212
}
1313

1414
body, div, span, object, iframe,
@@ -43,17 +43,17 @@ body {
4343

4444
/* Tables still need 'cellspacing="0"' in the markup. */
4545
table {
46-
border-collapse: separate;
47-
border-spacing: 0;
46+
border-collapse: separate;
47+
border-spacing: 0;
4848
}
4949
/* float:none prevents the span-x classes from breaking table-cell display */
5050
caption, th, td {
51-
text-align: left;
52-
font-weight: normal;
53-
float:none !important;
51+
text-align: left;
52+
font-weight: normal;
53+
float:none !important;
5454
}
5555
table, th, td {
56-
vertical-align: middle;
56+
vertical-align: middle;
5757
}
5858

5959
/* Remove possible quote marks (") from <q>, <blockquote>. */

public/css/blueprint/src/typography.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ h4 img, h5 img, h6 img {
3939

4040
p { margin: 0 0 1.5em; }
4141
/*
42-
These can be used to pull an image at the start of a paragraph, so
43-
that the text flows around it (usage: <p><img class="left">Text</p>)
42+
These can be used to pull an image at the start of a paragraph, so
43+
that the text flows around it (usage: <p><img class="left">Text</p>)
4444
*/
45-
.left { float: left !important; }
46-
p .left { margin: 1.5em 1.5em 1.5em 0; padding: 0; }
47-
.right { float: right !important; }
48-
p .right { margin: 1.5em 0 1.5em 1.5em; padding: 0; }
45+
.left { float: left !important; }
46+
p .left { margin: 1.5em 1.5em 1.5em 0; padding: 0; }
47+
.right { float: right !important; }
48+
p .right { margin: 1.5em 0 1.5em 1.5em; padding: 0; }
4949

5050
a:focus,
5151
a:hover { color: #09f; }
5252
a { color: #06c; text-decoration: underline; }
5353

5454
blockquote { margin: 1.5em; color: #666; font-style: italic; }
55-
strong,dfn { font-weight: bold; }
55+
strong,dfn { font-weight: bold; }
5656
em,dfn { font-style: italic; }
5757
sup, sub { line-height: 0; }
5858

@@ -84,21 +84,21 @@ dd { margin-left: 1.5em;}
8484
-------------------------------------------------------------- */
8585

8686
/*
87-
Because of the need for padding on TH and TD, the vertical rhythm
88-
on table cells has to be 27px, instead of the standard 18px or 36px
89-
of other elements.
87+
Because of the need for padding on TH and TD, the vertical rhythm
88+
on table cells has to be 27px, instead of the standard 18px or 36px
89+
of other elements.
9090
*/
9191
table { margin-bottom: 1.4em; width:100%; }
9292
th { font-weight: bold; }
9393
thead th { background: #c3d9ff; }
9494
th,td,caption { padding: 4px 10px 4px 5px; }
9595
/*
96-
You can zebra-stripe your tables in outdated browsers by adding
97-
the class "even" to every other table row.
96+
You can zebra-stripe your tables in outdated browsers by adding
97+
the class "even" to every other table row.
9898
*/
9999
tbody tr:nth-child(even) td,
100100
tbody tr.even td {
101-
background: #e5ecf9;
101+
background: #e5ecf9;
102102
}
103103
tfoot { font-style: italic; }
104104
caption { background: #eee; }

0 commit comments

Comments
 (0)