Class: RoxClient::Client
- Inherits:
-
Object
- Object
- RoxClient::Client
- Defined in:
- lib/rox-client-ruby/client.rb
Instance Method Summary collapse
-
#initialize(server, options = {}) ⇒ Client
constructor
A new instance of Client.
- #process(test_run) ⇒ Object
Constructor Details
#initialize(server, options = {}) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rox-client-ruby/client.rb', line 7 def initialize server, = {} @server = server @publish, @local_mode, @workspace = [:publish], [:local_mode], [:workspace] @cache_payload, @print_payload, @save_payload = [:cache_payload], [:print_payload], [:save_payload] @client_name = [:client_name] = { workspace: @workspace } .merge! server_name: @server.name, project_api_id: @server.project_api_id if @server .merge! client_name: @client_name if @client_name @cache = Cache.new @uid = UID.new workspace: @workspace end |
Instance Method Details
#process(test_run) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rox-client-ruby/client.rb', line 22 def process test_run puts return fail "No server to publish results to" unless @server return fail "Client name must be specified" unless @client_name test_run.uid = @uid.load_uid = @server. cache_enabled = @cache_payload && load_cache [:cache] = @cache if cache_enabled return false unless payload = build_payload(test_run, ) published = if !@publish puts Paint["ROX - Publishing disabled", :yellow] false elsif publish_payload payload @cache.save test_run if cache_enabled true else false end save_payload payload if @save_payload print_payload payload if @print_payload published end |