Class: Manic
- Inherits:
-
Object
- Object
- Manic
- Defined in:
- lib/manic.rb,
lib/manic/base.rb,
lib/manic/config.rb,
lib/manic/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
Version number
"0.0.1"
Class Method Summary collapse
Class Method Details
.config(&block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/manic.rb', line 5 def self.config(&block) Config.new.instance_eval(&block) Dir.glob("#{Manic::Base.site_root}/**/*").each do |file| new_file = File.path(file).split("/") new_file = new_file.size > 1 ? new_file.pop : new_file new_file = new_file.split(".")[0] + ".html" result = Tilt.new(file).render(Manic::Base, :current_file => file) File.open("#{Manic::Base.output_root}/#{new_file}", 'w') {|f| f.write(result) } puts "Parsing #{File.path(file)} into #{Manic::Base.output_root}/#{File.path(new_file)}" end end |