File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ namespace :docs do
4
+ desc 'Serve the documentation site'
5
+ task :serve do
6
+ within_docs_directory do
7
+ unless system ( 'bundle check' )
8
+ puts "Bundler is not installed or dependencies are not met. Please run 'rake docs:install'."
9
+ exit 1
10
+ end
11
+
12
+ sh 'bundle exec jekyll s'
13
+ end
14
+ end
15
+
16
+ desc 'Install dependencies for the documentation site'
17
+ task :install do
18
+ within_docs_directory do
19
+ sh 'bundle install'
20
+ end
21
+ end
22
+
23
+ def within_docs_directory ( &block )
24
+ Dir . chdir ( 'docs' , &block )
25
+ rescue Errno ::ENOENT => e
26
+ puts "Directory 'docs' not found: #{ e . message } "
27
+ exit 1
28
+ rescue StandardError => e
29
+ puts "An error occurred: #{ e . message } "
30
+ exit 1
31
+ end
32
+ end
You can’t perform that action at this time.
0 commit comments