logstash-output-qingstor 0.2.5 → 0.2.6

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: 7564fd0b6a8c4a7241dc27cb5f1328557394033e0cf17a6e6f76d3f0934d4b9a
4
- data.tar.gz: 8445db4f27ec881bb9e54a0b3266f1bc77e0ec909c2a795ec2f284b295495f2f
3
+ metadata.gz: 6fe51f69908599f882c6ac6b6a9afc08e0770b8bffda5679ab83ac5e5acf94dc
4
+ data.tar.gz: 0d499a3d20bf83f0a39d22663077cf13a92d0bfb8281d8aca848914665c07a21
5
5
  SHA512:
6
- metadata.gz: 14a409865bb71577410a82832696d3f56efb251a4c96d8d30ec265597728d97ea9be736f04d49107415c9e4a3a1f18359a7db14873ab26f3346aabfe7c605def
7
- data.tar.gz: daca98515e8dee4c70d6cd61c8a589a2f39d748ef75b08d52675a38784229f872e589fa89b1c5b788f1ffa005aa2de073515c35e00fd8aef24cb26243f62827f
6
+ metadata.gz: 9c1959265a7e30b3777e09135c69013f1e70332e8772893d1d142f7fc7f0a4fb03a1f5f6409b0585766129c39617bb544f79997869dea7f9a77ec83c3e082f4d
7
+ data.tar.gz: '058d9cb15d999c055fe5cb8b1333dc59064861923b4f15a865fc43ceaf7f4fb6f798ceb8f3956fb6f07e46801da8eade2b2fd1c67688d7ca0ab4156af33244fb'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.6
2
+ - Fix: swap uuid and date of the file name for sorting
3
+
1
4
  ## 0.2.5
2
5
  - Fix: remove uuid directories which cannotbe removed properly
3
6
 
@@ -57,7 +57,7 @@ module LogStash
57
57
  end
58
58
 
59
59
  def generate_name
60
- filename = "ls.qingstor.#{SecureRandom.uuid}.#{current_time}"
60
+ filename = "ls.qingstor.#{current_time}.#{SecureRandom.uuid}"
61
61
 
62
62
  if !tags.empty?
63
63
  "#{filename}.tag_#{tags.join('.')}.part#{counter}.#{extension}"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-qingstor'
3
- s.version = '0.2.5'
3
+ s.version = '0.2.6'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'logstash output plugin for qingstor'
6
6
  s.description = 'Collect the outputs of logstash and store into QingStor'
@@ -47,12 +47,6 @@ describe LogStash::Outputs::Qingstor::TemporaryFileFactory do
47
47
  expect(file.path).to match(/#{file.key}/)
48
48
  end
49
49
 
50
- it 'create a unique directory in the temporary directory for each file' do
51
- uuid = 'hola'
52
- expect(SecureRandom).to receive(:uuid).and_return(uuid).twice
53
- expect(subject.current.path).to include(uuid)
54
- end
55
-
56
50
  context 'with tags supplied' do
57
51
  let(:tags) { %w[secret service] }
58
52
 
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  require 'tmpdir'
7
7
 
8
8
  describe LogStash::Outputs::Qingstor::TemporaryFile do
9
- subject { described_class.new(key, io, tmp_path) }
9
+ subject { described_class.new(key, io, Dir.tmpdir) }
10
10
 
11
11
  let(:key) { 'foo.log' }
12
12
  let(:content) { 'May the code be with you!' }
@@ -15,7 +15,7 @@ describe LogStash::Outputs::Qingstor::TemporaryFile do
15
15
  let(:io) { ::File.open(tmp_path, file_mode) }
16
16
 
17
17
  after(:all) do
18
- FileUtils.rm_r('/tmp/foo.log') if File.exist?('/tmp/foo.log')
18
+ FileUtils.rm('/tmp/foo.log') if File.exist?('/tmp/foo.log')
19
19
  end
20
20
 
21
21
  it 'return the key of the file' do
@@ -35,7 +35,7 @@ describe LogStash::Outputs::Qingstor::TemporaryFile do
35
35
  end
36
36
 
37
37
  it 'return the tmp_path of the file' do
38
- expect(subject.tmp_path).to eq(tmp_path)
38
+ expect(File.join(subject.tmp_path, subject.key)).to eq(tmp_path)
39
39
  end
40
40
 
41
41
  it 'return the creation time' do
@@ -43,9 +43,9 @@ describe LogStash::Outputs::Qingstor::TemporaryFile do
43
43
  end
44
44
 
45
45
  it 'can delete file correctly' do
46
- expect(File.exist?(subject.tmp_path)).to be_truthy
46
+ expect(File.exist?(tmp_path)).to be_truthy
47
47
  subject.delete!
48
- expect(File.exist?(subject.tmp_path)).to be_falsey
48
+ expect(File.exist?(tmp_path)).to be_falsey
49
49
  end
50
50
 
51
51
  it 'return if the file is empty' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-qingstor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-30 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement