Class: Rexer::Definition::Diff
- Inherits:
-
Object
- Object
- Rexer::Definition::Diff
- Defined in:
- lib/rexer/definition/diff.rb
Instance Method Summary collapse
- #added_plugins ⇒ Object
- #added_themes ⇒ Object
- #deleted_plugins ⇒ Object
- #deleted_themes ⇒ Object
-
#initialize(old_data, new_data) ⇒ Diff
constructor
A new instance of Diff.
- #source_changed_plugins ⇒ Object
- #source_changed_themes ⇒ Object
Constructor Details
#initialize(old_data, new_data) ⇒ Diff
Returns a new instance of Diff.
4 5 6 7 |
# File 'lib/rexer/definition/diff.rb', line 4 def initialize(old_data, new_data) @old_data = old_data @new_data = new_data end |
Instance Method Details
#added_plugins ⇒ Object
9 10 11 |
# File 'lib/rexer/definition/diff.rb', line 9 def added_plugins new_data.plugins - old_data.plugins end |
#added_themes ⇒ Object
13 14 15 |
# File 'lib/rexer/definition/diff.rb', line 13 def added_themes new_data.themes - old_data.themes end |
#deleted_plugins ⇒ Object
17 18 19 |
# File 'lib/rexer/definition/diff.rb', line 17 def deleted_plugins old_data.plugins - new_data.plugins end |
#deleted_themes ⇒ Object
21 22 23 |
# File 'lib/rexer/definition/diff.rb', line 21 def deleted_themes old_data.themes - new_data.themes end |
#source_changed_plugins ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/rexer/definition/diff.rb', line 25 def source_changed_plugins old_plugins = old_data.plugins (new_data.plugins & old_plugins).select do |new_plugin| old_plugin = old_plugins.find { _1.name == new_plugin.name } plugin_source_changed?(old_plugin, new_plugin) end end |
#source_changed_themes ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/rexer/definition/diff.rb', line 34 def source_changed_themes old_themes = old_data.themes (new_data.themes & old_themes).select do |new_theme| old_theme = old_themes.find { _1.name == new_theme.name } theme_source_changed?(old_theme, new_theme) end end |