Using Rake to Build Gem

Discussion in 'Ruby' started by Bryan Richardson, Apr 17, 2008.

  1. [Note: parts of this message were removed to make it a legal post.]

    Hello all,

    I'm using Rake to build a gem for my Ruby application and I was wondering if
    there's a way to exclude certain files and/or directories from rdoc
    generation.

    --
    Thanks!
    Bryan
     
    Bryan Richardson, Apr 17, 2008
    #1
    1. Advertising

  2. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Bryan Richardson wrote:
    | Hello all,
    |
    | I'm using Rake to build a gem for my Ruby application and I was
    wondering if
    | there's a way to exclude certain files and/or directories from rdoc
    | generation.

    Here's an example from the Rakefile I use for one of my projects:
    ~ g.files = FileList['lib/**/*.rb', '[A-Z]*',
    'test/**/*'].exclude('smtp_tls.rb').to_a

    #exclude from Rake's FileList makes sure that 'smtp_tls.rb' isn't used.

    AFAIK, #exclude can use an Array, too, if you want to exclude multiple
    files (I don't know about globs, though).

    - --
    Phillip Gawlowski
    Twitter: twitter.com/cynicalryan

    ~ "To make a bad day worse, spend it wishing for the impossible." -Calvin
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.8 (MingW32)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iEYEARECAAYFAkgHa7YACgkQbtAgaoJTgL+C0ACgojLcMzhwfepSsB+aCRVfMNc5
    I6IAn06WndJ0WekjY1VbddfOJwIlNdB1
    =P1mS
    -----END PGP SIGNATURE-----
     
    Phillip Gawlowski, Apr 17, 2008
    #2
    1. Advertising

  3. Bryan Richardson

    Tim Pease Guest

    On Apr 17, 2008, at 8:50 AM, Bryan Richardson wrote:
    > Hello all,
    >
    > I'm using Rake to build a gem for my Ruby application and I was
    > wondering if
    > there's a way to exclude certain files and/or directories from rdoc
    > generation.
    >


    Take a look at Mr Bones. It provides a skeleton for Ruby projects, and
    it is not viral -- you won't have to include Mr Bones as a dependency
    to use your gem. The project skeleton has a collection of rake tasks
    for managing your project including building a gem. You can explicitly
    include or exclude files for rdoc generation ...

    PROJ.rdoc.exclude = %w[^some/dir/ \.tmp$]
    PROJ.rdoc.include = %w[\.txt$]

    the syntax here is just an array of regexp snippets specifying the
    file types you want to ignore or include.

    http://bones.rubyforge.org/

    If you just want the rake tasks and Rakefile, create a throw away
    project using the "bones" command line. Copy the "tasks" folder and
    the Rakefile to your project.

    Blessings,
    TwP
     
    Tim Pease, Apr 17, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Van Dyk
    Replies:
    2
    Views:
    117
    Damphyr
    Jan 31, 2006
  2. Austin 7873
    Replies:
    5
    Views:
    216
    Eric Hodel
    Jan 27, 2007
  3. peppermonkey
    Replies:
    1
    Views:
    268
    Gregory Brown
    Feb 10, 2007
  4. Adam Anderson
    Replies:
    1
    Views:
    147
    Adam Anderson
    Sep 19, 2007
  5. thufir
    Replies:
    3
    Views:
    233
    Thufir
    Apr 12, 2008
Loading...

Share This Page