77rescue LoadError => e
88 warn e . message
99 warn "Run `gem install bundler` to install Bundler"
10- exit - 1
10+ exit ( - 1 )
1111end
1212
1313task :default => [ :build ]
@@ -27,7 +27,7 @@ task :preview do
2727 sh 'jekyll serve --watch'
2828end
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
3232desc "Release the current commit to ruby-korea/ruby-korea.github.io@master"
3333task :release do
@@ -54,22 +54,20 @@ task :release do
5454 end
5555end
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
7573end
0 commit comments