Sha256: 8866f49632cdb4d0f79a2f72ae43dc3d9a47456d1b96e621cac98dc13c6b3a3e
Contents?: true
Size: 999 Bytes
Versions: 1
Compression:
Stored size: 999 Bytes
Contents
require 'tempfile' Dir["#{File.dirname(__FILE__)}/generators/*.rb"].each { |c| require c } module Stastic module Generator extend self GENERATOR_TYPES = %w(jekyll default) EXCLUDE_LIST = [ ".stastic", ".git", ".svn", ".DS_Store", "*.php", "*.rb", "*.haml", "*.sass", "*.pl", "*.py", "*.asp"] def detect GENERATOR_TYPES.each do |type| generator = eval("Stastic::Generator::#{type.capitalize}") return generator if(generator.send(:detect)) end end def package(dir) tmpfile = Tempfile.new('st-archive') system "cd #{dir} && tar -cjf #{tmpfile.path} -X #{exclude_file(dir)} . " tmpfile.path end private def exclude_file(dir) tmpfile = Tempfile.new('st-exclude') EXCLUDE_LIST.each do |pattern| tmpfile << "#{pattern}\n" end tmpfile.flush tmpfile.close tmpfile.path end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
stastic-0.2.0 | lib/stastic/generator.rb |