Class: Ironment::Runcom

Inherits:
Object
  • Object
show all
Defined in:
lib/ironment/runcom.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Runcom

Returns a new instance of Runcom.



7
8
9
# File 'lib/ironment/runcom.rb', line 7

def initialize(file)
  @file = File.expand_path file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



5
6
7
# File 'lib/ironment/runcom.rb', line 5

def file
  @file
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
# File 'lib/ironment/runcom.rb', line 23

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

#contentObject



27
28
29
# File 'lib/ironment/runcom.rb', line 27

def content
  @content ||= File.read(file)
end

#each_pairObject



15
16
17
18
19
20
21
# File 'lib/ironment/runcom.rb', line 15

def each_pair
  if block_given?
    read_pairs.each &Proc.new
  else
    read_pairs.each
  end
end

#sha1sumObject



11
12
13
# File 'lib/ironment/runcom.rb', line 11

def sha1sum
  Digest::SHA1.hexdigest(content)
end