Class: Slicecraft::Preview

Inherits:
Syncer
  • Object
show all
Defined in:
lib/slicecraft.rb

Instance Attribute Summary

Attributes inherited from Syncer

#path, #settings

Instance Method Summary collapse

Methods inherited from Syncer

#build_path, #hashed_path, #initialize, #project_name, #result_url

Constructor Details

This class inherits a constructor from Slicecraft::Syncer

Instance Method Details

#processObject



66
67
68
# File 'lib/slicecraft.rb', line 66

def process
  system "rsync -ave ssh #{build_path} #{settings['user']}@#{settings['url']}:#{"#{settings['preview_path']}#{hashed_path}"}"
end

#result_urlsObject



60
61
62
63
64
# File 'lib/slicecraft.rb', line 60

def result_urls
  results = Dir.entries(build_path).select{ |file| file.end_with?('.html') }.map{ |r| "#{result_url}/#{r}" }
  FileUtils.rm_rf build_path if File.exists? build_path
  results
end