Class: SyncIssues::LabelSync

Inherits:
Object
  • Object
show all
Defined in:
lib/sync_issues/label_sync.rb

Overview

Synchronizer is responsible for the actual synchronization.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(github, file_yaml) ⇒ LabelSync

Returns a new instance of LabelSync.



9
10
11
12
13
# File 'lib/sync_issues/label_sync.rb', line 9

def initialize(github, file_yaml)
  @github = github
  @labels = @keep_existing = nil
  @do_work = file_yaml.nil? ? false : parse_yaml(file_yaml)
end

Instance Attribute Details

#do_workObject (readonly)

Returns the value of attribute do_work.



7
8
9
# File 'lib/sync_issues/label_sync.rb', line 7

def do_work
  @do_work
end

#keep_existingObject (readonly)

Returns the value of attribute keep_existing.



7
8
9
# File 'lib/sync_issues/label_sync.rb', line 7

def keep_existing
  @keep_existing
end

#labelsObject (readonly)

Returns the value of attribute labels.



7
8
9
# File 'lib/sync_issues/label_sync.rb', line 7

def labels
  @labels
end

Instance Method Details

#synchronize(repository) ⇒ Object



15
16
17
18
19
# File 'lib/sync_issues/label_sync.rb', line 15

def synchronize(repository)
  return unless @do_work
  existing = existing_labels(repository)
  make_changes(existing, repository)
end