class Bummr::CLI

Public Instance Methods

bisect() click to toggle source
# File lib/bummr/cli.rb, line 71
def bisect
  check(false)

  if yes? "Would you like to bisect in order to find which gem is causing " +
          "your build to break? (y/n)"
    Bummr::Bisecter.instance.bisect
  end
end
check(fullcheck=true) click to toggle source
# File lib/bummr/cli.rb, line 12
def check(fullcheck=true)
  Bummr::Check.instance.check(fullcheck)
end
remove_commit(sha) click to toggle source
# File lib/bummr/cli.rb, line 81
def remove_commit(sha)
  Bummr::Remover.instance.remove_commit(sha)
end
test() click to toggle source
# File lib/bummr/cli.rb, line 54
def test
  check(false)

  if yes? "Do you want to test the build now? (y/n)"
    system "bundle install"
    puts "Testing the build!".color(:green)

    if system(TEST_COMMAND) == false
      bisect
    else
      puts "Passed the build!".color(:green)
      puts "See log/bummr.log for details".color(:yellow)
    end
  end
end
update() click to toggle source
# File lib/bummr/cli.rb, line 28
def update
  system("bundle install")
  display_info

  if yes? "Are you ready to use Bummr? (y/n)"
    check
    log("Bummr update initiated #{Time.now}")

    outdated_gems = Bummr::Outdated.instance.outdated_gems(
      all_gems: options[:all], group: options[:group], gem: options[:gem]
    )

    if outdated_gems.empty?
      puts "No outdated gems to update".color(:green)
    else
      Bummr::Updater.new(outdated_gems).update_gems

      git.rebase_interactive(BASE_BRANCH)
      test
    end
  else
    puts "Thank you!".color(:green)
  end
end

Private Instance Methods

display_info() click to toggle source
# File lib/bummr/cli.rb, line 87
def display_info
  puts "Bummr #{VERSION}"
  puts "To run Bummr, you must:"
  puts "- Be in the root path of a clean git branch off of " + "#{BASE_BRANCH}".color(:yellow)
  puts "- Have no commits or local changes"
  puts "- Have a 'log' directory, where we can place logs"
  puts "- Have your build configured to fail fast (recommended)"
  puts "- Have locked any Gem version that you don't wish to update in your Gemfile"
  puts "- It is recommended that you lock your versions of `ruby` and `rails` in your `Gemfile`"
  puts "\n"
  puts "Your test command is: " + "'#{TEST_COMMAND}'".color(:yellow)
  puts "\n"
  print_received_options
end
print_received_options() click to toggle source