Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Incorporate GeneratePryMan into pry. #785

Merged
merged 7 commits into from

4 participants

@rondale-sc

I've included the class and associated files into a directory nested inside the man directory (see: rondale-sc@28a43fe)

There is now a new rake task that calls this class called generate_man_page in the top level rake namespace. (see: rondale-sc@d47f3e8)

I ran the task to update the man-pages (see: rondale-sc@d47f3e8)

The idea here is to make sure the man-page is filled with useful information. If you want to alter the man page it's really simple now:

Adding a section

  1. Open up man/generate_pry_man/templates/pry.1.erb
  2. Add a header for the section you'd like to add
    • Be sure to prefix with ##(pound pound)
    • Then a newline, and a set of erb tags `<%= @man_sections[:section_name] %>
    • Be sure to replace :section_name with the name of your section.
  3. Create a file in `man/generate_pry_man/templates/man_sections/.md
    • It is important to note that the name must be exactly the same as the symbol you passed to @man_sections.
  4. Write markdown in your newly created file.
  5. Run rake generate_man_page

Editing a section

  1. Open up man/templates/man_section/<name_of_section_you_want_to_edit>.md
  2. Edit the Markdown to tast.
  3. Run `rake generate_man_page

Caveats

  1. I added a dependency to the development environment in the Gemfile, though it is not required until it's needed
    • Dependency is on a gem called ronn, a nice gem for converting markdown into .roff files.
  2. The tests are slightly brittle because I'm relying on the output to match canned fixtures. So to get the tests to be valid again you'll have to copy in the output from your newly created .roff and .html files and then manually inspect them for correctness. Once that's done you're tests will pass again.
  3. Some work will be needed in the future if we need/want to create other man sections
    • ie. Currently we create PRY (1), to create PRY (2) or Pry (5) work will need to be done.
    • I think having just a section 1 makes sense (see my comment here for more info: #769)

Alright I think that's enough. Let me know if you'd like me to change anything, or if I need to restructure somehow.

Also, many thanks to irc#pry people for helping!

Jonathan Jac... added some commits
Jonathan Jackson Update man page with a Pry Commands section
Pry commands were listed using Pry version 0.9.10 on Ruby 1.9.3
0a2b078
Jonathan Jackson Incorporate generate_pry_man into pry. 28a43fe
Jonathan Jackson Add rake generate_man rake task. d47f3e8
Jonathan Jackson update man-pages 9aee82a
Jonathan Jackson Move instead of copy the generated files.
Renamed the method copy_to_man_dir to move_to_man_dir.  And changed the
Rakefile to call by new name.  This clears out 3 additional files per
run.
1891839
Jonathan Jackson Update initialize hash to use old hash syntax. 774b191
Jonathan Jackson Update Gemfile to include ronn only in ruby environments
Also exclude tests from running in jruby since ronn has a dependency on
rdiscount (a c-extension).
ba7581d
@banister banister referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@banister banister merged commit cbb2418 into pry:master
@banister
Owner

thanks, how do i install the man page?

@banister
Owner

Merging your commit causes test failures, can u fix these please? https://travis-ci.org/pry/pry/builds/3900587

:)

@banister
Owner

nm, it was reverted, fix the tests and we'll remerge at that point :)

@rondale-sc

Sure I'll take a look. I thought travis-ci was passing on the most recent commit though. Weird.

@rf-
Owner
rf- commented

btw @rondale-sc we need to figure out a better way of excluding JRuby from these tests. The exit made it skip most of the tests: https://travis-ci.org/pry/pry/jobs/3900594

@rondale-sc

I'll look at this as soon as I get some time.

@rf- I'm not sure the correct way. With rspec it'd be something like

describe "Something", :unless => RUBY_PLATFORM == "java" do
   ...
end

but with bacon I wasn't able to use implicit filters (https://www.relishapp.com/rspec/rspec-core/v/2-2/docs/filtering/implicit-filters).

@banister I'll have to figure out about the tests when I can properly sit down at my computer. Sorry for the failing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2012
  1. Update man page with a Pry Commands section

    Jonathan Jackson authored
    Pry commands were listed using Pry version 0.9.10 on Ruby 1.9.3
Commits on Dec 21, 2012
  1. Incorporate generate_pry_man into pry.

    Jonathan Jackson authored
  2. Add rake generate_man rake task.

    Jonathan Jackson authored
  3. update man-pages

    Jonathan Jackson authored
Commits on Dec 28, 2012
  1. Move instead of copy the generated files.

    Jonathan Jackson authored
    Renamed the method copy_to_man_dir to move_to_man_dir.  And changed the
    Rakefile to call by new name.  This clears out 3 additional files per
    run.
  2. Update initialize hash to use old hash syntax.

    Jonathan Jackson authored
  3. Update Gemfile to include ronn only in ruby environments

    Jonathan Jackson authored
    Also exclude tests from running in jruby since ronn has a dependency on
    rdiscount (a c-extension).
Something went wrong with that request. Please try again.