Sha256: 4eb047b9d7e40cb6c24ebaf1ada22f1e0eb87da91d95341c3bacca38d16d671c

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require "thor"

require_relative "../make_pr/base"

module Neetob
  class CLI
    module Github
      module Gems
        class Release < MakePr::Base
          attr_accessor :gems, :sandbox

          def initialize(gems, sandbox = false)
            super()
            @gems = gems
            @sandbox = sandbox
          end

          def run
            matching_gems = find_all_matching_gems(gems)
            delete_and_create_temp_neetob_dir
            matching_gems.each do |gem|
              ui.info("\nWorking on #{gem}\n")
              begin
                shallow_clone_repo_in_tmp_dir("bigbinary/#{gem}")
                build_gem(gem)
                release_gem(gem)
                if $?.success?
                  ui.success("Gem \"#{gem}\" released successfully")
                end
              rescue StandardError => e
                ExceptionHandler.new(e).process
              end
            end
            `rm -rf /tmp/neetob`
          end

          private

            def build_gem(gem)
              ui.info(`#{cd_to_repo_in_tmp_dir(gem)} && gem build`)
            end

            def release_gem(gem)
              ui.info(`#{cd_to_repo_in_tmp_dir(gem)} && fury push #{gem}-*.gem --as neeto-live`)
            end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
neetob-0.4.6 lib/neetob/cli/github/gems/release.rb
neetob-0.4.5 lib/neetob/cli/github/gems/release.rb
neetob-0.4.4 lib/neetob/cli/github/gems/release.rb
neetob-0.4.3 lib/neetob/cli/github/gems/release.rb
neetob-0.4.2 lib/neetob/cli/github/gems/release.rb
neetob-0.4.1 lib/neetob/cli/github/gems/release.rb
neetob-0.4.0 lib/neetob/cli/github/gems/release.rb
neetob-0.3.2 lib/neetob/cli/github/gems/release.rb
neetob-0.3.1 lib/neetob/cli/github/gems/release.rb
neetob-0.3.0 lib/neetob/cli/github/gems/release.rb