class Labelito::Tool
Public Class Methods
new(client, template_reader)
click to toggle source
# File lib/Labelito/tool.rb, line 8 def initialize(client, template_reader) @client = client @template_reader = template_reader end
with_token(token)
click to toggle source
# File lib/Labelito/tool.rb, line 13 def self.with_token(token) Tool.new GithubClient.with_token(token), TemplateReader.new end
Public Instance Methods
clone(from_repo, to_repo)
click to toggle source
# File lib/Labelito/tool.rb, line 17 def clone(from_repo, to_repo) labels = @client.labels(from_repo) @client.update(labels, to_repo) end
create(template_path, repo)
click to toggle source
# File lib/Labelito/tool.rb, line 22 def create(template_path, repo) labels = @template_reader.read(template_path) @client.update(labels, repo) end