Skip to content

Commit

Permalink
Merge pull request #3921 from rubygems/remove_txt_docs
Browse files Browse the repository at this point in the history
Improve human readable fallback version of CLI help messages

(cherry picked from commit b7cabde)
  • Loading branch information
deivid-rodriguez committed Oct 5, 2020
1 parent 39b3407 commit 596b40a
Show file tree
Hide file tree
Showing 60 changed files with 74 additions and 3,414 deletions.
74 changes: 24 additions & 50 deletions Manifest.txt
Expand Up @@ -252,81 +252,55 @@ bundler/lib/bundler/vlad.rb
bundler/lib/bundler/worker.rb
bundler/lib/bundler/yaml_serializer.rb
bundler/man/bundle-add.1
bundler/man/bundle-add.1.txt
bundler/man/bundle-add.ronn
bundler/man/bundle-add.1.ronn
bundler/man/bundle-binstubs.1
bundler/man/bundle-binstubs.1.txt
bundler/man/bundle-binstubs.ronn
bundler/man/bundle-binstubs.1.ronn
bundler/man/bundle-cache.1
bundler/man/bundle-cache.1.txt
bundler/man/bundle-cache.ronn
bundler/man/bundle-cache.1.ronn
bundler/man/bundle-check.1
bundler/man/bundle-check.1.txt
bundler/man/bundle-check.ronn
bundler/man/bundle-check.1.ronn
bundler/man/bundle-clean.1
bundler/man/bundle-clean.1.txt
bundler/man/bundle-clean.ronn
bundler/man/bundle-clean.1.ronn
bundler/man/bundle-config.1
bundler/man/bundle-config.1.txt
bundler/man/bundle-config.ronn
bundler/man/bundle-config.1.ronn
bundler/man/bundle-doctor.1
bundler/man/bundle-doctor.1.txt
bundler/man/bundle-doctor.ronn
bundler/man/bundle-doctor.1.ronn
bundler/man/bundle-exec.1
bundler/man/bundle-exec.1.txt
bundler/man/bundle-exec.ronn
bundler/man/bundle-exec.1.ronn
bundler/man/bundle-gem.1
bundler/man/bundle-gem.1.txt
bundler/man/bundle-gem.ronn
bundler/man/bundle-gem.1.ronn
bundler/man/bundle-info.1
bundler/man/bundle-info.1.txt
bundler/man/bundle-info.ronn
bundler/man/bundle-info.1.ronn
bundler/man/bundle-init.1
bundler/man/bundle-init.1.txt
bundler/man/bundle-init.ronn
bundler/man/bundle-init.1.ronn
bundler/man/bundle-inject.1
bundler/man/bundle-inject.1.txt
bundler/man/bundle-inject.ronn
bundler/man/bundle-inject.1.ronn
bundler/man/bundle-install.1
bundler/man/bundle-install.1.txt
bundler/man/bundle-install.ronn
bundler/man/bundle-install.1.ronn
bundler/man/bundle-list.1
bundler/man/bundle-list.1.txt
bundler/man/bundle-list.ronn
bundler/man/bundle-list.1.ronn
bundler/man/bundle-lock.1
bundler/man/bundle-lock.1.txt
bundler/man/bundle-lock.ronn
bundler/man/bundle-lock.1.ronn
bundler/man/bundle-open.1
bundler/man/bundle-open.1.txt
bundler/man/bundle-open.ronn
bundler/man/bundle-open.1.ronn
bundler/man/bundle-outdated.1
bundler/man/bundle-outdated.1.txt
bundler/man/bundle-outdated.ronn
bundler/man/bundle-outdated.1.ronn
bundler/man/bundle-platform.1
bundler/man/bundle-platform.1.txt
bundler/man/bundle-platform.ronn
bundler/man/bundle-platform.1.ronn
bundler/man/bundle-pristine.1
bundler/man/bundle-pristine.1.txt
bundler/man/bundle-pristine.ronn
bundler/man/bundle-pristine.1.ronn
bundler/man/bundle-remove.1
bundler/man/bundle-remove.1.txt
bundler/man/bundle-remove.ronn
bundler/man/bundle-remove.1.ronn
bundler/man/bundle-show.1
bundler/man/bundle-show.1.txt
bundler/man/bundle-show.ronn
bundler/man/bundle-show.1.ronn
bundler/man/bundle-update.1
bundler/man/bundle-update.1.txt
bundler/man/bundle-update.ronn
bundler/man/bundle-update.1.ronn
bundler/man/bundle-viz.1
bundler/man/bundle-viz.1.txt
bundler/man/bundle-viz.ronn
bundler/man/bundle-viz.1.ronn
bundler/man/bundle.1
bundler/man/bundle.1.txt
bundler/man/bundle.ronn
bundler/man/bundle.1.ronn
bundler/man/gemfile.5
bundler/man/gemfile.5.ronn
bundler/man/gemfile.5.txt
bundler/man/index.txt
hide_lib_for_update/note.txt
lib/rubygems.rb
lib/rubygems/available_set.rb
Expand Down
17 changes: 5 additions & 12 deletions bundler/Rakefile
Expand Up @@ -88,24 +88,17 @@ namespace :man do
else
directory "man"

index = []
sources = Dir["man/*.ronn"].map {|f| File.basename(f, ".ronn") }
sources.map do |basename|
ronn = "man/#{basename}.ronn"
manual_section = ".1" unless basename =~ /\.(\d+)\Z/
roff = "man/#{basename}#{manual_section}"

index << [ronn, File.basename(roff)]
index = Dir["man/*.ronn"].map do |source|
ronn = "man/#{File.basename(source)}"
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}"
end

file "#{roff}.txt" => roff do
sh "groff -Wbreak -mtty-char -mandoc -Tascii -rHY=0 #{roff} | col -xb > #{roff}.txt"
end
task :build_all_pages => roff

task :build_all_pages => "#{roff}.txt"
[ronn, File.basename(roff)]
end

file "index.txt" do
Expand Down
20 changes: 8 additions & 12 deletions bundler/doc/development/SETUP.md
Expand Up @@ -2,33 +2,29 @@

To work on Bundler, you'll probably want to do a couple of things:

1. [Fork the Rubygems repo](https://github.com/rubygems/rubygems), and clone the fork onto your machine. ([Follow this tutorial](https://help.github.com/articles/fork-a-repo/) for instructions on forking a repo.)
* [Fork the Rubygems repo](https://github.com/rubygems/rubygems), and clone the fork onto your machine. ([Follow this tutorial](https://help.github.com/articles/fork-a-repo/) for instructions on forking a repo.)

2. Install `groff-base` and `graphviz` packages using your package manager:
* Install `graphviz` package using your package manager:

$ sudo apt-get install graphviz groff-base -y
$ sudo apt-get install graphviz -y

And for OS X (with brew installed):

$ brew install graphviz groff
$ brew install graphviz

3. You may also have to install the `bsdmainutils` package on linux if your distribution does not include the `col` command.

$ sudo apt-get install bsdmainutils -y

4. Install Bundler's development dependencies:
* Install Bundler's development dependencies:

$ bin/rake spec:deps

5. Run the test suite, to make sure things are working:
* Run the test suite, to make sure things are working:

$ bin/rake spec

6. Optionally, you can run the test suite in parallel:
* Optionally, you can run the test suite in parallel:

$ bin/parallel_rspec

7. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias ([follow these instructions](https://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/) for adding aliases to your `~/.bashrc` profile):
* Set up a shell alias to run Bundler from your clone, e.g. a Bash alias ([follow these instructions](https://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/) for adding aliases to your `~/.bashrc` profile):

$ alias dbundle='/path/to/bundler/repo/bin/bundle'

Expand Down
4 changes: 2 additions & 2 deletions bundler/doc/documentation/WRITING.md
Expand Up @@ -22,7 +22,7 @@ Don't see a man page for a command? Make a new page and send us a PR! We also we

To create a new man page, simply create a new `.ronn` file in the `man/` directory.

For example: to create a man page for the command `bundle cookies` (not a real command, sadly), I would create a file `man/bundle-cookies.ronn` and add my documentation there.
For example: to create a man page for the command `bundle cookies` (not a real command, sadly), I would create a file `man/bundle-cookies.1.ronn` and add my documentation there.

## Formatting

Expand All @@ -44,7 +44,7 @@ $ rake man:build
$ man man/bundle-cookies.1
```

If you make more changes to `bundle-cookies.ronn`, you'll need to run the `rake man:build` again before previewing.
If you make more changes to `bundle-cookies.1.ronn`, you'll need to run the `rake man:build` again before previewing.

## Testing

Expand Down
2 changes: 1 addition & 1 deletion bundler/lib/bundler/cli.rb
Expand Up @@ -134,7 +134,7 @@ def help(cli = nil)
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
Kernel.exec "man #{man_page}"
else
puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.txt")
puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.ronn")
end
elsif command_path = Bundler.which("bundler-#{cli}")
Kernel.exec(command_path, "--help")
Expand Down
File renamed without changes.
58 changes: 0 additions & 58 deletions bundler/man/bundle-add.1.txt

This file was deleted.

File renamed without changes.
47 changes: 0 additions & 47 deletions bundler/man/bundle-binstubs.1.txt

This file was deleted.

File renamed without changes.
78 changes: 0 additions & 78 deletions bundler/man/bundle-cache.1.txt

This file was deleted.

File renamed without changes.

0 comments on commit 596b40a

Please sign in to comment.