Class: Frank::Publish::SCP
Constant Summary
Constants included from Render
Render::LAYOUT_EXTS, Render::TMPL_EXTS
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(options, &block) ⇒ SCP
constructor
A new instance of SCP.
- #transfer! ⇒ Object
Methods inherited from Base
Methods included from Render
#ext_from_handler, #layout_ext_or_first, #layout_for, #render, #setup_page, #tilt, #to_file_path
Methods included from TemplateHelpers
#capture, #content_for, #content_for?, #lorem, #refresh, #render_partial
Methods included from Rescue
Constructor Details
#initialize(options, &block) ⇒ SCP
Returns a new instance of SCP.
10 11 12 13 14 15 |
# File 'lib/frank/publish/scp.rb', line 10 def initialize(, &block) super() instance_eval(&block) if block_given? @port ||= 22 end |
Instance Method Details
#connection ⇒ Object
18 19 20 21 22 |
# File 'lib/frank/publish/scp.rb', line 18 def connection Net::SCP.start(hostname, username, :password => password) do |scp| yield scp end end |
#transfer! ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/frank/publish/scp.rb', line 24 def transfer! connection do |scp| old_name = '' scp.upload! local_path, remote_path do |ch, name| if old_name != name "Uploading #{name}", " - " end end end end |