Skip to content
This repository
Browse code

[guides] Add rake task to show help and make it the default one

  • Loading branch information...
commit db57e6d12353e615af9f4078dc8590484b2444e8 1 parent e6d7eea
Rafael Magana authored

Showing 1 changed file with 50 additions and 0 deletions. Show diff stats Hide diff stats

  1. +50 0 guides/Rakefile
50 guides/Rakefile
@@ -24,4 +24,54 @@ namespace :guides do
24 24 ruby "w3c_validator.rb"
25 25 end
26 26
  27 + desc "Show help"
  28 + task :help do
  29 + puts <<-help
  30 +
  31 +Guides are generated with the rails_guides/generator.rb script, it can be invoked
  32 +directly or via the guides:generate rake task. Here's a full list of available tasks:
  33 +
  34 +#{%x[rake -T]}
  35 +Guides are taken from the source directory, and the resulting HTML goes into the
  36 +output directory. Assets are stored under files, and copied to output/files as
  37 +part of the generation process.
  38 +
  39 +Some arguments may be passed via environment variables:
  40 +
  41 + WARNINGS=1
  42 + Internal links (anchors) are checked, also detects duplicated IDs.
  43 +
  44 + ALL=1
  45 + Force generation of all guides.
  46 +
  47 + ONLY=name
  48 + Useful if you want to generate only one or a set of guides.
  49 +
  50 + Generate only association_basics.html:
  51 + ONLY=assoc
  52 +
  53 + Separate many using commas:
  54 + ONLY=assoc,migrations
  55 +
  56 + GUIDES_LANGUAGE
  57 + Use it when you want to generate translated guides in
  58 + source/<GUIDES_LANGUAGE> folder (such as source/es)
  59 +
  60 + EDGE=1
  61 + Indicate generated guides should be marked as edge.
  62 +
  63 + KINDLE=1
  64 + Generate .mobi with all the guides.
  65 +
  66 +Examples:
  67 + $ ALL=1 ruby rails_guides.rb
  68 + $ rake guides:generate ALL=1
  69 + $ rake guides:generate KINDLE=1
  70 + $ rake guides:generate:kindle
  71 + $ rake guides:generate EDGE=1
  72 + $ rake guides:generate GUIDES_LANGUAGE=es
  73 + help
  74 + end
27 75 end
  76 +
  77 +task :default => 'guides:help'

0 comments on commit db57e6d

Please sign in to comment.
Something went wrong with that request. Please try again.