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

Version Path
stasis-0.1.10 spec/spec_helper.rb
stasis-0.1.9 spec/spec_helper.rb
stasis-0.1.8 spec/spec_helper.rb
stasis-0.1.7 spec/spec_helper.rb
stasis-0.1.6 spec/spec_helper.rb
stasis-0.1.5 spec/spec_helper.rb
stasis-0.1.4 spec/spec_helper.rb
stasis-0.1.3 spec/spec_helper.rb
stasis-0.1.2 spec/spec_helper.rb
stasis-0.1.1 spec/spec_helper.rb
stasis-0.1.0 spec/spec_helper.rb