-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
294 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.1 | ||
Include: | ||
- '**/Rakefile' | ||
|
||
Style/Encoding: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
#Enabled: false | ||
Max: 99 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
sudo: false | ||
language: bash | ||
language: ruby | ||
rvm: | ||
- "2.2.5" | ||
- "2.3.1" | ||
script: | ||
- echo YOLO straight to prod | ||
notifications: | ||
slack: | ||
secure: ppR6E8Tzxf+o2Ump0dEE2Xp0GMvDDnq8YN9ll+WCIwGlwVgsvH4jW0vD7to9+tl6Yx5w9cW/YxmF4CDQszUpGH6rAF8CLjXMwD/QgiHjkjkGNPoIU+/sr6oAzvD0iUWOZ8BU7n9FuGI0T/z4MPNH8k16XoxLrYGjAKpKyG0mj502OQTI/BAsAJyXMSeu6wUAyc6iFWdcs36cpOuFT58Dt/3vNrfFqXHZf61mPjKNXzWstIEaglsnVc/t1aOGiN/o2DETm1ysGcVrqIXeSv3wEWIrHUVwoOI3vSe4DvWW93br0aQWDJ2JucMEzvX1K2Jcx1WWMnGiG5tVeQXrWA1tYYXGyfWXYdZrfVJf7WvkLHV4JX2j3AgKAaUMvFA1AZeApM4DPHM+3tGZpZwzHZD992rQhyzjqydFzxuIya6nwwmS/LwH4J4nHvs0OQalC8A6zEX9EMhte/WBgAYr+mWQqamKjdv1JQd8vEQQZweUDc51WBdkodRYjmBcJNak/+5KcSL5ecw+GTqpCtnSEd4s+h3PKFX90AR5Gxeorju3KYAPuH6nqp1S3zdv5QlJQH9VDkUqPeH9zsI8pyqypHgJdO/wNf1HfRvYPvodxrRBrON+1OQkAn3pCjEs7zVRQMTraUQ6w2ptIhAhwAk7w1gIABEbmLoj1s0I/54co328828= | ||
deploy: | ||
local_dir: build | ||
provider: s3 | ||
access_key_id: AKIAJGMDPBO6WAJAZRQA | ||
secret_access_key: | ||
secure: PhgNSq4p7GSl9tK1pu4REw00gNpPeki7D6MHu9VIqMd1KaJfpFqZ4+OzntAWSWTNBvDSZpzqT+oR4ALAg/31o9dYegnOk7JiobHNlgFWFa8YECcMwje1aTbMaeAQ5ZQBzgikaDXdfzuJPwK8frrcSvvJjldNFpnE52WZ4BcfM4TtsZNYPMYgKKip77g1ba/f/hguXESZp/9bWB0tCQLY7aLpxhx/QQLQYncF5IgtGkEO1UNJYZdPdcHvozyzEw9EhDm/jMGe/2UIkpao/koX0tsfH6JKO+Fz1qeUFtQyRUNEJeoEJwSLPDEBOevRF5QW+WSO/vt7MiMhWB2J12Fif52xLPEtIhgzSOsvgvGX777FF/i87Gv5UshUXv2SlJyCJ1tKmuwkh1vrY7fz9DwW4kyomYwnmU3Ce4m46M151pmf/YEx9n4CeXIdutU26iOHT9XIa2sIxh5iTrZUcPudGuaO7cAfe89874+kyh3prk4CuNFVgD3rB6J4xEv8FV8OdFirBDhXTKUf+SR9az3vpT2Ox0aYIdZU5+UuMOZbHzIjrEIS6Gs5DVBmkvX3ITlkNupcUaY8Y2YmTcC7QVXGZ0oNI1OIPaoDeEF0em0XCn1S42aLnlh74M3K2iwpQBcTY2NBYa04Z9LORAUi/QGYnl0Te1ZbYfq3sZ95Bb14zbQ= | ||
bucket: tirefi.re | ||
acl: public_read | ||
on: | ||
branch: master | ||
repo: tirefire/tirefi.re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
source 'https://rubygems.org' | ||
gem 'html-proofer' | ||
gem 'jekyll' | ||
gem 'jekyll-redirect-from' | ||
gem 'jekyll-paginate' | ||
gem 'jekyll-sitemap' | ||
gem 'jekyll-feed' | ||
gem 'kramdown' | ||
gem 'rake' | ||
gem 'rubocop' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
activesupport (4.2.7) | ||
i18n (~> 0.7) | ||
json (~> 1.7, >= 1.7.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
addressable (2.4.0) | ||
ast (2.3.0) | ||
colorator (1.1.0) | ||
colored (1.2) | ||
ethon (0.9.0) | ||
ffi (>= 1.3.0) | ||
ffi (1.9.14) | ||
forwardable-extended (2.6.0) | ||
html-proofer (3.0.6) | ||
activesupport (~> 4.2) | ||
addressable (~> 2.3) | ||
colored (~> 1.2) | ||
mercenary (~> 0.3.2) | ||
nokogiri (~> 1.5) | ||
parallel (~> 1.3) | ||
typhoeus (~> 0.7) | ||
yell (~> 2.0) | ||
i18n (0.7.0) | ||
jekyll (3.2.0) | ||
colorator (~> 1.0) | ||
jekyll-sass-converter (~> 1.0) | ||
jekyll-watch (~> 1.1) | ||
kramdown (~> 1.3) | ||
liquid (~> 3.0) | ||
mercenary (~> 0.3.3) | ||
pathutil (~> 0.9) | ||
rouge (~> 1.7) | ||
safe_yaml (~> 1.0) | ||
jekyll-feed (0.6.0) | ||
jekyll-paginate (1.1.0) | ||
jekyll-redirect-from (0.11.0) | ||
jekyll (>= 2.0) | ||
jekyll-sass-converter (1.4.0) | ||
sass (~> 3.4) | ||
jekyll-sitemap (0.11.0) | ||
addressable (~> 2.4.0) | ||
jekyll-watch (1.5.0) | ||
listen (~> 3.0, < 3.1) | ||
json (1.8.3) | ||
kramdown (1.11.1) | ||
liquid (3.0.6) | ||
listen (3.0.8) | ||
rb-fsevent (~> 0.9, >= 0.9.4) | ||
rb-inotify (~> 0.9, >= 0.9.7) | ||
mercenary (0.3.6) | ||
mini_portile2 (2.1.0) | ||
minitest (5.9.0) | ||
nokogiri (1.6.8) | ||
mini_portile2 (~> 2.1.0) | ||
pkg-config (~> 1.1.7) | ||
parallel (1.9.0) | ||
parser (2.3.1.2) | ||
ast (~> 2.2) | ||
pathutil (0.14.0) | ||
forwardable-extended (~> 2.6) | ||
pkg-config (1.1.7) | ||
powerpack (0.1.1) | ||
rainbow (2.1.0) | ||
rake (11.2.2) | ||
rb-fsevent (0.9.7) | ||
rb-inotify (0.9.7) | ||
ffi (>= 0.5.0) | ||
rouge (1.11.1) | ||
rubocop (0.42.0) | ||
parser (>= 2.3.1.1, < 3.0) | ||
powerpack (~> 0.1) | ||
rainbow (>= 1.99.1, < 3.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (~> 1.0, >= 1.0.1) | ||
ruby-progressbar (1.8.1) | ||
safe_yaml (1.0.4) | ||
sass (3.4.22) | ||
thread_safe (0.3.5) | ||
typhoeus (0.8.0) | ||
ethon (>= 0.8.0) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
unicode-display_width (1.1.0) | ||
yell (2.0.6) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
html-proofer | ||
jekyll | ||
jekyll-feed | ||
jekyll-paginate | ||
jekyll-redirect-from | ||
jekyll-sitemap | ||
kramdown | ||
rake | ||
rubocop | ||
|
||
BUNDLED WITH | ||
1.12.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
#!/usr/bin/env ruby | ||
# jekyll Rakefile | ||
# Config variables above those defined in _config.yml | ||
|
||
# post_ext = '.md' | ||
# post_dir = '_posts/' | ||
# load from configuration file if present | ||
load '_rake-configuration.rb' if File.exist?('_rake-configuration.rb') | ||
load '_rake_configuration.rb' if File.exist?('_rake_configuration.rb') | ||
# | ||
# OK now starting main engines | ||
# | ||
# Specify default values for variables NOT set by the user | ||
|
||
# post_ext ||= '.md' | ||
# post_dir ||= '_posts/' | ||
# git_check ||= true | ||
# git_autopush ||= false | ||
# | ||
|
||
desc 'Test site using HTML::Proofer' | ||
task :proof_sitedir do | ||
system 'bundle exec jekyll build' | ||
# system 'bundle exec htmlproofer --allow-hash-href --assume-extension ./_site' | ||
HTMLProofer.check_directory( | ||
'./_site/', | ||
allow_hash_href: true, | ||
assume_extension: true, | ||
url_ignore: [ | ||
'http://tirefi.re/about/', | ||
'http://tirefi.re/feed.xml', | ||
'http://validator.w3.org/check?uri=referer' | ||
] | ||
).run | ||
end | ||
# | ||
# and the rest | ||
# | ||
desc 'Clean up generated site' | ||
task :clean do | ||
cleanup | ||
end | ||
|
||
desc 'Preview on local machine' | ||
task preview: :clean do | ||
jekyll('serve --watch') | ||
end | ||
task serve: :preview | ||
|
||
desc 'Build for deployment' | ||
task build: :clean do | ||
if rake_running | ||
puts "\n\n****WARNING: An instance of rake is running.\n" | ||
puts "****WARNING: Building while running other tasks (preview!)\n" | ||
puts " might create a site with broken links.\n\n" | ||
puts 'Are you certain you want to continue? [Y|n]' | ||
|
||
ans = STDIN.gets.chomp | ||
exit if ans != 'Y' | ||
end | ||
jekyll('build --config _config.yml') | ||
end | ||
|
||
desc 'Show the file changed since last deploy to stdout' | ||
task :list_changes do |_t| | ||
content = list_file_changed | ||
puts content | ||
end | ||
|
||
def list_file_changed | ||
content = "Files changed since last deploy:\n" | ||
IO.popen('find * -newer _last_deploy.txt -type f') do |io| | ||
while (line = io.gets) | ||
filename = line.chomp | ||
if user_visible(filename) | ||
content << "* \"#{filename}\":{{site.url}}/#{file_change_ext(filename, '.html')}\n" | ||
end | ||
end | ||
end | ||
content | ||
end | ||
|
||
# this is the list of files we do not want to show in changed files | ||
EXCLUSION_LIST = [/.*~/, | ||
/_.*/, | ||
'javascripts?', | ||
'js', | ||
/stylesheets?/, | ||
'css', | ||
'Rakefile', | ||
'Gemfile', | ||
/s[ca]ss/, | ||
/.*\.css/, | ||
/.*.js/, | ||
'bower_components', | ||
'config.rb'].map!(&:freeze).freeze | ||
|
||
# return true if filename is "visible" to the user (e.g., it is not javascript, css, ...) | ||
def user_visible(filename) | ||
exclusion_list = Regexp.union(EXCLUSION_LIST) | ||
!filename.match(exclusion_list) | ||
end | ||
|
||
def file_change_ext(filename, newext) | ||
if File.extname(filename) == '.textile' || File.extname(filename) == '.md' | ||
filename.sub(File.extname(filename), newext) | ||
else | ||
filename | ||
end | ||
end | ||
|
||
# | ||
# General support functions | ||
# | ||
|
||
# remove generated site | ||
def cleanup | ||
jekyll('clean') | ||
end | ||
|
||
# launch jekyll | ||
def jekyll(directives = '') | ||
system 'bundle exec jekyll ' + directives | ||
end | ||
|
||
# check if there is another rake task running (in addition to this one!) | ||
def rake_running | ||
`pgrep rake | wc -l`.to_i > 1 | ||
end | ||
|
||
def git_local_diffs | ||
`git diff --name-only` != '' | ||
end | ||
|
||
def git_remote_diffs(branch) | ||
`git fetch` | ||
`git rev-parse #{branch}` != `git rev-parse origin/#{branch}` | ||
end | ||
|
||
def git_repo? | ||
`git status` != '' | ||
end | ||
|
||
def git_requires_attention(branch) | ||
git_check && git_repo? && git_remote_diffs(branch) | ||
end | ||
|
||
# | ||
# default task stuff | ||
# | ||
require 'rake' | ||
require 'html-proofer' | ||
require 'rubocop/rake_task' | ||
|
||
RuboCop::RakeTask.new | ||
|
||
desc 'Set default tasks' | ||
task default: :proof_sitedir |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.