-
-
Save drbrain/5259624 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rdoc' | |
class RDoc::Options | |
attr_accessor :you | |
attr_accessor :me | |
end | |
class MyGen | |
RDoc::RDoc.add_generator self | |
attr_reader :options | |
attr_reader :store | |
def self.setup_options(options) | |
options.you = "you" | |
options.me = "me" | |
opt = options.option_parser | |
opt.separator nil | |
opt.separator "MyGen generator options:" | |
opt.separator nil | |
opt.on("--you", "-y", "Set your name") do |value| | |
options.you = value | |
end | |
opt.separator nil | |
opt.on("--me", "-m", "Set my name") do |value| | |
options.me = value | |
end | |
opt.separator nil | |
puts options.me | |
puts options.you | |
end | |
def initialize(store, options) | |
@store = store | |
@options = options | |
end | |
end | |
#options = RDoc::Options.new | |
#options.setup_generator 'mygen' | |
#ARGV.push('--format=mygen') if ARGV.grep(/\A(-f|--fmt|--format|-r|-R|--ri|--ri-site)\b/).empty? | |
RDoc::RDoc.new.document ARGV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment