Class: Workarea::Upgrade::Diff::GemDiff
- Inherits:
-
Object
- Object
- Workarea::Upgrade::Diff::GemDiff
- Defined in:
- lib/workarea/upgrade/diff/gem_diff.rb
Instance Method Summary collapse
- #added ⇒ Object
- #all ⇒ Object
- #customized_files ⇒ Object
- #decorated ⇒ Object
- #for_current_app ⇒ Object
- #from_files ⇒ Object
-
#initialize(from_root, to_root, options = {}) ⇒ GemDiff
constructor
A new instance of GemDiff.
- #overridden ⇒ Object
- #removed ⇒ Object
- #to_files ⇒ Object
Constructor Details
#initialize(from_root, to_root, options = {}) ⇒ GemDiff
5 6 7 8 9 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 5 def initialize(from_root, to_root, = {}) @from_root = from_root @to_root = to_root @options = end |
Instance Method Details
#added ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 22 def added @added ||= to_files.reduce([]) do |results, to_file| from_file = find_from_file(to_file.relative_path) results << to_file.relative_path if from_file.blank? results end end |
#all ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 11 def all @all ||= from_files.reduce([]) do |results, from_file| if to_file = find_to_file(from_file.relative_path) diff = diff_files(from_file, to_file) results << diff unless diff.blank? end results end end |
#customized_files ⇒ Object
46 47 48 49 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 46 def customized_files CurrentApp.files.map(&:relative_path) + CurrentApp.decorators.map(&:relative_path) end |
#decorated ⇒ Object
42 43 44 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 42 def decorated @decorated ||= find_app_diff(CurrentApp.decorators) end |
#for_current_app ⇒ Object
51 52 53 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 51 def for_current_app @for_current_app ||= overridden + decorated end |
#from_files ⇒ Object
55 56 57 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 55 def from_files @from_files ||= WorkareaFile.find_files(@from_root) end |
#overridden ⇒ Object
38 39 40 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 38 def overridden @overridden ||= find_app_diff(CurrentApp.files) end |
#removed ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 30 def removed @removed ||= from_files.reduce([]) do |results, from_file| to_file = find_to_file(from_file.relative_path) results << from_file.relative_path if to_file.blank? results end end |
#to_files ⇒ Object
59 60 61 |
# File 'lib/workarea/upgrade/diff/gem_diff.rb', line 59 def to_files @to_files ||= WorkareaFile.find_files(@to_root) end |