Class: Frizz::Site

Inherits:
Object
  • Object
show all
Defined in:
lib/frizz/site.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, options = {}) ⇒ Site

Returns a new instance of Site.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/frizz/site.rb', line 3

def initialize(host, options={})
  @options = { from: "build" }.merge options

  @ignorance = Ignorance.new(@options[:ignore])

  if @options[:distribution]
    @distribution = Distribution.new(@options[:distribution])
  end

  local_options = options.select { |k, v| k == :redirect_rules }
  @local = Local.new(path_to_deploy, ignorance, local_options)

  remote_options = options.select { |k, v| k == :region }
  @remote = Remote.new(host, ignorance, remote_options)
end

Instance Method Details

#deploy!Object



19
20
21
22
# File 'lib/frizz/site.rb', line 19

def deploy!
  changes = Sync.new(local, remote).run!
  distribution.invalidate!(changes) if distribution
end