Class: Twb::Util::FTPPublisher
- Inherits:
-
Object
- Object
- Twb::Util::FTPPublisher
- Defined in:
- lib/twb/util/ftppublisher.rb
Instance Attribute Summary collapse
-
#fileName ⇒ Object
readonly
Returns the value of attribute fileName.
-
#fileURL ⇒ Object
readonly
Returns the value of attribute fileURL.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ FTPPublisher
constructor
A new instance of FTPPublisher.
- #list ⇒ Object
- #publish(fileName) ⇒ Object
Constructor Details
#initialize ⇒ FTPPublisher
Returns a new instance of FTPPublisher.
25 26 27 28 |
# File 'lib/twb/util/ftppublisher.rb', line 25 def initialize @ftp = Net::FTP.new('gerrard.net') @ftp.login("tableautools", 'TableauT00ls!') end |
Instance Attribute Details
#fileName ⇒ Object (readonly)
Returns the value of attribute fileName.
23 24 25 |
# File 'lib/twb/util/ftppublisher.rb', line 23 def fileName @fileName end |
#fileURL ⇒ Object (readonly)
Returns the value of attribute fileURL.
23 24 25 |
# File 'lib/twb/util/ftppublisher.rb', line 23 def fileURL @fileURL end |
Instance Method Details
#close ⇒ Object
41 42 43 |
# File 'lib/twb/util/ftppublisher.rb', line 41 def close @ftp.close unless @ftp.nil? end |
#list ⇒ Object
37 38 39 |
# File 'lib/twb/util/ftppublisher.rb', line 37 def list @ftp.list() end |
#publish(fileName) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/twb/util/ftppublisher.rb', line 30 def publish fileName @fileName = fileName @ftp.passive = true @ftp.puttextfile(fileName, fileName) @fileURL = "http://gerrard.net/tableautools/#{fileName}" end |