Class: Pkgpurge::Entry
- Inherits:
-
Object
- Object
- Pkgpurge::Entry
- Defined in:
- lib/pkgpurge/entry.rb
Constant Summary collapse
- S_IFMT =
See ‘/usr/includde/sys/_types/_s_ifmt.h`
0170000
- S_IFDIR =
0040000
- S_IFLNK =
0120000
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#gid ⇒ Object
readonly
Returns the value of attribute gid.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Class Method Summary collapse
Instance Method Summary collapse
- #directory? ⇒ Boolean
-
#initialize(name, mode, uid, gid, size, checksum, mtime) ⇒ Entry
constructor
A new instance of Entry.
- #symlink? ⇒ Boolean
Constructor Details
#initialize(name, mode, uid, gid, size, checksum, mtime) ⇒ Entry
Returns a new instance of Entry.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pkgpurge/entry.rb', line 19 def initialize(name, mode, uid, gid, size, checksum, mtime) @name = name @mode = mode @uid = uid @gid = gid @size = size @checksum = checksum @mtime = mtime @entries = {} end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def checksum @checksum end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def entries @entries end |
#gid ⇒ Object (readonly)
Returns the value of attribute gid.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def gid @gid end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def mode @mode end |
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def mtime @mtime end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def size @size end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
17 18 19 |
# File 'lib/pkgpurge/entry.rb', line 17 def uid @uid end |
Class Method Details
.traverse_entry_with_path(entry, parent_path = nil) {|entry, File.expand_path(path)| ... } ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/pkgpurge/entry.rb', line 3 def self.traverse_entry_with_path(entry, parent_path = nil, &block) if parent_path path = File.join(parent_path, entry.name) else path = entry.name end yield(entry, File.(path)) entry.entries.each do |_, entry| traverse_entry_with_path(entry, path, &block) end end |