Class: Rake::FtpFile
- Inherits:
-
Object
- Object
- Rake::FtpFile
- Defined in:
- lib/rake/contrib/ftptools.rb
Overview
Note: Not released for general use.
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
- #directory? ⇒ Boolean
-
#initialize(path, entry) ⇒ FtpFile
constructor
A new instance of FtpFile.
- #mode ⇒ Object
- #path ⇒ Object
- #symlink? ⇒ Boolean
Constructor Details
#initialize(path, entry) ⇒ FtpFile
Returns a new instance of FtpFile.
25 26 27 28 29 30 |
# File 'lib/rake/contrib/ftptools.rb', line 25 def initialize(path, entry) @path = path @mode, _, @owner, @group, size, d1, d2, d3, @name = entry.split(' ') @size = size.to_i @time = determine_time(d1, d2, d3) end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group
15 16 17 |
# File 'lib/rake/contrib/ftptools.rb', line 15 def group @group end |
#name ⇒ Object (readonly)
Returns the value of attribute name
15 16 17 |
# File 'lib/rake/contrib/ftptools.rb', line 15 def name @name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner
15 16 17 |
# File 'lib/rake/contrib/ftptools.rb', line 15 def owner @owner end |
#size ⇒ Object (readonly)
Returns the value of attribute size
15 16 17 |
# File 'lib/rake/contrib/ftptools.rb', line 15 def size @size end |
#time ⇒ Object (readonly)
Returns the value of attribute time
15 16 17 |
# File 'lib/rake/contrib/ftptools.rb', line 15 def time @time end |
Class Method Details
.date ⇒ Object
17 18 19 |
# File 'lib/rake/contrib/ftptools.rb', line 17 def self.date @date_class ||= Date end |
.time ⇒ Object
21 22 23 |
# File 'lib/rake/contrib/ftptools.rb', line 21 def self.time @time_class ||= Time end |
Instance Method Details
#directory? ⇒ Boolean
36 37 38 |
# File 'lib/rake/contrib/ftptools.rb', line 36 def directory? @mode[0] == ?d end |
#mode ⇒ Object
40 41 42 |
# File 'lib/rake/contrib/ftptools.rb', line 40 def mode parse_mode(@mode) end |
#path ⇒ Object
32 33 34 |
# File 'lib/rake/contrib/ftptools.rb', line 32 def path File.join(@path, @name) end |
#symlink? ⇒ Boolean
44 45 46 |
# File 'lib/rake/contrib/ftptools.rb', line 44 def symlink? @mode[0] == ?l end |