Sha256: cec7c4d6294c93295277eb64df13fd41a4fa4fa331794630f594d29401dbed6f

Contents?: true

Size: 833 Bytes

Versions: 3

Compression:

Stored size: 833 Bytes

Contents

module Frizz
  class Site
    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

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

    private

    attr_reader :local, :remote, :options, :distribution, :ignorance

    def path_to_deploy
      File.expand_path(options[:from])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
frizz-2.1.1 lib/frizz/site.rb
frizz-2.1.0 lib/frizz/site.rb
frizz-2.0.0 lib/frizz/site.rb