Class: Lerna::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(logger:, strategies:, system:, state: State.new, strategy_selector: StrategySelector.new) ⇒ Runner



6
7
8
9
10
11
12
13
# File 'lib/lerna/runner.rb', line 6

def initialize(logger:, strategies:, system:, state: State.new,
               strategy_selector: StrategySelector.new)
  @logger = logger
  @strategies = strategies
  @system = system
  @state = state
  @strategy_selector = strategy_selector
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lerna/runner.rb', line 15

def run
  state.scan!
  return unless state.changed?

  log state_summary
  strategy = find_strategy
  if strategy
    log "Using #{strategy.class}"
    apply_strategy strategy
  else
    log 'No applicable strategy found'
  end
end