spec/helpers/generator.rb in ore-0.7.1 vs spec/helpers/generator.rb in ore-0.7.2

- old
+ new

@@ -8,14 +8,15 @@ ROOT = File.join(Dir.tmpdir,'ore') def generate!(path,options={}) path = File.join(ROOT,path) - Ore::Generator.new( + @generator = Ore::Generator.new( [path], options.merge(:quiet => true) - ).invoke_all + ) + @generator.invoke_all @path = Pathname.new(path) @gemspec = YAML.load_file(@path.join('gemspec.yml')) end @@ -25,19 +26,35 @@ def yard_opts @path.join('.yardopts').read end + def document + unless @document + @document = [] + + @path.join('.document').read.each_line do |line| + unless (line.empty? && line =~ /\s*\#/) + @document << line.strip + end + end + end + + return @document + end + def gitignore - lines = [] + unless @gitignore + @gitignore = [] - @path.join('.gitignore').read.each_line do |line| - unless (line.empty? && line =~ /\s*\#/) - lines << line.strip + @path.join('.gitignore').read.each_line do |line| + unless (line.empty? && line =~ /\s*\#/) + @gitignore << line.strip + end end end - return lines + return @gitignore end def cleanup! FileUtils.rm_r(ROOT) end