l2meter 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 8813cc61c6cf80054b1f532ac952b4a3a8e9bcc1
4
- data.tar.gz: bc8267895efdd3544c3bd1309504e0bc2f5d3135
3
+ metadata.gz: ca72b1aefa9cc8a14625c446cdba60322189cf28
4
+ data.tar.gz: 37facf6c0d869aa46d2f0cc9eb51ad2a90e70991
5
5
  SHA512:
6
- metadata.gz: befb44d3bb18e708a2c2172036efdb6863688e8cace9f7c94adc4c55b38621f9dfd7b5a5338654b2f35271a4b0265023ace125983c7cf0cb41632d9ea84664af
7
- data.tar.gz: e32e10b222b91ae98390f4c730e20d12ce59b3912b3f3ea4105621278d2517aa7ee2f3b2668aa3d2f376228e4793f3168f1392d8e95d03cccbc07f84081567f0
6
+ metadata.gz: 17fa618bc634d0aca1784e8c057dd97c4360b6b61e932162c6ea22a8aedb3e57494711883dd3c2c5c67632a2c997fd555473ac6cbbec14cd6acbc0c9e0c55f4d
7
+ data.tar.gz: 9b8af786812aa2113c2baf321866166f4b8da90e363757494e69ca3c3d74ca098518c92c153c60e640509d3304d22fd7d9c3c330e085c61e7c4e90314b62aa8d
@@ -73,7 +73,7 @@ module L2meter
73
73
  @outputs.push StringIO.new
74
74
  yield
75
75
  ensure
76
- emit @outputs.pop.tap(&:rewind).read.split(/\s+/).uniq.join(" ")
76
+ flush_buffer @outputs.pop
77
77
  end
78
78
 
79
79
  private
@@ -129,11 +129,11 @@ module L2meter
129
129
 
130
130
  tokens.sort! if configuration.sort?
131
131
 
132
- emit tokens.join(" ")
132
+ emit tokens
133
133
  end
134
134
 
135
- def emit(text)
136
- output_queue.last.puts text
135
+ def emit(tokens)
136
+ output_queue.last.puts [*tokens].join(" ")
137
137
  end
138
138
 
139
139
 
@@ -176,5 +176,12 @@ module L2meter
176
176
  def output_queue
177
177
  [ configuration.output, *@outputs ].compact
178
178
  end
179
+
180
+ def flush_buffer(buffer)
181
+ output = buffer.tap(&:rewind).read
182
+ tokens = output.split(/\s+/).reverse
183
+ tokens.uniq! { |token| token.split(?=, 2).first }
184
+ emit tokens.reverse
185
+ end
179
186
  end
180
187
  end
@@ -1,3 +1,3 @@
1
1
  module L2meter
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l2meter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: