Sha256: 5ebab303a9b3c0486213e7f31a21060e8401e1b9323119301ebb584ae51a0c65

Contents?: true

Size: 1.28 KB

Versions: 34

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

34 entries across 34 versions & 1 rubygems

Version Path
neetob-0.4.34 lib/neetob/cli/github/gems/release.rb
neetob-0.4.33 lib/neetob/cli/github/gems/release.rb
neetob-0.4.32 lib/neetob/cli/github/gems/release.rb
neetob-0.4.31 lib/neetob/cli/github/gems/release.rb
neetob-0.4.30 lib/neetob/cli/github/gems/release.rb
neetob-0.4.28 lib/neetob/cli/github/gems/release.rb
neetob-0.4.27 lib/neetob/cli/github/gems/release.rb
neetob-0.4.26 lib/neetob/cli/github/gems/release.rb
neetob-0.4.24 lib/neetob/cli/github/gems/release.rb
neetob-0.4.23 lib/neetob/cli/github/gems/release.rb
neetob-0.4.22 lib/neetob/cli/github/gems/release.rb
neetob-0.4.21 lib/neetob/cli/github/gems/release.rb
neetob-0.4.20 lib/neetob/cli/github/gems/release.rb
neetob-0.4.19 lib/neetob/cli/github/gems/release.rb