Sha256: a64a2e14549fa131d4b1b9929249db1b817df6ff817975255c77379f650996f1

Contents?: true

Size: 1.38 KB

Versions: 42

Compression:

Stored size: 1.38 KB

Contents

require 'fig/command/action'
require 'fig/command/action/role/has_no_sub_action'
require 'fig/command/action/role/publish'
require 'fig/logging'
require 'fig/user_input_error'

module  Fig; end
class   Fig::Command; end
module  Fig::Command::Action; end

class Fig::Command::Action::Publish
  include Fig::Command::Action
  include Fig::Command::Action::Role::HasNoSubAction
  include Fig::Command::Action::Role::Publish

  def options()
    return %w<--publish>
  end

  def remote_operation_necessary?()
    return true
  end

  def execute()
    publish_preflight()

    Fig::Logging.info "Checking status of #{@descriptor.to_string()}..."

    package_description =
      Fig::PackageDescriptor.format(@descriptor.name, @descriptor.version, nil)
    if @execution_context.repository.list_remote_packages.include?(
      package_description
    )
      Fig::Logging.info "#{@descriptor.to_string()} has already been published."

      if not @force
        raise Fig::UserInputError.new(
          'Use the --force option if you really want to overwrite.'
        )
      else
        Fig::Logging.info 'Overwriting...'
      end
    end

    Fig::Logging.info "Publishing #{@descriptor.to_string()}."
    @execution_context.repository.publish_package(
      @publish_statements,
      @descriptor,
      false,
      @execution_context.base_package,
      @force
    )

    return EXIT_SUCCESS
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/command/action/publish.rb
fig-1.22.1.beta.1 lib/fig/command/action/publish.rb
fig-1.22.0 lib/fig/command/action/publish.rb
fig-1.21.1.beta.2 lib/fig/command/action/publish.rb
fig-1.21.1.beta.1 lib/fig/command/action/publish.rb
fig-1.21.0 lib/fig/command/action/publish.rb
fig-1.20.1.beta.1 lib/fig/command/action/publish.rb
fig-1.20.0 lib/fig/command/action/publish.rb
fig-1.19.0 lib/fig/command/action/publish.rb
fig-1.18.0 lib/fig/command/action/publish.rb
fig-1.17.0 lib/fig/command/action/publish.rb
fig-1.16.1.beta.1 lib/fig/command/action/publish.rb
fig-1.16.0 lib/fig/command/action/publish.rb
fig-1.15.1.beta.2 lib/fig/command/action/publish.rb
fig-1.15.1.beta.1 lib/fig/command/action/publish.rb
fig-1.15.0 lib/fig/command/action/publish.rb
fig-1.14.0 lib/fig/command/action/publish.rb
fig-1.13.0 lib/fig/command/action/publish.rb
fig-1.12.0 lib/fig/command/action/publish.rb
fig-1.11.0 lib/fig/command/action/publish.rb