logstash-lite 0.2.20101129155412 → 0.2.20101129205551

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/logstash-test +86 -0
  2. metadata +5 -3
data/bin/logstash-test ADDED
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "optparse"
5
+ $:.unshift "#{File.dirname(__FILE__)}/../lib"
6
+ $:.unshift "#{File.dirname(__FILE__)}/../test"
7
+
8
+ #require "logstash/test_syntax"
9
+ #require "logstash/filters/test_date"
10
+ #require "logstash/filters/test_multiline"
11
+
12
+ def check_lib(lib, provider, optional=true, message=nil)
13
+ begin
14
+ require lib
15
+ puts "+ Found #{optional ? "optional" : "required"} library '#{lib}'"
16
+ return { :optional => optional, :found => true }
17
+ rescue LoadError => e
18
+ puts "- Missing #{optional ? "optional" : "required"} library '#{lib}' - try 'gem install #{provider}'#{optional ? " if you want this library" : ""}. #{message}"
19
+ return { :optional => optional, :found => false }
20
+ end
21
+ end
22
+
23
+ def report_ruby_version
24
+ puts "Running #{RUBY_VERSION}p#{RUBY_PATCHLEVEL} on #{RUBY_PLATFORM}"
25
+ end
26
+
27
+ def check_libraries
28
+ results = []
29
+ results << check_lib("em-http-request", "em-http-request", true,
30
+ "needed for ElasticSearch input, output, and logstash-web support.")
31
+ results << check_lib("em-mongo", "em-mongo", true,
32
+ "needed for the mongodb output.")
33
+ results << check_lib("grok", "jls-grok", true,
34
+ "needed for the grok filter.")
35
+ results << check_lib("em-websocket", "em-websocket", true,
36
+ "needed for websocket output")
37
+ results << check_lib("rack", "rack", true,
38
+ "needed for logstash-web")
39
+ results << check_lib("amqp", "amqp", true,
40
+ "needed for AMQP input and output")
41
+ results << check_lib("sinatra/async", "async_sinatra", true,
42
+ "needed for logstash-web")
43
+ results << check_lib("uuidtools", "uuidtools", true,
44
+ "needed for AMQP input and output")
45
+ results << check_lib("ap", "awesome_print", true,
46
+ "improve logstash debug logging output")
47
+ results << check_lib("eventmachine", "eventmachine", false,
48
+ "required for logstash to function")
49
+
50
+ missing_required = results.count { |r| !r[:optional] and !r[:found] }
51
+ if missing_required == 0
52
+ puts "All required libraries found :)"
53
+ else
54
+ suffix = (missing_required > 1) ? "ies" : "y"
55
+ puts "FATAL: Missing #{missing_required} required librar#{suffix}"
56
+ return false
57
+ end
58
+
59
+ return true
60
+ end
61
+
62
+ def run_tests
63
+ require "logstash/test_syntax"
64
+ require "logstash/filters/test_date"
65
+ require "logstash/filters/test_multiline"
66
+ return Test::Unit::AutoRunner.run
67
+ end
68
+
69
+ def main(args)
70
+ report_ruby_version
71
+ #if !check_libraries
72
+ #puts "Library check failed."
73
+ #return 1
74
+ #end
75
+
76
+ if !run_tests
77
+ puts "Test suite failed."
78
+ return 1
79
+ end
80
+
81
+ return 0
82
+ end
83
+
84
+ exit(main(ARGV))
85
+
86
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-lite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40202258310847
4
+ hash: 40202258411081
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 20101129155412
10
- version: 0.2.20101129155412
9
+ - 20101129205551
10
+ version: 0.2.20101129205551
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -51,6 +51,7 @@ email: jls@semicomplete.com
51
51
  executables:
52
52
  - logstash
53
53
  - logstash-web
54
+ - logstash-test
54
55
  extensions: []
55
56
 
56
57
  extra_rdoc_files: []
@@ -198,6 +199,7 @@ files:
198
199
  - patterns/nagios
199
200
  - bin/logstash
200
201
  - bin/logstash-web
202
+ - bin/logstash-test
201
203
  has_rdoc: true
202
204
  homepage: http://code.google.com/p/logstash/
203
205
  licenses: []