Skip to content

Commit e66d8c6

Browse files
committed
Validate markup on PR
1 parent 558d756 commit e66d8c6

3 files changed

Lines changed: 27 additions & 30 deletions

File tree

‎Gemfile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ gem 'kramdown'
77
gem 'travis'
88

99
group :development do
10-
gem 'spidr', '~> 0.4'
11-
gem 'validate-website', '~> 0.9'
12-
gem 'rspec'
10+
gem 'validate-website', '~> 1.0'
11+
gem 'rspec', '~> 3.0'
1312
end

‎Gemfile.lock‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ GEM
3232
fast-stemmer (1.0.2)
3333
ffi (1.9.6)
3434
gemoji (2.1.0)
35-
gh (0.13.2)
35+
gh (0.14.0)
3636
addressable
3737
backports
3838
faraday (~> 0.8)
3939
multi_json (~> 1.0)
4040
net-http-persistent (>= 2.7)
4141
net-http-pipeline
42-
github-pages (31)
42+
github-pages (32)
4343
RedCloth (= 4.2.9)
4444
github-pages-health-check (~> 0.2)
4545
jekyll (= 2.4.0)
@@ -49,7 +49,7 @@ GEM
4949
jekyll-sass-converter (= 1.2.0)
5050
jekyll-sitemap (= 0.6.3)
5151
jemoji (= 0.4.0)
52-
kramdown (= 1.3.1)
52+
kramdown (= 1.5.0)
5353
liquid (= 2.6.1)
5454
maruku (= 0.7.0)
5555
mercenary (~> 0.3)
@@ -93,14 +93,14 @@ GEM
9393
jekyll-sass-converter (1.2.0)
9494
sass (~> 3.2)
9595
jekyll-sitemap (0.6.3)
96-
jekyll-watch (1.2.0)
96+
jekyll-watch (1.2.1)
9797
listen (~> 2.7)
9898
jemoji (0.4.0)
9999
gemoji (~> 2.0)
100100
html-pipeline (~> 1.9)
101101
jekyll (~> 2.0)
102102
json (1.8.2)
103-
kramdown (1.3.1)
103+
kramdown (1.5.0)
104104
launchy (2.4.3)
105105
addressable (~> 2.3)
106106
liquid (2.6.1)
@@ -119,7 +119,7 @@ GEM
119119
net-dns (0.8.0)
120120
net-http-persistent (2.9.4)
121121
net-http-pipeline (1.0.1)
122-
nokogiri (1.6.5)
122+
nokogiri (1.6.6.2)
123123
mini_portile (~> 0.6.0)
124124
paint (0.9.0)
125125
parslet (1.5.0)
@@ -180,9 +180,10 @@ GEM
180180
ethon (>= 0.7.1)
181181
tzinfo (1.2.2)
182182
thread_safe (~> 0.1)
183-
validate-website (0.9.5)
183+
validate-website (1.0.0)
184184
multipart_body (~> 0.2)
185185
paint (~> 0.8)
186+
slop (~> 3.5)
186187
spidr (~> 0.4)
187188
websocket (1.2.1)
188189
yajl-ruby (1.1.0)
@@ -194,7 +195,6 @@ DEPENDENCIES
194195
github-pages
195196
kramdown
196197
rake
197-
rspec
198-
spidr (~> 0.4)
198+
rspec (~> 3.0)
199199
travis
200-
validate-website (~> 0.9)
200+
validate-website (~> 1.0)

‎Rakefile‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ begin
77
rescue LoadError => e
88
warn e.message
99
warn "Run `gem install bundler` to install Bundler"
10-
exit -1
10+
exit(-1)
1111
end
1212

1313
task :default => [:build]
@@ -27,7 +27,7 @@ task :preview do
2727
sh 'jekyll serve --watch'
2828
end
2929

30-
task travis: ENV["TRAVIS_PULL_REQUEST"] == "false" ? [:test, :build, :release] : [:test]
30+
task travis: ENV["TRAVIS_PULL_REQUEST"] == "false" ? [:test, :build, :validate_markup, :release] : [:test, :build, :validate_markup]
3131

3232
desc "Release the current commit to ruby-korea/ruby-korea.github.io@master"
3333
task :release do
@@ -54,22 +54,20 @@ task :release do
5454
end
5555
end
5656

57-
namespace :check do
58-
desc 'validate _site markup with validate-website'
59-
task :markup => :generate do
60-
options = Jekyll.configuration({'auto' => false, 'server' => false})
61-
Dir.chdir('_site') do
62-
system("validate-website-static --site '#{options['url']}/' --quiet")
63-
exit($?.exitstatus)
64-
end
57+
desc 'validate _site markup with validate-website'
58+
task :validate_markup do
59+
Dir.chdir('_site') do
60+
system("validate-website-static --site 'https://ruby-korea.github.io/'")
61+
exit($?.exitstatus)
6562
end
66-
desc "Checks for broken links on http://0.0.0.0:4000/"
67-
task :links do
68-
require 'spidr'
69-
Spidr.start_at('http://0.0.0.0:4000/') do |agent|
70-
agent.every_failed_url do |url|
71-
puts "Broken link #{url} found."
72-
end
63+
end
64+
65+
desc "Checks for broken links on http://0.0.0.0:4000/"
66+
task :links do
67+
require 'spidr'
68+
Spidr.start_at('http://0.0.0.0:4000/') do |agent|
69+
agent.every_failed_url do |url|
70+
puts "Broken link #{url} found."
7371
end
7472
end
7573
end

0 commit comments

Comments
 (0)