aws-logs 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: 93209b1d08b94e59613794379fbc6da21b69113c7ef5df6bf008fae348d1d129
4
- data.tar.gz: a3d4f821990b9fcf41747df792595cffa1c8ba8cb41bcbceb2f915d4a08f68e4
3
+ metadata.gz: dc241de69ed1390414efd6a39d3d97d341bbdcfbca2119cf98045c5abb268f35
4
+ data.tar.gz: 5f2ffe9ec6f6bea4a9626471c7b6acc58768e88b53adcf7ef3b3dcf28fb4b37b
5
5
  SHA512:
6
- metadata.gz: 98436a84cb82b97d6872e65ac07a2c9cb1ff8eac228288df4df28b85e0dddb4139641f5bacdd66977355b1b789aea60bc1d21dc7dda8c0e4ce4af220a15c4874
7
- data.tar.gz: 6877115a9d916ab5ac7f84ae92b1d89ad364e807e3e3f126d2ffdcf0699d2fade8e0e5d8e661a7d55635f98bad8a7b345ed6a047dedefde4fd0de26ac80fc977
6
+ metadata.gz: 3829280d3ea9e1f37f3c5cfabd1914cdecc9831989ca306699c1cb4cbcc9e5950a684661dea0bac3a674565766cd39c435cdc9a7e72c22bc096357ae11e99f0d
7
+ data.tar.gz: 5503713da8c2b5123254b5cce349684dfe8448a43fc94e90d372bde7a6ccd8791a33cb19f5f1187966421c3255560ee74547df6db51e9814ec819f23d3cf47e3
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.3.2]
7
+ - #1 clean up end_loop_signal logic
8
+
6
9
  ## [0.3.1]
7
10
  - fix --no-follow option
8
11
 
@@ -52,6 +52,6 @@ To match terms with spaces in it, you'll need quotes around it. Otherise, the ma
52
52
 
53
53
  aws-logs tail /aws/codebuild/demo --filter-pattern '"Wed Nov 27 23"' --since 3h --no-follow
54
54
 
55
- Here's an example of matching with an exclude patter using the `-` (minus sign).
55
+ Here's an example of matching with an exclude pattern using the `-` (minus sign).
56
56
 
57
57
  aws-logs tail /aws/codebuild/demo --filter-pattern '"ERROR" - "Exiting"' --since 3h --no-follow
data/lib/aws_logs/tail.rb CHANGED
@@ -41,7 +41,7 @@ module AwsLogs
41
41
  display
42
42
  since, now = now, current_now
43
43
  loop_count!
44
- sleep 5 if @follow && !@@end_loop_signal && !ENV["AWS_LOGS_TEST"]
44
+ sleep 5 if @follow && !ENV["AWS_LOGS_TEST"]
45
45
  end
46
46
  # Refresh and display a final time in case the end_loop gets interrupted by stop_follow!
47
47
  refresh_events(since, now)
@@ -100,9 +100,7 @@ module AwsLogs
100
100
  return unless follow_until
101
101
 
102
102
  messages = @events.map(&:message)
103
- if messages.detect { |m| m.include?(follow_until) }
104
- @@end_loop_signal = true
105
- end
103
+ @@end_loop_signal = messages.detect { |m| m.include?(follow_until) }
106
104
  end
107
105
 
108
106
  def say(text)
@@ -113,15 +111,14 @@ module AwsLogs
113
111
  @output.join("\n") + "\n"
114
112
  end
115
113
 
116
- @@end_loop_signal = false
117
114
  def set_trap
118
115
  Signal.trap("INT") {
119
116
  puts "\nCtrl-C detected. Exiting..."
120
- @@end_loop_signal = true # useful to control loop
121
117
  exit # immediate exit
122
118
  }
123
119
  end
124
120
 
121
+ @@end_loop_signal = false
125
122
  def self.stop_follow!
126
123
  @@end_loop_signal = true
127
124
  end
@@ -1,3 +1,3 @@
1
1
  module AwsLogs
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen