require_relative '../../lib/qaplay_projects' require_relative '../../lib/localhost_projects' class ProjectsController < ApplicationController skip_before_action :verify_authenticity_token, if: :json_request? skip_before_action :verify_authenticity_token, only: [:project_login] before_action :validate_session def initialize @projects = ENV['RAILS_ENV'] == 'test' ? LocalhostProjects.new : QAPlayProjects.new end def list render :json => projects_list end def fetch project = project_from_id(params['id']) # TODO: fail if not found model = project.dup # add anything interesting here... render :json => model end protected def projects_list @projects.projects(@current_session[:user], @current_session[:p4ticket]) end def project_from_id(id) index = projects_list.index { |obj| obj['id'] == id } return projects_list[index] unless index.nil? end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 17271 | tjuricek | Remove deprecated Ruby implementation. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services/mock_raymond/app/controllers/projects_controller.rb | |||||
#1 | 16072 | tjuricek |
Helix Cloud integration for Helix Sync services. This includes a "mock_raymond" rails application for keeping tabs on basic integration with Helix Cloud. We do not test against a live server. See integration history for more details. |
||
//guest/doug_scheirer/helix-web-services/main/source/helix_web_services/mock_raymond/app/controllers/projects_controller.rb | |||||
#3 | 16024 | Doug Scheirer | Some cloud spec forking, got the mock_raymond to spin up in cloud testing, split normal vs cloud spec output | ||
#2 | 15877 | Doug Scheirer | Cleanup mock behavior, get create client working again in HWS for cloud | ||
#1 | 15851 | Doug Scheirer | mock raymond service, rails app development standin for the helix cloud webapp |