This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decreased encapsulation to make the tasks more clear
- Loading branch information
Showing
4 changed files
with
36 additions
and
57 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 |
---|---|---|
@@ -1,50 +1,52 @@ | ||
require_relative './rakelib/rake-helper.rb' | ||
# frozen_string_literal: true | ||
|
||
include JekyllRake | ||
include Proofer | ||
include Converter | ||
# This file contains tasks with no namespace. | ||
# All namespaced tasks are defined in the '../rakelib' directory. | ||
# Each namespace is defined in a separate file. | ||
# For example, 'preview:all' is defined in the '../rakelib/preview.rake' file. | ||
# To see the list of tasks to use, run 'rake -T'. | ||
|
||
require 'html-proofer' | ||
require 'kramdown' | ||
require 'launchy' | ||
require 'colorator' | ||
|
||
# Load ruby files with helper methods from the 'rakelib/' directory | ||
require_relative 'rakelib/link-checker.rb' | ||
require_relative 'rakelib/converter.rb' | ||
|
||
desc "Same as 'rake', 'rake preview'" | ||
task default: %w[preview] | ||
|
||
desc "Same as 'test:report'" | ||
task test: %w[test:report] | ||
|
||
desc "Preview the devdocs locally" | ||
desc 'Preview the devdocs locally' | ||
task preview: %w[install clean] do | ||
print "Generating devdocs locally ... ".magenta | ||
if File.exists?('_config.local.yml') | ||
print "enabled the additional configuration parameters from _config.local.yml: $ ".magenta | ||
preview_local | ||
puts 'Generating devdocs locally ... '.magenta | ||
if File.exist?('_config.local.yml') | ||
print 'enabled the additional configuration parameters from _config.local.yml: $ '.magenta | ||
sh 'bundle exec jekyll serve --incremental --open-url --livereload --trace --config _config.yml,_config.local.yml' | ||
else | ||
print "enabled the default configuration; generating the entire devdocs $ ".magenta | ||
preview | ||
Rake::Task['preview:all'].invoke | ||
end | ||
end | ||
|
||
desc "Remove the generated content" | ||
task :clean do | ||
print "Cleaning after the last site generation: $ ".magenta | ||
jekyll 'clean' | ||
puts "Clean!".green | ||
print 'Cleaning after the last site generation: $ '.magenta | ||
sh 'bundle exec jekyll clean' | ||
puts 'Clean!'.green | ||
end | ||
|
||
desc "Install gems listed in the Gemfile" | ||
task :install do | ||
print "Install gems listed in the Gemfile: $ ".magenta | ||
print 'Install gems listed in the Gemfile: $ '.magenta | ||
sh 'bundle install' | ||
puts "Installed!".green | ||
puts 'Installed!'.green | ||
end | ||
|
||
desc "Build the entire website" | ||
desc 'Build the entire website' | ||
task build: %w[clean] do | ||
print 'Building the site with Jekyll: $ '.magenta | ||
jekyll 'build --verbose' | ||
sh 'bundle exec jekyll build --verbose --trace' | ||
puts 'Built!'.green | ||
end | ||
|
||
desc "Checkout to the master branch" | ||
task :to_master do | ||
print 'Checking out the branch to master: $ '.magenta | ||
sh 'git checkout master' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
namespace :preview do | ||
desc 'Preview the entire devdocs locally' | ||
task all: %w[install clean] do | ||
puts "Generating the entire devdocs locally ... ".magenta | ||
preview | ||
end | ||
end | ||
desc 'Preview the entire devdocs locally' | ||
task all: %w[install clean] do | ||
print 'Enabled the default configuration: $ '.magenta | ||
sh 'bundle exec jekyll serve --incremental --open-url --livereload --trace' | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.