Sha256: 67bbfb1ddf2109e562321ff4c1cfe7e8a341849e473a5652e13ca7c8f9f7ffe7

Contents?: true

Size: 824 Bytes

Versions: 5

Compression:

Stored size: 824 Bytes

Contents

require 'tempfile'
require 'pathname'
require 'yaml'
require 'fileutils'

module Helpers
  module Generator
    ROOT = File.join(Dir.tmpdir,'ore')

    def generate!(path,options={})
      path = File.join(ROOT,path)

      Ore::Generator.new(
        [path],
        options.merge(:quiet => true)
      ).invoke_all

      @path = Pathname.new(path)
      @gemspec = YAML.load_file(@path.join('gemspec.yml'))
    end

    def rspec_opts
      @path.join('.rspec').read
    end

    def yard_opts
      @path.join('.yardopts').read
    end

    def gitignore
      lines = []

      @path.join('.gitignore').read.each_line do |line|
        unless (line.empty? && line =~ /\s*\#/)
          lines << line.strip
        end
      end

      return lines
    end

    def cleanup!
      FileUtils.rm_r(ROOT)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ore-0.7.1 spec/helpers/generator.rb
ore-0.7.0 spec/helpers/generator.rb
ore-0.6.0 spec/helpers/generator.rb
ore-0.5.0 spec/helpers/generator.rb
ore-0.4.1 spec/helpers/generator.rb