Class: Albacore::Tasks::ProjectLint::FileReference

Inherits:
Object
  • Object
show all
Defined in:
lib/albacore/tasks/projectlint.rb

Overview

since msbuild projects have a habbit of ignoring case differences, lets use downcase for comparison in windows / and \ can sometimes be used interchangeably

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ FileReference

Returns a new instance of FileReference.



19
20
21
22
# File 'lib/albacore/tasks/projectlint.rb', line 19

def initialize file
  @file = file
  @downcase_and_path_replaced = @file.downcase.gsub(/\//,'\\')
end

Instance Attribute Details

#downcase_and_path_replacedObject (readonly)

Returns the value of attribute downcase_and_path_replaced.



18
19
20
# File 'lib/albacore/tasks/projectlint.rb', line 18

def downcase_and_path_replaced
  @downcase_and_path_replaced
end

#fileObject (readonly)

Returns the value of attribute file.



18
19
20
# File 'lib/albacore/tasks/projectlint.rb', line 18

def file
  @file
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



23
24
25
# File 'lib/albacore/tasks/projectlint.rb', line 23

def ==(other)
  other.downcase_and_path_replaced == @downcase_and_path_replaced
end

#hashObject



27
28
29
# File 'lib/albacore/tasks/projectlint.rb', line 27

def hash
  @downcase_and_path_replaced.hash
end

#to_sObject



30
31
32
# File 'lib/albacore/tasks/projectlint.rb', line 30

def to_s
  @file
end