Class: Command::Repository
- Inherits:
-
Object
- Object
- Command::Repository
- Defined in:
- lib/command/repository.rb
Instance Method Summary collapse
- #add(cmd, options = {}) ⇒ Object
- #execute ⇒ Object
-
#initialize(project) ⇒ Repository
constructor
A new instance of Repository.
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, = {}) @cmds << cmd.new(rvm_prefix, ) end |
#execute ⇒ Object
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 |