agent_q 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/agent_q +4 -3
- data/lib/agent_q.rb +11 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25150a910bab4791081c525f8b2dda8bea05439b
|
4
|
+
data.tar.gz: 685427b6e0066eaf4523bcf7ee48a173b9ba4b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8127e6819d48305c907ac45fc331db3f66f0de5785a48ac01c3811719023ca32bf75c9c80625eeaa385712bce8f8ce276fa68dd3465efcb29de05cab6c3ff296
|
7
|
+
data.tar.gz: f02e721ee36daba834d58844656ac5b2601e670cd9fec85f39a1262a1bbafb3bd066568afd9fbc5cf27d3c0cf8487b8546ca1e65c8a2c6a37b00dd970934e56a
|
data/bin/agent_q
CHANGED
@@ -3,8 +3,9 @@ require 'rubygems'
|
|
3
3
|
require_relative '../lib/agent_q'
|
4
4
|
|
5
5
|
quepid_case = ARGV[0]
|
6
|
-
|
7
|
-
|
6
|
+
threshold_score = ARGV[1]
|
7
|
+
username = ARGV[2]
|
8
|
+
password = ARGV[3]
|
8
9
|
|
9
10
|
|
10
|
-
AgentQ.new(quepid_case, username, password).run
|
11
|
+
AgentQ.new(quepid_case, threshold_score, username, password).run
|
data/lib/agent_q.rb
CHANGED
@@ -11,10 +11,11 @@ class AgentQ
|
|
11
11
|
|
12
12
|
QUEPID_URL = 'http://app.quepid.com'
|
13
13
|
|
14
|
-
def initialize(quepid_case, username, password)
|
14
|
+
def initialize(quepid_case, threshold_score, username, password)
|
15
15
|
Capybara.default_driver = :poltergeist
|
16
16
|
Capybara.app_host = QUEPID_URL
|
17
17
|
@quepid_case = quepid_case
|
18
|
+
@threshold_score = threshold_score
|
18
19
|
@username = username
|
19
20
|
@password = password
|
20
21
|
end
|
@@ -45,9 +46,16 @@ class AgentQ
|
|
45
46
|
|
46
47
|
if results['message']
|
47
48
|
puts "Error checking case #{@quepid_case}: #{results['message']}"
|
49
|
+
exit 1
|
48
50
|
else
|
49
|
-
|
51
|
+
score = results['scores'].first['score']
|
52
|
+
if score.to_i > @threshold_score.to_i
|
53
|
+
puts "Case #{@quepid_case} scored (#{score}) above threshold of #{@threshold_score}"
|
54
|
+
exit 0
|
55
|
+
else
|
56
|
+
puts "Case #{@quepid_case} scored (#{score}) below threshold of #{@threshold_score}"
|
57
|
+
exit 1
|
58
|
+
end
|
50
59
|
end
|
51
|
-
|
52
60
|
end
|
53
61
|
end
|