indy 0.3.4 → 0.4.0.pre

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.
data/.autotest DELETED
@@ -1,18 +0,0 @@
1
- begin
2
- require 'autotest/growl'
3
- rescue Exception
4
- puts %{
5
- Autotest/Autospec can use Growl (growl.info|growlforwindows.com) to assist with reporting errors.
6
- This would require Growl for the appropriate platform (MAC|Windows) and the Ruby gem 'karl-autotest-growl'
7
- }
8
- sleep 4
9
- end
10
-
11
- Autotest.add_hook(:initialize) {|at|
12
- at.add_exception %r{^\.git} # ignore Version Control System
13
- at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again...
14
- at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
15
- Dir['spec/**/*.rb']
16
- }
17
- nil
18
- }
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.2
@@ -1,2 +0,0 @@
1
- Autotest.add_discovery { "rspec2" }
2
-
@@ -1,3 +0,0 @@
1
- class Indy
2
-
3
- end
@@ -1,9 +0,0 @@
1
-
2
- bisect_log (by time)
3
-
4
- first_entry._time
5
- last_entry._time
6
- log_size
7
- median_entry
8
- tail( entries )
9
-
@@ -1,8 +0,0 @@
1
- #
2
- # The current implementation extends an Array. However, as this
3
- # has not been tested with a large data set it may need some new
4
- # Enumerable object that is multi-threaded and performance friendly
5
- #
6
- class ResultSet < Array
7
-
8
- end
@@ -1,13 +0,0 @@
1
-
2
- require 'scanf'
3
-
4
- f = File.open('spec/multiline.log')
5
-
6
- first_capture_regexp = '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
7
-
8
- full_regexp = "^(#{first_capture_regexp})\\s+([A-Z]+)\\s+(.+?)(?=^#{first_capture_regexp}|\\z)"
9
-
10
- f.read.scan(/#{full_regexp}/m) do |entry|
11
- puts "Entry::::\n#{entry}"
12
- end
13
-
@@ -1,42 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/helper"
2
-
3
- describe 'Indy#last' do
4
-
5
- context "method" do
6
-
7
- before(:each) do
8
- log_string = ["2000-09-07 14:07:41 INFO MyApp - Entering APPLICATION.",
9
- "2000-09-07 14:09:00 INFO MyApp - Entering APPLICATION.",
10
- "2000-09-09 14:10:56 INFO MyOtherApp - Exiting APPLICATION.",
11
- "2000-09-10 14:08:00 INFO MyOtherApp - Exiting APPLICATION.",
12
- "2000-09-10 14:08:41 INFO MyOtherApp - Exiting APPLICATION.",
13
- "2000-09-10 14:09:00 INFO MyOtherApp - Exiting APPLICATION.",
14
- "2000-09-10 14:09:30 INFO MyOtherApp - Exiting APPLICATION.",
15
- "2000-09-10 14:10:55 INFO MyApp - Exiting APPLICATION."].join("\n")
16
- @indy = Indy.search(log_string)
17
- end
18
-
19
- it "should return self" do
20
- @indy.last(:span => 1).should be_kind_of Indy
21
- end
22
-
23
- it "should raise an error if passed an invalid parameter" do
24
- lambda{ @indy.last('a') }.should raise_error( ArgumentError )
25
- lambda{ @indy.last() }.should raise_error( ArgumentError )
26
- lambda{ @indy.last(nil) }.should raise_error( ArgumentError )
27
- lambda{ @indy.last({}) }.should raise_error( ArgumentError )
28
- end
29
-
30
- it "should return correct number of rows when passed a span of minutes" do
31
- @indy.last( :span => 2).for(:all).length.should == 3
32
- @indy.last( :span => 3).for(:all).length.should == 5
33
- @indy.last( :span => 1_440).for(:all).length.should == 6
34
- end
35
-
36
- it "should return correct rows when passed a span of minutes" do
37
- @indy.last( :span => 3).for(:all).first.time.should == '2000-09-10 14:08:00'
38
- end
39
-
40
- end
41
-
42
- end
@@ -1,36 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/helper"
2
-
3
- describe 'ResultSet' do
4
-
5
- it "should be Enumerable" do
6
- ResultSet.new.should be_kind_of(Enumerable)
7
- end
8
-
9
- context 'search results' do
10
-
11
- before(:all) do
12
- logcontent = "2000-09-07 14:07:42 INFO MyApp - Entering APPLICATION.\n2000-09-07 14:07:43 DEBUG MyOtherApp - Entering APPLICATION.\n2000-09-07 14:07:45 WARN MyThirdApp - Entering APPLICATION."
13
- @indy = Indy.search(logcontent)
14
- end
15
-
16
- context 'per line results' do
17
-
18
- it "should contain an array of Enumerables" do
19
- @indy.for(:all).first.should be_kind_of(Enumerable)
20
- end
21
-
22
- it "should provide attribute readers for each field" do
23
- line1, line2, line3 = @indy.for(:all)
24
- line1.time.should == '2000-09-07 14:07:42'
25
- line1.severity.should == 'INFO'
26
- line1.application.should == 'MyApp'
27
- line1.message.should == 'Entering APPLICATION.'
28
- line2.application.should == 'MyOtherApp'
29
- line3.application.should == 'MyThirdApp'
30
- end
31
-
32
- end
33
- end
34
-
35
-
36
- end