Class: MergeOperations
- Inherits:
-
Merge
- Object
- Merge
- MergeOperations
show all
- Defined in:
- lib/xmimerge/merge_operations.rb
Instance Method Summary
collapse
Methods inherited from Merge
#check, #check_change_propertie, #merge
Constructor Details
#initialize(from_class, to_class) ⇒ MergeOperations
Returns a new instance of MergeOperations.
5
6
7
8
9
|
# File 'lib/xmimerge/merge_operations.rb', line 5
def initialize(from_class, to_class)
super()
@from_class = from_class
@to_class = to_class
end
|
Instance Method Details
#check_changes(from_operation) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/xmimerge/merge_operations.rb', line 19
def check_changes(from_operation)
@log.debug("Checking operation: #{@from_class.full_name}::#{from_operation.name}")
to_operation = @to_class.operation_by_name(from_operation.name)
if to_operation.nil?
new_operation from_operation
else
check_existing(from_operation, to_operation)
end
end
|
#check_existing(from_operation, to_operation) ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/xmimerge/merge_operations.rb', line 71
def check_existing(from_operation, to_operation)
from_full_operation_name = "#{@from_class.full_name}::#{from_operation.name}"
check_change_propertie("visibility", from_operation, to_operation, "OperationVisibility")
merge = MergeParameters.new("Operation", from_operation, to_operation)
@only_check ? merge.check : merge.merge
end
|
#check_removed ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/xmimerge/merge_operations.rb', line 31
def check_removed
to_operations = @to_class.operations.each do |to_operation|
ok = false
@from_class.operations.each do |from_operation|
if from_operation.name == to_operation.name
ok = true
break
end
end
if !ok
command = "\t- Operation #{@from_class.full_name}::#{to_operation.name}"
@commands.add_command_to_buffer(command)
unless @only_check
if @commands.has_command?(command)
@log.info "[OK] #{command}"
else
end
end
end
end
end
|
#new_operation(from_operation) ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/xmimerge/merge_operations.rb', line 56
def new_operation(from_operation)
@log.debug("New operation")
command = "\t+ Operation #{@from_class.full_name}::#{from_operation.name}"
@commands.add_command_to_buffer(command)
unless @only_check
if @commands.has_command?(command)
@log.info "[OK] #{command}"
else
@log.info "[NOT] #{command}"
end
end
end
|
#verify ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/xmimerge/merge_operations.rb', line 11
def verify
@from_class.operations.each do |from_operation|
check_changes(from_operation)
end
check_removed
end
|