Sha256: d7a1f476322ff68eeacc365b873c9c389b1d63396afa80a62a17d75fb7e06165
Contents?: true
Size: 589 Bytes
Versions: 11
Compression:
Stored size: 589 Bytes
Contents
require 'pp' $root = File.expand_path('../../', __FILE__) require "#{$root}/lib/stasis/gems" Stasis::Gems.activate :rspec require "#{$root}/lib/stasis" def generate(options={}) $files = nil if options[:reload] $fixture = "#{$root}/spec/fixtures/project" unless $files $stasis ||= Stasis.new($fixture) $stasis.render(*options[:only]) generate_files end end def generate_files pub = "#{$fixture}/public" $files = Dir["#{pub}/**/*"].inject({}) do |hash, path| if File.file?(path) hash[path[pub.length+1..-1]] = File.read(path) end hash end end
Version data entries
11 entries across 11 versions & 1 rubygems