Class: GithubPages::Deployer

Inherits:
Object
  • Object
show all
Defined in:
lib/ghpages_deploy/deployer.rb

Instance Method Summary collapse

Constructor Details

#initialize(git, source, destinations) ⇒ Deployer

Returns a new instance of Deployer.



9
10
11
12
13
# File 'lib/ghpages_deploy/deployer.rb', line 9

def initialize(git, source, destinations)
  @git = git
  @source = source
  @destinations = destinations
end

Instance Method Details

#deployObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ghpages_deploy/deployer.rb', line 15

def deploy
  SiteCompressor.new(@source).compress

  @destinations.keep_if { |dest| deploy_site_to(dest) }

  if @destinations.empty?
    $stderr.puts 'No changes detected, not commiting.'
  else
    @git.commit_and_push message
  end
end