Class: Twb::Util::FTPPublisher

Inherits:
Object
  • Object
show all
Defined in:
lib/twb/util/ftppublisher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFTPPublisher

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.("tableautools", 'TableauT00ls!')
end

Instance Attribute Details

#fileNameObject (readonly)

Returns the value of attribute fileName.



23
24
25
# File 'lib/twb/util/ftppublisher.rb', line 23

def fileName
  @fileName
end

#fileURLObject (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

#closeObject



41
42
43
# File 'lib/twb/util/ftppublisher.rb', line 41

def close
  @ftp.close unless @ftp.nil?
end

#listObject



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