Sha256: 4d7b791a62becbad3a169f6013ac0de3ac9421a4ce18246cbf8116b9851f7df3

Contents?: true

Size: 699 Bytes

Versions: 7

Compression:

Stored size: 699 Bytes

Contents

require 'awestruct/deployers'
require 'git'

module Awestruct
  module Deploy
    class Base
      UNCOMMITTED_CHANGES = "You have uncommitted changes in the working branch. Please commit or stash them."
      def run(deploy_config)
        if deploy_config['uncommitted'] == true
          publish_site
        else
          git.status.changed.empty? ? publish_site : existing_changes
        end
      end

      def git
        @git ||= ::Git.open('.')
      end

      def publish_site
        $LOG.error( "#{self.class.name}#publish_site not implemented." ) if $LOG.error?
      end

      def existing_changes
        $LOG.error UNCOMMITTED_CHANGES if $LOG.error?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
awestruct-0.5.3 lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.2.1 lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.2 lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.1 lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.1a lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.0 lib/awestruct/deploy/base_deploy.rb
awestruct-0.5.0.cr lib/awestruct/deploy/base_deploy.rb