Class: RailsAppGenerator::Diff::CompareInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_app_generator/diff/compare_info.rb

Overview

CompareInfo stores LHS and RHS file information in segments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lhs_path, lhs_files, rhs_path, rhs_files) ⇒ CompareInfo

Returns a new instance of CompareInfo.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rails_app_generator/diff/compare_info.rb', line 19

def initialize(lhs_path, lhs_files, rhs_path, rhs_files)
  @lhs_path                 = lhs_path
  @lhs_files                = lhs_files

  @rhs_path                 = rhs_path
  @rhs_files                = rhs_files

  @lhs_only                 = []
  @rhs_only                 = []
  @diff                     = []
  @same                     = []

  segment_files(lhs_path, lhs_files, rhs_path, rhs_files)
end

Instance Attribute Details

#diffObject (readonly)

Returns the value of attribute diff.



16
17
18
# File 'lib/rails_app_generator/diff/compare_info.rb', line 16

def diff
  @diff
end

#lhs_filesObject (readonly)

Returns the value of attribute lhs_files.



8
9
10
# File 'lib/rails_app_generator/diff/compare_info.rb', line 8

def lhs_files
  @lhs_files
end

#lhs_onlyObject (readonly)

File segments



14
15
16
# File 'lib/rails_app_generator/diff/compare_info.rb', line 14

def lhs_only
  @lhs_only
end

#lhs_pathObject (readonly)

Returns the value of attribute lhs_path.



7
8
9
# File 'lib/rails_app_generator/diff/compare_info.rb', line 7

def lhs_path
  @lhs_path
end

#rhs_filesObject (readonly)

Returns the value of attribute rhs_files.



11
12
13
# File 'lib/rails_app_generator/diff/compare_info.rb', line 11

def rhs_files
  @rhs_files
end

#rhs_onlyObject (readonly)

Returns the value of attribute rhs_only.



15
16
17
# File 'lib/rails_app_generator/diff/compare_info.rb', line 15

def rhs_only
  @rhs_only
end

#rhs_pathObject (readonly)

Returns the value of attribute rhs_path.



10
11
12
# File 'lib/rails_app_generator/diff/compare_info.rb', line 10

def rhs_path
  @rhs_path
end

#sameObject (readonly)

Returns the value of attribute same.



17
18
19
# File 'lib/rails_app_generator/diff/compare_info.rb', line 17

def same
  @same
end

Instance Method Details

#debugObject



34
35
36
37
38
39
40
# File 'lib/rails_app_generator/diff/compare_info.rb', line 34

def debug
  debug_stats
  debug_files('left only'   , lhs_only)
  debug_files('right only'  , rhs_only)
  debug_files('same'        , same)
  debug_files('diff'        , diff)
end