Class: Prez::Build
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Prez::Build
- Includes:
- Builder, Thor::Actions
- Defined in:
- lib/prez/build.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
59 60 61 |
# File 'lib/prez/build.rb', line 59 def source_root File.absolute_path File.("../../../templates", __FILE__) end |
Instance Method Details
#check_file! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/prez/build.rb', line 10 def check_file! if File.exists? prez_name @filename = prez_name elsif File.exists? "#{prez_name}.prez" @filename = "#{prez_name}.prez" else raise Prez::Error.new("Missing prez file '#{prez_name}'") end if filename =~ /\.html$/ raise Prez::Error.new("Prez file cannot be an html file: '#{prez_name}'") end end |
#generate_html ⇒ Object
24 25 26 |
# File 'lib/prez/build.rb', line 24 def generate_html create_file html_filename, build_html(filename) end |