require 'fileutils' require 'hws_settings' require 'p4_util' # These are helper methods that should be common to most modular 'Apps' in # Helix Web Services. module HWSHelpers # This will ensure that the environment contains a p4 handle that is # configured using our typical `hws_settings` options. # # It should be rare to actually require using this method. This is typically # generated by authentication middleware. # # The p4 is possibly *not* connected or logged in. def require_p4 unless !env['p4'].nil? p4 = P4Util.open_from_env(env) p4.connect env['p4'] = p4 end end # This ensures that the `p4` handle has an associated temporary client # workspace. # # The local temporary directory is saved under 'p4_root'. def require_p4_with_temp_client require_p4 env['p4_root'] = P4Util.create_temp_client(env['p4']) end def p4 env['p4'] || fail('require_p4 not called') end def user env['AUTH_CREDENTIALS'].first end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 15854 | Doug Scheirer |
Cloud auth and projects Still getting 2 extra project errors even thought nothing is configured to be cloud enabled |
||
#3 | 15845 | Doug Scheirer | Integ from main | ||
#2 | 15726 | Doug Scheirer | merge from main | ||
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_services/lib/hws_helpers.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services/lib/hws_helpers.rb | |||||
#3 | 15132 | tjuricek | Provde a basic submit -e mechanism on classic perforce workspaces. | ||
#2 | 15110 | tjuricek | Revise changes methods for new p4 connection handling, add server specs, remove model references in client, and update asciidoc documentation. | ||
#1 | 15032 | tjuricek |
Starting config and doc revisions. System is now broken while revisions underway. Configuration of the p4d connection is now done via a single HWSSettings middleware object injected into the Rack env. The HWSP4Cleanup middleware now cleans up any p4 injected into the Rack env. The Auth::App class now mostly just contains one method to generate a p4 ticket. /auth/v1/login. Added yard documentation for the main project. Yard docs have been reconfigured to dump into build/ directories. This should probably be done with each release. Hm... The top level rake file contains a task, 'all:doc', to update our documentation. This should probably be run for each checkin. Hm... Specs are now using Rack::Test on top of a 'live' p4d. I'd suggest you still use the p4util mechanism, which now dumps to a /tmp folder, so we can safely add P4IGNORE rules back into your local .p4config file. Old 'perforce' application now called 'helix_versioning_engine'. Removing cache data. Helix Sync may be slow. It may also get axed. We'll see. |