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
26 27 28 29 30 |
# File 'lib/project_group/command.rb', line 26 def cycle group.singles.each do |proj| puts "#{proj.path} #{proj.status.inspect} #{proj.spec_output}" end end |
#git ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/project_group/command.rb', line 53 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
32 33 34 35 36 37 |
# File 'lib/project_group/command.rb', line 32 def info puts "Group #{group.name}" group.singles.each do |proj| puts "#{proj.name} #{proj.path}" end end |
#open ⇒ Object
39 40 41 42 43 |
# File 'lib/project_group/command.rb', line 39 def open proj = SublimeProject.new(:group => group) proj.write! ec "subl --project #{proj.path}" end |
#parse!(args) ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/project_group/command.rb', line 63 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
45 46 47 48 49 50 51 |
# File 'lib/project_group/command.rb', line 45 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
22 23 24 |
# File 'lib/project_group/command.rb', line 22 def run! send(cmd) end |