Class: ScmController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ScmController
- Defined in:
- app/controllers/scm_controller.rb
Instance Method Summary collapse
-
#checkout ⇒ Object
Checks out a working copy into the project’s checkout dir.
-
#checkout_list ⇒ Object
Sends the file containing the files currently being checked out.to the client.
-
#checkout_status ⇒ Object
Shows the status page with the JS magic that will pull the checkout_list.
-
#create ⇒ Object
Creates the SCM repo.
- #delete_working_copy ⇒ Object
Methods inherited from ApplicationController
Constructor Details
This class inherits a constructor from ApplicationController
Instance Method Details
#checkout ⇒ Object
Checks out a working copy into the project’s checkout dir.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/scm_controller.rb', line 6 def checkout load_project # Do this asynch to give a fast response # TODO: guard against multiple concurrent checkouts # TODO: put the thread on the daemon side instead Thread.new do @project.checkout end # Doing a redirect since this *should* be called via HTTP POST. TODO: verify METHOD redirect_to :action => "checkout_status", :id => @project.name end |
#checkout_list ⇒ Object
Sends the file containing the files currently being checked out.to the client
27 28 29 30 31 32 33 34 |
# File 'app/controllers/scm_controller.rb', line 27 def checkout_list load_project if(File.exist?(@project.checkout_list_file)) send_file(@project.checkout_list_file) else render_text("No files checked out yet") end end |
#checkout_status ⇒ Object
Shows the status page with the JS magic that will pull the checkout_list
22 23 24 |
# File 'app/controllers/scm_controller.rb', line 22 def checkout_status @checkout_list_path = "/scm/checkout_list/#{@params['id']}" end |
#create ⇒ Object
Creates the SCM repo
37 38 39 40 41 |
# File 'app/controllers/scm_controller.rb', line 37 def create load_project @project.scm.create redirect_to :controller => "project", :action => "view", :id => @project.name end |
#delete_working_copy ⇒ Object
43 44 45 46 47 |
# File 'app/controllers/scm_controller.rb', line 43 def delete_working_copy load_project @project.delete_working_copy redirect_to :controller => "project", :action => "view", :id => @project.name end |