Skip to content

Commit

Permalink
Added a tasks/ directory for extra rake tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jul 15, 2024
1 parent 1706e78 commit fb06b8b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
22 changes: 4 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
require 'yaml'
require 'date'

root = File.dirname(__FILE__)
config = YAML.load_file(File.join(root,'_config.yml'))
libraries = config['libraries']
ROOT = File.dirname(__FILE__)
CONFIG = YAML.load_file(File.join(ROOT,'_config.yml'))
LIBRARIES = CONFIG['libraries']

namespace :docs do
libraries.each_key do |library|
namespace :sync do
desc "Syncs the documentation for #{library}"
task(library) do
library_doc_dir = "docs/#{library}"

sh 'git', 'rm', '-r', library_doc_dir
sh 'cp', '-r', "../#{library}/doc", "#{library_doc_dir}"
sh 'git', 'add', library_doc_dir
sh 'git', 'commit', library_doc_dir
end
end
end
end
Rake.add_rakelib 'tasks'
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ permalink: date

exclude:
- Rakefile
- tasks

discord_link: https://discord.gg/6WAb3PsVX9
merch_link: https://merch.ronin-rb.dev
Expand Down
15 changes: 15 additions & 0 deletions tasks/docs.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace :docs do
LIBRARIES.each_key do |library|
namespace :sync do
desc "Syncs the documentation for #{library}"
task(library) do
library_doc_dir = "docs/#{library}"

sh 'git', 'rm', '-r', library_doc_dir
sh 'cp', '-r', "../#{library}/doc", "#{library_doc_dir}"
sh 'git', 'add', library_doc_dir
sh 'git', 'commit', library_doc_dir
end
end
end
end

0 comments on commit fb06b8b

Please sign in to comment.