class Rain::CLI
Public Instance Methods
generate(*sources)
click to toggle source
# File lib/rain.rb, line 15 def generate(*sources) print "Rain is parsing files in the directories #{sources} \n" # loop through all of the file sources and generate docs all_docs = [] sources.each do |source| print "Parsing #{source} \n" @doc = Rain::Doc.new(source, File.read(Dir.pwd + "/#{source}"), options[:log_parse].nil? ? false : true, options[:parse_signatures].nil? ? false : true) @doc.parse all_docs << @doc end # load the rainopts.yml file from local location (if it exists). otherwise use the default # one from the gem dir. if File.exist?('./rainopts.yml') rainopts = YAML.load_file('./rainopts.yml') else spec = Gem::Specification.find_by_name("rain-doc") rainopts = File.read(spec.gem_dir + '/rainopts.yml') end print "\nBuilding html output... \n" Rain::Output.new.build_html(all_docs, rainopts) print "\nDone! See rain_out/ directory for output.\n" end
help()
click to toggle source
# File lib/rain.rb, line 44 def help print " _ \n" print " _( )_ \n" print " _( )_ \n" print " (_________) \n" print " \\ \\ \\ \\ \n" print " \\ \\ \\ \\ \n" print " \n" print "---- RAIN ----\n" print " \n" print "basic usage:\n" print " rain generate file/**/*.rb\n" print "options:\n" print " --lp logs all line parsing output to console\n" print " --s generates docs for methods and class signatures\n" end