Class: ProjectGroup::Command
- Inherits:
-
Object
- Object
- ProjectGroup::Command
- Includes:
- FromHash
- Defined in:
- lib/project_group/command.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#group_name ⇒ Object
Returns the value of attribute group_name.
Instance Method Summary collapse
- #cycle ⇒ Object
- #git ⇒ Object
- #info ⇒ Object
- #open ⇒ Object
- #parse!(args) ⇒ Object
- #push ⇒ Object
- #run! ⇒ Object
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
4 5 6 |
# File 'lib/project_group/command.rb', line 4 def cmd @cmd end |
#group_name ⇒ Object
Returns the value of attribute group_name.
4 5 6 |
# File 'lib/project_group/command.rb', line 4 def group_name @group_name end |
Instance Method Details
#cycle ⇒ Object
24 25 26 27 28 |
# File 'lib/project_group/command.rb', line 24 def cycle group.singles.each do |proj| puts "#{proj.path} #{proj.status.inspect} #{proj.spec_output}" end end |
#git ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/project_group/command.rb', line 51 def git group.singles.each do |proj| if proj.repo.changes? ec "gittower #{proj.path}" puts "Enter to Continue" STDIN.gets end end end |
#info ⇒ Object
30 31 32 33 34 35 |
# File 'lib/project_group/command.rb', line 30 def info puts "Group #{group.name}" group.singles.each do |proj| puts "#{proj.name} #{proj.path}" end end |
#open ⇒ Object
37 38 39 40 41 |
# File 'lib/project_group/command.rb', line 37 def open proj = SublimeProject.new(:group => group) proj.write! ec "subl --project #{proj.path}" end |
#parse!(args) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/project_group/command.rb', line 61 def parse!(args) self.cmd = args.first OptionParser.new do |opts| opts. = "Usage: example.rb [options]" opts.on("-n", "--name name", "Group Name") do |v| self.group_name = v end end.parse!(args) end |
#push ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/project_group/command.rb', line 43 def push group.singles.each do |proj| if !proj.repo.pushed? ec "cd #{proj.path} && git push origin master:master" end end end |
#run! ⇒ Object
20 21 22 |
# File 'lib/project_group/command.rb', line 20 def run! send(cmd) end |