Class: Bummr::CLI

Inherits:
Thor
  • Object
show all
Includes:
Log, Scm
Defined in:
lib/bummr/cli.rb

Instance Method Summary collapse

Methods included from Log

#log

Instance Method Details

#bisectObject



67
68
69
70
71
72
73
74
# File 'lib/bummr/cli.rb', line 67

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) ⇒ Object



10
11
12
# File 'lib/bummr/cli.rb', line 10

def check(fullcheck=true)
  Bummr::Check.instance.check(fullcheck)
end

#remove_commit(sha) ⇒ Object



77
78
79
# File 'lib/bummr/cli.rb', line 77

def remove_commit(sha)
  Bummr::Remover.instance.remove_commit(sha)
end

#testObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/bummr/cli.rb', line 50

def test
  check(false)

  if yes? "Do you want to test the build now?"
    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

#updateObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/bummr/cli.rb', line 24

def update
  system("bundle install")
  ask_questions

  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]
    )

    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