Sha256: 91d74c17645d653985e5d4c8c279c9faac8025a304a5498902192fdbb131ca3f

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

require "pp"
require "bundler"

Bundler.setup(:default)
Bundler.require(:development)

$root = File.expand_path('../../', __FILE__)
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] ].flatten.compact)
    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

6 entries across 6 versions & 1 rubygems

Version Path
stasis-0.1.16 spec/spec_helper.rb
stasis-0.1.15 spec/spec_helper.rb
stasis-0.1.14 spec/spec_helper.rb
stasis-0.1.13 spec/spec_helper.rb
stasis-0.1.12 spec/spec_helper.rb
stasis-0.1.11 spec/spec_helper.rb