Sha256: 4b282b721d1cd7732bdde1b15c88691f0ce4f7d07a6c8ad1901e808f083831c8

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 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(gem)} && gem build`)
            end

            def release_gem(gem)
              ui.info(`#{cd_to_repo(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.16 lib/neetob/cli/github/gems/release.rb
neetob-0.4.15 lib/neetob/cli/github/gems/release.rb
neetob-0.4.14 lib/neetob/cli/github/gems/release.rb
neetob-0.4.13 lib/neetob/cli/github/gems/release.rb
neetob-0.4.12 lib/neetob/cli/github/gems/release.rb
neetob-0.4.11 lib/neetob/cli/github/gems/release.rb
neetob-0.4.10 lib/neetob/cli/github/gems/release.rb
neetob-0.4.9 lib/neetob/cli/github/gems/release.rb
neetob-0.4.8 lib/neetob/cli/github/gems/release.rb
neetob-0.4.7 lib/neetob/cli/github/gems/release.rb