Sha256: 810aca0a5c8dd80e47f4a918db86e90870ed0ff76039a8f36c11bb3106bbb37b

Contents?: true

Size: 1.35 KB

Versions: 5

Compression:

Stored size: 1.35 KB

Contents

require 'rscm/directories'

class ScmController < ApplicationController

  # Checks out a working copy into the project's checkout dir.
  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

  # Shows the status page with the JS magic that
  # will pull the checkout_list
  def checkout_status
    @checkout_list_path = "/scm/checkout_list/#{@params['id']}"
  end

  # Sends the file containing the files currently being checked out.to the client
  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
  
  # Creates the SCM repo
  def create
    load_project
    @project.scm.create
    redirect_to :controller => "project", :action => "view", :id => @project.name
  end

  def delete_working_copy
    load_project
    @project.delete_working_copy
    redirect_to :controller => "project", :action => "view", :id => @project.name
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
damagecontrol-0.5.0.1391 app/controllers/scm_controller.rb
damagecontrol-0.5.0.1392 app/controllers/scm_controller.rb
damagecontrol-0.5.0.1393 app/controllers/scm_controller.rb
damagecontrol-0.5.0 app/controllers/scm_controller.rb
damagecontrol-0.5.0.1404 app/controllers/scm_controller.rb