Sha256: 2260bbce44de16e0350f895b7c2ec4cebcff8e5c48e714a8f58c7931b99c3b11

Contents?: true

Size: 852 Bytes

Versions: 2

Compression:

Stored size: 852 Bytes

Contents

require 'dply/shell'
require 'dply/bundle'
require 'json'
module Dply
  class Tasks

    include Shell

    def initialize(deployment: true)
      @deployment = deployment
    end

    def deploy(target)
      bundle.install
      rake "#{target}:deploy"
    end

    def reload(target)
      bundle.install
      rake "#{target}:reload"
    end

    def task(task)
      bundle.install
      rake task
    end

    def build(task)
      bundle.install
      bundle.clean
      rake task
    end

    def rake(task)
      bundle.rake task
    end

    def report_changes(previous_version, current_version)
      info = {}
      info[:current] = current_version
      info[:previous] = previous_version
      logger.remote "#{JSON.dump info}"
    end

    private

    def bundle
      @bundle ||= Bundle.new(deployment: @deployment)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dply-0.0.8 lib/dply/tasks.rb
dply-0.0.7 lib/dply/tasks.rb