Sha256: 0d7879467d6b0175da85d138b65ea0f86e935f6f22aa3aead7aae959b6a3f9bc
Contents?: true
Size: 847 Bytes
Versions: 19
Compression:
Stored size: 847 Bytes
Contents
module SmallCage::Commands class Manifest def self.execute(opts) self.new(opts).execute end def initialize(opts) @opts = opts end def execute entries = [] root = Pathname.new(@opts[:path]) Dir.chdir(root) do Dir.glob("**/*") do |f| entries << f end end tmp = [] entries.each do |f| path = root + f f = "./" + f if path.directory? f = f + "/" end next if path.basename.to_s == "Manifest.html" tmp << f end entries = tmp template = File.dirname(__FILE__) + "/../resources/Manifest.erb" source = ERB.new(File.read(template), nil, "-").result(binding) open(root + "Manifest.html", "w") do |io| io << source end end end end
Version data entries
19 entries across 19 versions & 2 rubygems