Class: Archimate::Cli::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/archimate/cli/diff.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(local, remote) ⇒ Diff

Returns a new instance of Diff.



15
16
17
18
# File 'lib/archimate/cli/diff.rb', line 15

def initialize(local, remote)
  @local = local
  @remote = remote
end

Instance Attribute Details

#localObject (readonly)

Returns the value of attribute local.



5
6
7
# File 'lib/archimate/cli/diff.rb', line 5

def local
  @local
end

#remoteObject (readonly)

Returns the value of attribute remote.



5
6
7
# File 'lib/archimate/cli/diff.rb', line 5

def remote
  @remote
end

Class Method Details

.diff(local_file, remote_file) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/archimate/cli/diff.rb', line 7

def self.diff(local_file, remote_file)
  local = Archimate.read(local_file)
  remote = Archimate.read(remote_file)

  my_diff = Diff.new(local, remote)
  my_diff.diff
end

Instance Method Details

#diffObject



20
21
22
23
24
25
26
27
28
# File 'lib/archimate/cli/diff.rb', line 20

def diff
  diffs = Archimate.diff(local, remote)

  diffs.each { |d| puts d }

  puts "\n\n#{diffs.size} Differences"

  diffs
end