Skip to content

Commit

Permalink
Merge pull request #3923 from rubygems/stop_updating_man_pages_month
Browse files Browse the repository at this point in the history
Fix issues when syncronizing man pages
  • Loading branch information
deivid-rodriguez committed Sep 4, 2020
2 parents be3daef + dd7472e commit 16c6b5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 42 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/monthly-bundler.yml

This file was deleted.

13 changes: 10 additions & 3 deletions bundler/Rakefile
Expand Up @@ -93,7 +93,8 @@ namespace :man do
roff = "man/#{File.basename(source, ".ronn")}"

file roff => ["man", ronn] do
sh "bin/ronn --warnings --roff --pipe --date #{Time.now.strftime("%Y-%m-%d")} #{ronn} > #{roff}"
date = ENV["MAN_PAGES_DATE"] || Time.now.strftime("%Y-%m-%d")
sh "bin/ronn --warnings --roff --pipe --date #{date} #{ronn} > #{roff}"
end

task :build_all_pages => roff
Expand Down Expand Up @@ -124,10 +125,16 @@ namespace :man do
end

desc "Build the man pages"
task :build => ["man:clean", "man:build_all_pages"]
task :build => [:clean, :build_all_pages]

desc "Sets target date for building man pages to the one currently present"
task :set_current_date do
require "date"
ENV["MAN_PAGES_DATE"] = Date.parse(File.readlines("man/bundle-add.1")[3].split('"')[5]).strftime("%Y-%m-%d")
end

desc "Verify man pages are in sync"
task :check => :build do
task :check => [:set_current_date, :build] do
require "open3"

output, status = Open3.capture2e("git status --porcelain")
Expand Down

0 comments on commit 16c6b5a

Please sign in to comment.