Class: Scatter::Commands::Sync

Inherits:
Scatter::Command show all
Defined in:
lib/scatter/commands/sync.rb

Instance Method Summary collapse

Methods inherited from Scatter::Command

command_name, help, inherited, usage

Constructor Details

#initialize(out, node_name) ⇒ Sync

Returns a new instance of Sync.



7
8
9
10
# File 'lib/scatter/commands/sync.rb', line 7

def initialize(out, node_name)
  super(out)
  @node_name = node_name
end

Instance Method Details

#execute!Object



12
13
14
15
16
17
18
# File 'lib/scatter/commands/sync.rb', line 12

def execute!
  gemlist = Dir.glob("#{ENV['GEM_HOME']}/cache/*.gem")
  gemlist.each do |gemfile|
    @out.puts "Pushing gem #{File.basename(gemfile)} to #{@node_name} ..."
    node.push(gemfile)
  end
end

#nodeObject



20
21
22
# File 'lib/scatter/commands/sync.rb', line 20

def node
  @node ||= Scatter::Config.find_node(@node_name)
end