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, handler) ⇒ Deployer

Returns a new instance of Deployer.



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

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

Instance Method Details

#deployObject



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

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

  @git.stage @handler.on_deploy.flatten.uniq if @handler

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