lib/kitabu/generator.rb in kitabu-1.0.6 vs lib/kitabu/generator.rb in kitabu-2.0.0

- old
+ new

@@ -12,26 +12,20 @@ def self.source_root File.dirname(__FILE__) + "/../../templates" end - def copy_html_templates - copy_file "layout.erb" , "templates/html/layout.erb" - copy_file "layout.css" , "templates/html/layout.css" - copy_file "user.css" , "templates/html/user.css" - copy_file "syntax.css" , "templates/html/syntax.css" + def copy_templates + directory "templates", "templates" end - def copy_epub_templates - copy_file "cover.erb" , "templates/epub/cover.erb" - copy_file "epub.css" , "templates/epub/user.css" - copy_file "epub.erb" , "templates/epub/page.erb" - copy_file "cover.png" , "templates/epub/cover.png" + def copy_sample_texts + directory "text", "text" end - def copy_sample_page - copy_file "sample.md" , "text/01_Welcome.md" + def copy_images + directory "images", "images" end def copy_config_file @name = full_name @uid = Digest::MD5.hexdigest("#{Time.now}--#{rand}") @@ -42,30 +36,24 @@ def copy_helper_file copy_file "helper.rb", "config/helper.rb" end def copy_gemfile - copy_file "Gemfile", "Gemfile" + copy_file "Gemfile" end def create_directories empty_directory "output" - empty_directory "images" - empty_directory "code" end def create_git_files create_file ".gitignore" do - "output/*.{html,epub,pdf}\noutput/tmp" + "/output" end - - create_file "output/.gitkeep" - create_file "images/.gitkeep" - create_file "code/.gitkeep" end def copy_guardfile - copy_file "Guardfile", "Guardfile" + copy_file "Guardfile" end def bundle_install inside destination_root do run "bundle install"