lib/ykutils/lsutils.rb in ykutils-0.1.7 vs lib/ykutils/lsutils.rb in ykutils-0.1.8
- old
+ new
@@ -3,13 +3,11 @@
module Ykytils
class DirEntryItem
attr_accessor :name, :user, :group, :size, :month, :day, :time, :year, :path, :type, :parent_dir, :valid
- def initialize; end
-
- def parse(str, parent_dir, valid = true)
+ def parse(str, parent_dir, valid: true)
ary = str.split(/\s+/)
perm = ary[0]
@type = if perm[0].chr == "d"
:DIRECTORY
else
@@ -47,14 +45,14 @@
def to_csv
"#{@type},#{@perm},#{@value},#{@user},#{@group},#{@size},#{@year},#{@month},#{@day},#{@time},#{@name},#{@parent_dir},#{@valid}"
end
def directory?
- @type === :DIRECTORY
+ @type == :DIRECTORY
end
def file?
- @type === :FILE
+ @type == :FILE
end
def owner_perm
@perm.owner
end