better export

This commit is contained in:
John Bintz 2012-03-24 09:52:07 -04:00
parent e82ebb06b8
commit f6b85f5a67

View File

@ -114,11 +114,11 @@ class Attentive::CLI < Thor
system %{git checkout master} system %{git checkout master}
end end
desc 'export', 'Export each slide as a .png file using Selenium' desc 'export [DIMENSIONS]', 'Export each slide as a .png file using Selenium'
def export def export(dimensions = '1024x768')
puts "Exporting to static HTML..." puts "Exporting to static HTML..."
#static static
require 'selenium-webdriver' require 'selenium-webdriver'
@ -126,8 +126,7 @@ class Attentive::CLI < Thor
browser.navigate.to "file://#{Dir.pwd}/_site/index.html" browser.navigate.to "file://#{Dir.pwd}/_site/index.html"
target_width = 1024 target_width, target_height = dimensions.split('x').collect(&:to_i)
target_height = 768
browser.manage.window.resize_to target_width, target_height browser.manage.window.resize_to target_width, target_height