Class: Rake::FtpFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/contrib/ftptools.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, entry) ⇒ FtpFile

Returns a new instance of FtpFile.



23
24
25
26
27
28
# File 'lib/rake/contrib/ftptools.rb', line 23

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

#groupObject (readonly)

Returns the value of attribute group.



13
14
15
# File 'lib/rake/contrib/ftptools.rb', line 13

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/rake/contrib/ftptools.rb', line 13

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



13
14
15
# File 'lib/rake/contrib/ftptools.rb', line 13

def owner
  @owner
end

#sizeObject (readonly)

Returns the value of attribute size.



13
14
15
# File 'lib/rake/contrib/ftptools.rb', line 13

def size
  @size
end

#timeObject (readonly)

Returns the value of attribute time.



13
14
15
# File 'lib/rake/contrib/ftptools.rb', line 13

def time
  @time
end

Class Method Details

.dateObject



15
16
17
# File 'lib/rake/contrib/ftptools.rb', line 15

def self.date
  @date_class ||= Date
end

.timeObject



19
20
21
# File 'lib/rake/contrib/ftptools.rb', line 19

def self.time
  @time_class ||= Time
end

Instance Method Details

#directory?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/rake/contrib/ftptools.rb', line 34

def directory?
  @mode[0] == ?d
end

#modeObject



38
39
40
# File 'lib/rake/contrib/ftptools.rb', line 38

def mode
  parse_mode(@mode)
end

#pathObject



30
31
32
# File 'lib/rake/contrib/ftptools.rb', line 30

def path
  File.join(@path, @name)
end

#symlink?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/rake/contrib/ftptools.rb', line 42

def symlink?
  @mode[0] == ?l
end