Class: T1k::Commands::Ship
- Inherits:
-
Object
- Object
- T1k::Commands::Ship
- Defined in:
- lib/t1k/commands/ship.rb
Class Method Summary collapse
Class Method Details
.commands_if_branch(branch) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/t1k/commands/ship.rb', line 31 def self.commands_if_branch(branch) [ "git checkout #{branch}", "git pull --rebase #{branch}", "git commit -v", "git push origin #{branch}" ].each do |cmd| system cmd end end |
.commands_if_master(branch) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/t1k/commands/ship.rb', line 20 def self.commands_if_master(branch) [ "git checkout master", "git pull --rebase master", "git merge #{branch}", "git commit -v", "git push origin master" ].each do |cmd| system cmd end end |
.run ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/t1k/commands/ship.rb', line 5 def self.run T1k.setup_credentials default_remote_branch = T1k::Repository.default_remote_branch branch = T1k::Commands::Branch.actual_branch.strip if default_remote_branch == :master commands_if_master(branch) elsif default_remote_branch == :branch commands_if_branch(branch) else puts "Invalid default_remote_branch" end end |