Class: Teaspoon::Exporter
- Inherits:
-
Object
- Object
- Teaspoon::Exporter
- Includes:
- Utility
- Defined in:
- lib/teaspoon/exporter.rb
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(suite, url, output_path) ⇒ Exporter
constructor
A new instance of Exporter.
Methods included from Utility
Constructor Details
#initialize(suite, url, output_path) ⇒ Exporter
Returns a new instance of Exporter.
5 6 7 8 9 |
# File 'lib/teaspoon/exporter.rb', line 5 def initialize(suite, url, output_path) @suite = suite @url = url @output_path = File.join(File.(output_path || "export"), @suite.to_s) end |
Instance Method Details
#export ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/teaspoon/exporter.rb', line 11 def export Dir.mktmpdir do |temp_path| Dir.chdir(temp_path) do %x{#{executable} --convert-links --adjust-extension --page-requisites --span-hosts #{@url.shellescape} 2>&1} raise Teaspoon::DependencyError.new("Unable to export #{@suite} suite.") unless $?.exitstatus == 0 create_export(File.join(temp_path, @url.match(/^http:\/\/([^\/]+).*/)[1])) end end end |