Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Two bugfixes: display output when there are no comments, allow non-UTF-8 encodings #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Jan 9, 2012

  1. Display output even if there are no comments

    Rocco should display the code even if there are no comments.  When there are
    no comments, it produces a single section with an empty docs string.
    However, to pass it through Markdown, it joins the sections with a
    delimiter, munges that, and split the result.  Joining a list continaing the
    empty string and splitting it again produces an empty list, not a list
    containting the empty string:
    
     > [""].join("delim").split("delim")
     => []
    
    In Ruby 1.9, this causes us lose the associated code when when try to zip
    these lists back together again:
    
     > [].zip(["something"])
     => []
    
    To fix this, just make sure `docs_html` contains at least a single empty
    string if it winds up being empty.
    
    Fixes: rtomayko#71 (fix rtomayko#71)
    lambda committed Jan 9, 2012
    Configuration menu
    Copy the full SHA
    d0ae272 View commit details
    Browse the repository at this point in the history
  2. Allow user to set encoding of files, transcoding to UTF-8

    Ruby 1.9 is much more strict about encodings; instead of just reading bytes
    into the string and hoping you know how to interpret it, it actually keeps
    track of what encoding it expects the file and the string to be and
    transcodes between them. This means that we can no longer just read in the
    ISO-8859-1 as binary, and kind of hope that everything later on ignores it
    or knows how to cope. Instead, we need to explicitly choose to read the
    file as ISO-8859-1, and explicitly choose the encoding that we want the
    string to be in.  We use UTF-8, because that's what Pygments and at least
    some of the Markdown libraries are expecting.
    
    Fixes: rtomayko#73 (fix rtomayko#73)
    lambda committed Jan 9, 2012
    Configuration menu
    Copy the full SHA
    b39f821 View commit details
    Browse the repository at this point in the history
  3. Add back missing /docs to .gitignore

    Commit 854f62c (The default gitignore provided by `bundler gem`) replaced
    .gitignore with a generated one, but that blew away the .gitignore line for
    /docs.  Add it back in.
    lambda committed Jan 9, 2012
    Configuration menu
    Copy the full SHA
    e2efb22 View commit details
    Browse the repository at this point in the history