Class: Bummr::CLI

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

Instance Method Summary collapse

Methods included from Prompt

#yes?

Methods included from Log

#log

Instance Method Details

#bisectObject



71
72
73
74
75
76
77
78
# 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) ⇒ Object



12
13
14
# File 'lib/bummr/cli.rb', line 12

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

#remove_commit(sha) ⇒ Object



81
82
83
# File 'lib/bummr/cli.rb', line 81

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

#testObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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

#updateObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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