lib/showoff.rb in showoff-0.2.5 vs lib/showoff.rb in showoff-0.3.1

- old
+ new

@@ -2,11 +2,11 @@ require 'sinatra/base' require 'json' require 'nokogiri' require 'showoff_utils' require 'princely' -require 'ftools' +require 'fileutils' begin require 'RMagick' rescue LoadError puts 'image sizing disabled - install RMagick' @@ -24,10 +24,11 @@ require 'bluecloth' Markdown = BlueCloth end require 'pp' + class ShowOff < Sinatra::Application attr_reader :cached_image_size set :views, File.dirname(__FILE__) + '/../views' @@ -232,10 +233,11 @@ js_content end def index(static=false) if static + @title = ShowOffUtils.showoff_title @slides = get_slides_html(static) @asset_path = "." end erb :index end @@ -307,11 +309,11 @@ if data.is_a?(File) File.cp(data.path, "#{name}.pdf") else out = "#{path}/#{name}/static" # First make a directory - File.makedirs("#{out}") + FileUtils.makedirs("#{out}") # Then write the html file = File.new("#{out}/index.html", "w") file.puts(data) file.close # Now copy all the js and css @@ -346,9 +348,6 @@ else data end end end - - - end