Class: Neetob::CLI::Github::Gems::Release

Inherits:
MakePr::Base show all
Defined in:
lib/neetob/cli/github/gems/release.rb

Constant Summary

Constants inherited from MakePr::Base

MakePr::Base::BRANCH_NAME, MakePr::Base::PR_TITLE

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from MakePr::Base

#branch_name, #pr_title

Attributes inherited from Base

#client

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(gems, sandbox = false) ⇒ Release

Returns a new instance of Release.



14
15
16
17
18
# File 'lib/neetob/cli/github/gems/release.rb', line 14

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

Instance Attribute Details

#gemsObject

Returns the value of attribute gems.



12
13
14
# File 'lib/neetob/cli/github/gems/release.rb', line 12

def gems
  @gems
end

#sandboxObject

Returns the value of attribute sandbox.



12
13
14
# File 'lib/neetob/cli/github/gems/release.rb', line 12

def sandbox
  @sandbox
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/neetob/cli/github/gems/release.rb', line 20

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