Skip to content

long_desc: force keeping spaces and not break lines #398

@mdesantis

Description

@mdesantis

Hello,

I have a long_desc method like this:

long_desc <<-LONGDESC.gsub("\n", "\x5")
  Examples:

  bin/ruby-rails-documentations                             \\
    generate ~/ruby-rails-documentations                    \\
    --sdoc-dir=~/sdoc --ruby-dir=~/ruby --rails-dir=~/rails \\
    --ruby-versions=1.9.3p484 2.0.0p353 2.1.0               \\
    --rails-versions=3.0.20 3.1.12 3.2.16 4.0.2 4.1.0.beta1
LONGDESC
def generate(output_dir)
  ...
end

Executing ruby-rails-documentations help generate I want my output to be like this:

Examples:

bin/ruby-rails-documentations                             \
  generate ~/ruby-rails-documentations                    \
  --sdoc-dir=~/sdoc --ruby-dir=~/ruby --rails-dir=~/rails \
  --ruby-versions=1.9.3p484 2.0.0p353 2.1.0               \
  --rails-versions=3.0.20 3.1.12 3.2.16 4.0.2 4.1.0.beta1

Instead, I get this:

Examples:

bin/ruby-rails-documentations \
 generate ~/ruby-rails-documentations \
 --sdoc-dir=~/sdoc --ruby-dir=~/ruby --rails-dir=~/rails \
 --ruby-versions=1.9.3p484 2.0.0p353 2.1.0 \
 --rails-versions=3.0.20 3.1.12 
3.2.16 4.0.2 4.1.0.beta1

The merged spaces is not a big problem, but the added newlines is - they break the command syntax, and I can't predict where they will be.

Is there any way to force keeping spaces and, above all, force to not break lines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions