codebuild-tail 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 725f46b3de3bd6b62ec3103f2f9dfb250b36a40d
4
- data.tar.gz: d3c99c52a294767bfdf85bb108461a36950a213a
3
+ metadata.gz: da04bdc77c07bbc68c2a49958cf44640453990f9
4
+ data.tar.gz: 884e99f69423c313e47eae18f51f064b8d5d67c2
5
5
  SHA512:
6
- metadata.gz: 220fcf23d5428dd8c95ea796f1a9eff3e36b343c368aaf3382bd5f6cafb9637a46a3c7bbfb3472172fbc045f14efb0dbfb6920662b5fd7898be7aad6d09349bf
7
- data.tar.gz: 4a2c100af5a95112bcae79fa01a19e339543acd2816547eefd938134f5daf1630dd82dff7d1282422b7f4459a8d9f1285fb377ab2beacf61c363808e5c733a72
6
+ metadata.gz: 8813f43fe0f1cfb279252f8db84e2f78b5b46d16d51bf8f8a60a712a86ec184b879a6fe2f85984b0162d9a312ad5ade1b8c72fa4a7c38eb1155d7e9d9f61471a
7
+ data.tar.gz: 6232f1869a6dcdccbf2b0f3c5d3ee31d8b926325c0604a8ce6c330259c81c9dcb0819f828641b93515d2f12b15c990f2a40e5cb13906921cfabac8a67b3cead6
@@ -1,14 +1,23 @@
1
1
 
2
2
  module CodeBuildTail
3
3
  class Logs
4
- def initialize(_cloudwatch_client, poll_from_start, log_limit)
4
+ def initialize(cloudwatch_client, poll_from_start, log_limit)
5
5
  @log_limit = log_limit
6
6
  @next_forward_token = nil
7
7
  @poll_from_start = poll_from_start
8
- @cloudwatch_client = Aws::CloudWatchLogs::Client.new
8
+ @cloudwatch_client = cloudwatch_client
9
9
  end
10
10
 
11
11
  def get_latest_logs(group_name, stream_name)
12
+ # Sometimes when a CodeBuild job is first started it doesn't yet
13
+ # have a CloudWatch group and/or stream name associated with it.
14
+ # In this case, the keys for these values will be missing from
15
+ # the returned hash so they show up in this function as nil. We
16
+ # can simply return an empty list in this case because the app
17
+ # logic will then update the state of the build which will cause
18
+ # this function to work on subsquent attempts.
19
+ return [] if group_name.nil? || stream_name.nil?
20
+
12
21
  params = {
13
22
  log_group_name: group_name,
14
23
  log_stream_name: stream_name,
@@ -1,5 +1,5 @@
1
1
 
2
2
 
3
3
  module CodeBuildTail
4
- VERSION = "0.1.0".freeze
4
+ VERSION = "0.2.0".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebuild-tail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Roddy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2019-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec