look_out 0.1.8 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0719fb0172909e6f35696d5031c74eeaf12f12d2d9ec520cdff8e66930e1c1b9'
4
- data.tar.gz: 7cc23d87d6b7fefb5595036b23854249128dcffe36323e3419931ecea09d9cf9
3
+ metadata.gz: b38ed28a46424bb2710d88f326eaabfabec22b36788e0963ee2d7edaf54d4f32
4
+ data.tar.gz: 51530a257f84d5d1b2d2e3a66478bc890193eb308a405d4f42b0cdda740cb017
5
5
  SHA512:
6
- metadata.gz: 49cb52fb00bb94a4e5bfadbf8fd863afd6e160e748a4c067a9b7a742552eecbb0daeab4279d6b6525fe01d75f66edc04edc6084664792973cf75c572002fae60
7
- data.tar.gz: 386ccf5bc0bbccdcb08634e3b2c6ed6331b348c301af2446955ef668fe5d93454f2e8f71ccd9b5502c5d593a5190267891bab8f7e94a8be110700e17e9513fe2
6
+ metadata.gz: f0634faf10e0361b6ad1977b92ad35630821ab25071588f37eec0aee3a4c07b273524d1184a412dfa51b6c40c389d617e1bfa4a49a16e50f2891f81baf31cf80
7
+ data.tar.gz: 5d8fe87c49e868ed83599f189b2f7566d0f19d8d26049774f7afa3b9da9eac657f1b988761cea04a0a3ef0053d5447f0239185bda960d7cba43ddad04e7ba43e
data/History.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 0.1.9 / 2019-04-13
3
+ ==================
4
+
5
+ * Refactor for multithread/multiservice arch
6
+ * Drop legacy config options
7
+
2
8
  0.1.8 / 2019-04-13
3
9
  ==================
4
10
 
@@ -12,38 +12,52 @@ module LookOut
12
12
  end
13
13
  end
14
14
 
15
- response = LookOut::Cast.create(
16
- api_key: LookOut.config.api_key,
17
- user: LookOut.config.user,
18
- data: output_hash,
19
- repo: LookOut.config.repo,
20
- sha: sha,
21
- env: env
22
- )
23
-
24
15
  hydra = Typhoeus::Hydra.hydra
25
16
 
26
- red_request = Typhoeus::Request.new(
27
- 'https://red-cove.sea-aye.com/v1/sails',
28
- method: :post,
29
- body: {
30
- api_key: LookOut.config.red_cove_api_key,
31
- data: SimpleCov.result.to_hash['RSpec'].to_json,
32
- sail: {
33
- uid: uid,
34
- sha: sha,
35
- env: env
17
+ if LookOut.config.first_mate_api_key
18
+ first_mate_request = Typhoeus::Request.new(
19
+ 'https://first-mate.sea-aye.com/v1/casts',
20
+ method: :post,
21
+ headers: { 'Content-Type' => 'application/json' },
22
+ body: {
23
+ api_key: LookOut.config.first_mate_api_key,
24
+ data: output_hash,
25
+ cast: {
26
+ user: LookOut.config.user,
27
+ sha: sha,
28
+ env: env
29
+ }
30
+ }.to_json
31
+ )
32
+
33
+ hydra.queue(first_mate_request)
34
+ end
35
+
36
+ if LookOut.config.red_cove_api_key && defined?(SimpleCov)
37
+ red_request = Typhoeus::Request.new(
38
+ 'https://red-cove.sea-aye.com/v1/sails',
39
+ method: :post,
40
+ body: {
41
+ api_key: LookOut.config.red_cove_api_key,
42
+ data: SimpleCov.result.to_hash['RSpec'].to_json,
43
+ sail: {
44
+ uid: uid,
45
+ sha: sha,
46
+ env: env
47
+ }
36
48
  }
37
- }
38
- )
49
+ )
50
+ hydra.queue(red_request)
51
+ end
39
52
 
40
- hydra.queue(red_request)
41
53
  hydra.run
42
54
 
43
- pp red_request
44
- pp red_request.response
45
-
46
- STDERR.puts "\n[look-out] Cast rejected, check api key.\n" if response.code == 401
55
+ if ENV['LOOK_OUT_VERBOSE']
56
+ pp first_mate_request
57
+ pp first_mate_request&.response
58
+ pp red_request
59
+ pp red_request&.response
60
+ end
47
61
  end
48
62
 
49
63
  private
@@ -1,3 +1,3 @@
1
1
  module LookOut
2
- VERSION = '0.1.8'.freeze
2
+ VERSION = '0.1.9'.freeze
3
3
  end
data/lib/look_out.rb CHANGED
@@ -1,12 +1,7 @@
1
- require 'hashie'
2
- require 'httparty'
3
1
  require 'typhoeus'
4
2
  require 'utils/compact'
5
3
 
6
4
  require 'look_out/version'
7
- require 'look_out/client'
8
-
9
- require 'look_out/cast'
10
5
 
11
6
  module LookOut
12
7
  class << self
@@ -16,12 +11,9 @@ module LookOut
16
11
  def self.configure
17
12
  self.config ||= Configuration.new
18
13
  yield(config)
19
-
20
- # Allow overriding base_uri.
21
- self.config.base_uri ||= 'https://api.sea-aye.com/v1'
22
14
  end
23
15
 
24
16
  class Configuration
25
- attr_accessor :api_key, :repo, :user, :base_uri, :red_cove_api_key
17
+ attr_accessor :user, :red_cove_api_key, :first_mate_api_key
26
18
  end
27
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: look_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hood
@@ -218,8 +218,6 @@ files:
218
218
  - bin/console
219
219
  - bin/setup
220
220
  - lib/look_out.rb
221
- - lib/look_out/cast.rb
222
- - lib/look_out/client.rb
223
221
  - lib/look_out/rspec/look_out_formatter.rb
224
222
  - lib/look_out/version.rb
225
223
  - lib/utils/compact.rb
data/lib/look_out/cast.rb DELETED
@@ -1,10 +0,0 @@
1
- module LookOut
2
- class Cast
3
- include ::HTTParty
4
- extend Client
5
-
6
- def self.create(options)
7
- client.post('/casts', body: options.to_json)
8
- end
9
- end
10
- end
@@ -1,12 +0,0 @@
1
- module LookOut
2
- # Encapsulates the configuration of each client before JIT before requests
3
- # are made. This allows us to use our configuration which won't have been
4
- # available until runtime, not load time.
5
- module Client
6
- def client
7
- base_uri LookOut.config.base_uri
8
- headers('Content-Type' => 'application/json')
9
- self
10
- end
11
- end
12
- end