Class: DiffFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/macdiff/diff_folder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(folder1, folder2) ⇒ DiffFolder

Returns a new instance of DiffFolder.



6
7
8
9
# File 'lib/macdiff/diff_folder.rb', line 6

def initialize(folder1 ,folder2)
  @folder1 = File.expand_path(folder1, Dir.pwd)
  @folder2 = File.expand_path(folder2, Dir.pwd)
end

Instance Attribute Details

#folder1Object

Returns the value of attribute folder1.



3
4
5
# File 'lib/macdiff/diff_folder.rb', line 3

def folder1
  @folder1
end

#folder2Object

Returns the value of attribute folder2.



3
4
5
# File 'lib/macdiff/diff_folder.rb', line 3

def folder2
  @folder2
end

#outputObject (readonly)

Returns the value of attribute output.



4
5
6
# File 'lib/macdiff/diff_folder.rb', line 4

def output
  @output
end

#raw_outputObject (readonly)

Returns the value of attribute raw_output.



4
5
6
# File 'lib/macdiff/diff_folder.rb', line 4

def raw_output
  @raw_output
end

Instance Method Details

#debugObject



22
23
24
25
26
27
28
# File 'lib/macdiff/diff_folder.rb', line 22

def debug
  puts '-' * 70
  puts command.join(' ')
  puts '-' * 70
  puts @raw_output
  puts '-' * 70
end

#runObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/macdiff/diff_folder.rb', line 11

def run
  @raw_output = IO.popen(command) do |f|
    f.read # or raise
  end

  # NOT WORK, need to investigate
  # puts $?.success?
  # puts $?.exitstatus
  # $?.exitstatus == 0 || raise
end