Class: DRbQS::Transfer::FileList
- Inherits:
-
Object
- Object
- DRbQS::Transfer::FileList
- Defined in:
- lib/drbqs/utility/transfer/transfer_file_list.rb
Instance Method Summary collapse
-
#initialize(*files) ⇒ FileList
constructor
Initialization is executed on server.
-
#path ⇒ Object
Return an array of paths of downloaded files.
Constructor Details
#initialize(*files) ⇒ FileList
Initialization is executed on server. If :readonly option is true, nodes on same computer as server does not copy files. Therefore, if we edit the files then the change remains. If :readonly option is not true then the files is copied, so the original files are not changed.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/drbqs/utility/transfer/transfer_file_list.rb', line 11 def initialize(*files) opts = (Hash === files[-1] ? files.pop : {}) @readonly = opts[:readonly] @files = files.map do |path| epath = File.(path) unless File.exist?(epath) raise ArgumentError, "#{epath} does not exist." end epath end @downloaded = nil @path = nil end |
Instance Method Details
#path ⇒ Object
Return an array of paths of downloaded files. Note that this method is executed on a node.
34 35 36 37 |
# File 'lib/drbqs/utility/transfer/transfer_file_list.rb', line 34 def path download unless @downloaded @path end |