agent_q 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/agent_q +4 -3
  3. data/lib/agent_q.rb +11 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7876ff81a8ab71eace97e028fa79597fa15aaa31
4
- data.tar.gz: e3a40d641013e9b5de5cdd1bb7f41f3e3fead6d6
3
+ metadata.gz: 25150a910bab4791081c525f8b2dda8bea05439b
4
+ data.tar.gz: 685427b6e0066eaf4523bcf7ee48a173b9ba4b5f
5
5
  SHA512:
6
- metadata.gz: 59842627dc04f76aa7519e02705095a45a44a7939bdc88581a1d098c38511c89004102897d7c42d9debcec56bd4388525fe38f16087ee5cb211e1b1572e3392a
7
- data.tar.gz: 7d3a0be1b54230c9413b1c19d25062a5a13bc8cad0095c5a67a555a9d46f34e2b66c8babc8089d1496304292a61c2ce3d2c42ffc6b705a25e482b50a3511d036
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
- username = ARGV[1]
7
- password = ARGV[2]
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
- puts results['scores'].first['score']
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent_q
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Pugh