appease rubocop
This commit is contained in:
parent
39b7af3732
commit
6f8bf2e950
|
@ -7,7 +7,7 @@
|
|||
namespace :docs do
|
||||
desc "Release #{docs_name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
unless `git branch` =~ %r!^\* master$!
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
desc "Release #{name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
unless `git branch` =~ %r!^\* master$!
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace :site do
|
|||
require "jekyll"
|
||||
|
||||
browser_launched = false
|
||||
Jekyll::Hooks.register :site, :post_write do |site|
|
||||
Jekyll::Hooks.register :site, :post_write do |_site|
|
||||
next if browser_launched
|
||||
browser_launched = true
|
||||
Jekyll.logger.info "Opening in browser..."
|
||||
|
@ -26,7 +26,7 @@ namespace :site do
|
|||
"source" => File.expand_path(docs_folder),
|
||||
"destination" => File.expand_path("#{docs_folder}/_site"),
|
||||
"watch" => true,
|
||||
"serving" => true
|
||||
"serving" => true,
|
||||
}
|
||||
Jekyll::Commands::Build.process(options)
|
||||
Jekyll::Commands::Serve.process(options)
|
||||
|
@ -38,7 +38,7 @@ namespace :site do
|
|||
Jekyll::Commands::Build.process({
|
||||
"profile" => true,
|
||||
"source" => File.expand_path(docs_folder),
|
||||
"destination" => File.expand_path("#{docs_folder}/_site")
|
||||
"destination" => File.expand_path("#{docs_folder}/_site"),
|
||||
})
|
||||
end
|
||||
task :build => :generate
|
||||
|
@ -48,7 +48,7 @@ namespace :site do
|
|||
Dir.chdir("#{docs_folder}/_sass") do
|
||||
sh 'curl "https://necolas.github.io/normalize.css/latest/normalize.css" -o "normalize.scss"'
|
||||
sh 'sass "normalize.scss":"_normalize.scss" --style compressed'
|
||||
rm ['normalize.scss', Dir.glob('*.map')].flatten
|
||||
rm ["normalize.scss", Dir.glob("*.map")].flatten
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -60,40 +60,40 @@ namespace :site do
|
|||
|
||||
desc "Create a nicely formatted history page for the jekyll site based on the repo history."
|
||||
task :history do
|
||||
siteify_file('History.markdown', { "title" => "History" })
|
||||
siteify_file("History.markdown", { "title" => "History" })
|
||||
end
|
||||
|
||||
desc "Copy the Code of Conduct"
|
||||
task :conduct do
|
||||
front_matter = {
|
||||
"redirect_from" => "/conduct/index.html",
|
||||
"editable" => false
|
||||
"editable" => false,
|
||||
}
|
||||
siteify_file('CONDUCT.markdown', front_matter)
|
||||
siteify_file("CONDUCT.markdown", front_matter)
|
||||
end
|
||||
|
||||
desc "Copy the contributing file"
|
||||
task :contributing do
|
||||
siteify_file('.github/CONTRIBUTING.markdown', "title" => "Contributing")
|
||||
siteify_file(".github/CONTRIBUTING.markdown", "title" => "Contributing")
|
||||
end
|
||||
|
||||
desc "Write the site latest_version.txt file"
|
||||
task :version_file do
|
||||
File.open("#{docs_folder}/latest_version.txt", 'wb') { |f| f.puts(version) } unless version =~ /(beta|rc|alpha)/i
|
||||
File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) } unless version =~ %r!(beta|rc|alpha)!i
|
||||
end
|
||||
|
||||
namespace :releases do
|
||||
desc "Create new release post"
|
||||
task :new, :version do |t, args|
|
||||
task :new, :version do |_t, args|
|
||||
raise "Specify a version: rake site:releases:new['1.2.3']" unless args.version
|
||||
today = Time.new.strftime('%Y-%m-%d')
|
||||
today = Time.new.strftime("%Y-%m-%d")
|
||||
release = args.version.to_s
|
||||
filename = "#{docs_folder}/_posts/#{today}-jekyll-#{release.split('.').join('-')}-released.markdown"
|
||||
filename = "#{docs_folder}/_posts/#{today}-jekyll-#{release.split(".").join("-")}-released.markdown"
|
||||
|
||||
File.open(filename, "wb") do |post|
|
||||
post.puts("---")
|
||||
post.puts("title: 'Jekyll #{release} Released'")
|
||||
post.puts("date: #{Time.new.strftime('%Y-%m-%d %H:%M:%S %z')}")
|
||||
post.puts("date: #{Time.new.strftime("%Y-%m-%d %H:%M:%S %z")}")
|
||||
post.puts("author: ")
|
||||
post.puts("version: #{release}")
|
||||
post.puts("categories: [release]")
|
||||
|
|
Loading…
Reference in New Issue