Class: Command::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/command/repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Repository

Returns a new instance of Repository.



3
4
5
6
# File 'lib/command/repository.rb', line 3

def initialize(project)
  @project = project
  @cmds = []
end

Instance Method Details

#add(cmd, options = {}) ⇒ Object



8
9
10
# File 'lib/command/repository.rb', line 8

def add(cmd, options = {})
  @cmds << cmd.new(rvm_prefix, options)
end

#executeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/command/repository.rb', line 12

def execute
  with_transaction do |trash|
    while @cmds.any?
      command = @cmds.shift
      puts(command.name.brown)

      command.execute
      trash.unshift(command)
    end
  end

  puts 'Success bump current gem!'.green
end