Permalink
Browse files

add test framework, check broken links

  • Loading branch information...
1 parent c2ab5c5 commit ca100fa8522e16d7566ec8f46366b0f87766439e @mlinksva mlinksva committed Aug 23, 2016
Showing with 74 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +23 −0 .travis.yml
  3. +14 −0 Gemfile
  4. +10 −0 Rakefile
  5. +10 −0 script/bootstrap
  6. +6 −0 script/cibuild
  7. +9 −0 script/server
View
@@ -1 +1,3 @@
+.jekyll-metadata
+Gemfile.lock
_site
View
@@ -0,0 +1,23 @@
+#bootstrap and build
+before_script: "./script/bootstrap"
+script: "./script/cibuild"
+
+#environment
+language: ruby
+rvm:
+ - 2.0.0
+
+branches:
+ only:
+ - gh-pages
+ - /.*/
+
+notifications:
+ email: false
+
+env:
+ global:
+ - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
+
+sudo: false
+cache: bundler
View
14 Gemfile
@@ -0,0 +1,14 @@
+source 'https://rubygems.org'
+
+require 'json'
+require 'open-uri'
+versions = JSON.parse(open('https://pages.github.com/versions.json').read)
+
+gem 'github-pages', versions['github-pages']
+
+group :test do
+ gem 'html-proofer', '~> 3.0'
+ gem 'rake'
+ gem 'rspec'
+ gem 'nokogiri'
+end
View
@@ -0,0 +1,10 @@
+require 'html-proofer'
+require 'rspec/core/rake_task'
+
+task :test do
+ sh 'bundle exec jekyll build'
+ HTMLProofer.check_directory('./_site',
+ check_html: true,
+ validation: { ignore_script_embeds: true },
+ url_swap: { %r{http://opendefinition.org} => '' }).run
+end
View
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+echo "bundling installin'"
+gem install bundler
+bundle install
+
+echo
+echo "You're all set. Just run script/server!"
View
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+
+echo "building the site..."
+bundle exec rake test
View
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+echo "spinning up the server..."
+bundle exec jekyll serve --watch --incremental --trace
+
+echo "cleaning up..."
+rm -Rf _site

0 comments on commit ca100fa

Please sign in to comment.