logstash-input-imap 1.0.0 → 2.0.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: 4a7931db597225223e38a5ee6ddecfa5f5f4d08c
4
- data.tar.gz: 1cbe332dacecc4d24c7216bccee26707b4ba53e2
3
+ metadata.gz: 5abf1944093341c01230c7eddc8b3bd6b8ee6e52
4
+ data.tar.gz: a725b25691b46e9d5a62f5bfb92045990629adf1
5
5
  SHA512:
6
- metadata.gz: 0e0cb1da2c92770a8116a47cd2a38cec1c441d6227d1fe79dcb42a4ec3c873d0fce0eb05ce38005c513e500d72c8bd0b8744c30fd80fc12fccfa68565195b190
7
- data.tar.gz: 13e19a84e3d63e49398001c63acac58cabfdb53c71cd4061af79a91e052e4a0955d14c128977b966ac04381323c250cfe5210cf164411698c6893e8f868ddf67
6
+ metadata.gz: 6a5630221c9edab1b94a866d04c3431602d562c5779f0fdd1f1ed047d8e254f8fa832f474b63e6745835fb19ad3774d90a2b55cae839b7d817bdda6d10781ea2
7
+ data.tar.gz: f7876a76b8d05c0fd1e8590cf43b2213f4d7c6099f4767c79ff895602040aee5344c7db4110488d89f6f987eb0094cf6271470cd79fcdeabf835cc0e8964cb31
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Logstash Plugin
2
2
 
3
- This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
3
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
4
 
5
5
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
6
6
 
7
7
  ## Documentation
8
8
 
9
- Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elasticsearch.org/guide/en/logstash/current/).
9
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
10
10
 
11
11
  - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
- - For more asciidoc formatting tips, see the excellent reference here https://github.com/elasticsearch/docs#asciidoc-guide
12
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
13
13
 
14
14
  ## Need Help?
15
15
 
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
83
83
 
84
84
  It is more important to the community that you are able to contribute.
85
85
 
86
- For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
86
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
@@ -63,6 +63,7 @@ class LogStash::Inputs::IMAP < LogStash::Inputs::Base
63
63
  end
64
64
 
65
65
  def run(queue)
66
+ @run_thread = Thread.current
66
67
  Stud.interval(@check_interval) do
67
68
  check_mail(queue)
68
69
  end
@@ -143,10 +144,10 @@ class LogStash::Inputs::IMAP < LogStash::Inputs::Base
143
144
  end # def handle
144
145
 
145
146
  public
146
- def teardown
147
+ def stop
148
+ Stud.stop!(@run_thread)
147
149
  $stdin.close
148
- finished
149
- end # def teardown
150
+ end
150
151
 
151
152
  private
152
153
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-imap'
4
- s.version = '1.0.0'
4
+ s.version = '2.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Read mail from IMAP servers"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = `git ls-files`.split($\)+::Dir.glob('vendor/*')
14
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
@@ -20,11 +20,10 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
24
-
23
+ s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
25
24
  s.add_runtime_dependency 'logstash-codec-plain'
26
25
  s.add_runtime_dependency 'mail'
27
- s.add_runtime_dependency 'stud'
26
+ s.add_runtime_dependency 'stud', '~> 0.0.22'
28
27
 
29
28
  s.add_development_dependency 'logstash-devutils'
30
29
  end
@@ -1,8 +1,37 @@
1
1
  # encoding: utf-8
2
- #
3
2
  require "logstash/devutils/rspec/spec_helper"
4
3
  require "logstash/inputs/imap"
5
4
  require "mail"
5
+ require "net/imap"
6
+
7
+
8
+ describe LogStash::Inputs::IMAP do
9
+
10
+ context "when interrupting the plugin" do
11
+ it_behaves_like "an interruptible input plugin" do
12
+ let(:config) do
13
+ { "type" => "imap",
14
+ "host" => "localhost",
15
+ "user" => "logstash",
16
+ "password" => "secret" }
17
+ end
18
+ let(:imap) { double("imap") }
19
+ let(:ids) { double("ids") }
20
+ before(:each) do
21
+ allow(imap).to receive(:login)
22
+ allow(imap).to receive(:select)
23
+ allow(imap).to receive(:close)
24
+ allow(imap).to receive(:disconnect)
25
+ allow(imap).to receive(:store)
26
+ allow(ids).to receive(:each_slice).and_return([])
27
+
28
+ allow(imap).to receive(:search).with("NOT SEEN").and_return(ids)
29
+ allow(Net::IMAP).to receive(:new).and_return(imap)
30
+ end
31
+ end
32
+ end
33
+
34
+ end
6
35
 
7
36
  describe LogStash::Inputs::IMAP do
8
37
  user = "logstash"
metadata CHANGED
@@ -1,105 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-imap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash-core
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 1.4.0
20
- - - <
21
- - !ruby/object:Gem::Version
22
- version: 2.0.0
23
14
  requirement: !ruby/object:Gem::Requirement
24
15
  requirements:
25
- - - '>='
16
+ - - ~>
26
17
  - !ruby/object:Gem::Version
27
- version: 1.4.0
28
- - - <
29
- - !ruby/object:Gem::Version
30
- version: 2.0.0
18
+ version: 2.0.0.snapshot
19
+ name: logstash-core
31
20
  prerelease: false
32
21
  type: :runtime
33
- - !ruby/object:Gem::Dependency
34
- name: logstash-codec-plain
35
22
  version_requirements: !ruby/object:Gem::Requirement
36
23
  requirements:
37
- - - '>='
24
+ - - ~>
38
25
  - !ruby/object:Gem::Version
39
- version: '0'
26
+ version: 2.0.0.snapshot
27
+ - !ruby/object:Gem::Dependency
40
28
  requirement: !ruby/object:Gem::Requirement
41
29
  requirements:
42
30
  - - '>='
43
31
  - !ruby/object:Gem::Version
44
32
  version: '0'
33
+ name: logstash-codec-plain
45
34
  prerelease: false
46
35
  type: :runtime
47
- - !ruby/object:Gem::Dependency
48
- name: mail
49
36
  version_requirements: !ruby/object:Gem::Requirement
50
37
  requirements:
51
38
  - - '>='
52
39
  - !ruby/object:Gem::Version
53
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
54
42
  requirement: !ruby/object:Gem::Requirement
55
43
  requirements:
56
44
  - - '>='
57
45
  - !ruby/object:Gem::Version
58
46
  version: '0'
47
+ name: mail
59
48
  prerelease: false
60
49
  type: :runtime
61
- - !ruby/object:Gem::Dependency
62
- name: stud
63
50
  version_requirements: !ruby/object:Gem::Requirement
64
51
  requirements:
65
52
  - - '>='
66
53
  - !ruby/object:Gem::Version
67
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
68
56
  requirement: !ruby/object:Gem::Requirement
69
57
  requirements:
70
- - - '>='
58
+ - - ~>
71
59
  - !ruby/object:Gem::Version
72
- version: '0'
60
+ version: 0.0.22
61
+ name: stud
73
62
  prerelease: false
74
63
  type: :runtime
75
- - !ruby/object:Gem::Dependency
76
- name: logstash-devutils
77
64
  version_requirements: !ruby/object:Gem::Requirement
78
65
  requirements:
79
- - - '>='
66
+ - - ~>
80
67
  - !ruby/object:Gem::Version
81
- version: '0'
68
+ version: 0.0.22
69
+ - !ruby/object:Gem::Dependency
82
70
  requirement: !ruby/object:Gem::Requirement
83
71
  requirements:
84
72
  - - '>='
85
73
  - !ruby/object:Gem::Version
86
74
  version: '0'
75
+ name: logstash-devutils
87
76
  prerelease: false
88
77
  type: :development
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
89
83
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
90
84
  email: info@elastic.co
91
85
  executables: []
92
86
  extensions: []
93
87
  extra_rdoc_files: []
94
88
  files:
95
- - .gitignore
96
89
  - CHANGELOG.md
97
90
  - CONTRIBUTORS
98
91
  - Gemfile
99
92
  - LICENSE
100
93
  - NOTICE.TXT
101
94
  - README.md
102
- - Rakefile
103
95
  - lib/logstash/inputs/imap.rb
104
96
  - logstash-input-imap.gemspec
105
97
  - spec/inputs/imap_spec.rb
@@ -125,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
117
  version: '0'
126
118
  requirements: []
127
119
  rubyforge_project:
128
- rubygems_version: 2.2.2
120
+ rubygems_version: 2.4.8
129
121
  signing_key:
130
122
  specification_version: 4
131
123
  summary: Read mail from IMAP servers
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- .bundle
4
- vendor
data/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- @files=[]
2
-
3
- task :default do
4
- system("rake -T")
5
- end
6
-
7
- require "logstash/devutils/rake"