Sha256: 15aea017474a54c147a00c3ecb294bbafd4dd2772422da3a96b056b18bba88e7

Contents?: true

Size: 815 Bytes

Versions: 2

Compression:

Stored size: 815 Bytes

Contents

module Releases
  module Dsl

    module ReleasesDsl

      def target_release?
        return false if project.config[:release].nil?
        return false if target_release(raise_error: false).nil?

        true
      end

      def target_release(raise_error: true)
        if project.config[:release].nil?
          project.logger.warn "Call to DSL method 'target_release', but no target release specified in the config."
          return nil
        end
        rel = entity PowerStencil.config[:release]
        false_or_raise "Invalid release '#{project.config[:release]}' !", raise_error: raise_error if rel.nil?
        false_or_raise "'#{project.config[:release]}' is not a release (this is a '#{rel.type}') !", raise_error: raise_error unless rel.type == :release
        rel
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
psplugin_releases-0.1.2 lib/releases/dsl/releases_dsl.rb
psplugin_releases-0.1.1 lib/releases/dsl/releases_dsl.rb