Class: Taeval::GitCheckout::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/taeval/git_checkout/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, output, reporter) ⇒ Runner

Returns a new instance of Runner.



12
13
14
15
16
# File 'lib/taeval/git_checkout/runner.rb', line 12

def initialize(config, output, reporter)
  @config   = Config.new(config)
  @output   = output
  @reporter = reporter
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/taeval/git_checkout/runner.rb', line 18

def run
  @config.source.each do |source|
    repo = RepoFactory.create(
                          {host:     source[:host],
                            id:       source[:id],
                            user:     source[:user],
                            repo:     source[:repo],
                            prefix:   @config.prefix,
                            branch:   @config.branch,
                            token:    @config.tokens[source[:host]],
                            attr:     @config.attr,
                            solution: @config.solution},
                            @output,
                            @reporter
                          )
    repo.validate
    repo.clone
  end
end