Sha256: c3ac09d6189878647695c78f47fd9f6d8cfa6467bce79162a0a0ff9ca2fea1ae

Contents?: true

Size: 1.52 KB

Versions: 3

Compression:

Stored size: 1.52 KB

Contents

module Capistrano
  module DSL
    module Env

      def configure_backend
        env.configure_backend
      end

      def fetch(key, default=nil, &block)
        env.fetch(key, default, &block)
      end

      def any?(key)
        value = fetch(key)
        if value && value.respond_to?(:any?)
          value.any?
        else
          !fetch(key).nil?
        end
      end

      def set(key, value)
        env.set(key, value)
      end

      def set_if_empty(key, value)
        env.set_if_empty(key, value)
      end

      def delete(key)
        env.delete(key)
      end

      def ask(key, value, options={})
        env.ask(key, value, options)
      end

      def role(name, servers, options={})
        env.role(name, servers, options)
      end

      def server(name, properties={})
        env.server(name, properties)
      end

      def roles(*names)
        env.roles_for(names.flatten)
      end

      def role_properties(*names, &block)
        env.role_properties_for(names, &block)
      end

      def release_roles(*names)
        if names.last.is_a? Hash
          names.last.merge!({ :exclude => :no_release })
        else
          names << { exclude: :no_release }
        end
        roles(*names)
      end

      def primary(role)
        env.primary(role)
      end

      def env
        Configuration.env
      end

      def release_timestamp
        env.timestamp.strftime("%Y%m%d%H%M%S")
      end

      def asset_timestamp
        env.timestamp.strftime("%Y%m%d%H%M.%S")
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
capistrano-3.4.1 lib/capistrano/dsl/env.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl/env.rb
capistrano-3.4.0 lib/capistrano/dsl/env.rb