apache_log_parser 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ From there, you would use it as follows:
17
17
  parsed[:hour] #=> 14
18
18
  parsed[:zone] #=> "-0800"
19
19
  parsed[:method] #=> "GET"
20
+ parsed[:http_ver] #=> "1.1"
20
21
  parsed[:resource] #=> "/some/page.php"
21
22
  parsed[:status] #=> 200
22
23
  parsed[:size] #=> "7047"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -1,49 +1,42 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{apache_log_parser}
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["watsonian"]
12
- s.date = %q{2010-01-27}
12
+ s.date = %q{2011-05-08}
13
13
  s.description = %q{Library to easily parse standard Apache log files.}
14
14
  s.email = %q{watsonian@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "apache_log_parser.gemspec",
27
- "lib/apache_log_parser.rb",
28
- "spec/apache_log_parser_spec.rb",
29
- "spec/spec.opts",
30
- "spec/spec_helper.rb"
21
+ "LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "apache_log_parser.gemspec",
26
+ "lib/apache_log_parser.rb",
27
+ "spec/apache_log_parser_spec.rb",
28
+ "spec/spec.opts",
29
+ "spec/spec_helper.rb"
31
30
  ]
32
31
  s.homepage = %q{http://github.com/watsonian/apache_log_parser}
33
- s.rdoc_options = ["--charset=UTF-8"]
34
32
  s.require_paths = ["lib"]
35
- s.rubygems_version = %q{1.3.5}
33
+ s.rubygems_version = %q{1.6.2}
36
34
  s.summary = %q{Library to easily parse standard Apache log files.}
37
- s.test_files = [
38
- "spec/apache_log_parser_spec.rb",
39
- "spec/spec_helper.rb"
40
- ]
41
35
 
42
36
  if s.respond_to? :specification_version then
43
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
37
  s.specification_version = 3
45
38
 
46
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
39
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
40
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
48
41
  else
49
42
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
@@ -6,7 +6,7 @@ class ApacheLogParser
6
6
 
7
7
  private
8
8
  def self.parse_line(line)
9
- m = line.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?(([0-9]{1,2})\/(.*?)\/([0-9]{4})):(([0-9]{2}):[0-9]{2}:[0-9]{2})\s*(.*?)\]\s*"([\w]*)\s(.*?)\s.*?"\s([0-9]{3})\s(.*?)\s*"(.*?)"\s*"(.*?)"/)
9
+ m = line.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?(([0-9]{1,2})\/(.*?)\/([0-9]{4})):(([0-9]{2}):[0-9]{2}:[0-9]{2})\s*(.*?)\]\s*"([\w]*)\s(.*?)\sHTTP\/(.*?)"\s([0-9]{3})\s(.*?)\s*"(.*?)"\s*"(.*?)"/)
10
10
  if m
11
11
  {:ip => m[1],
12
12
  :date => m[2],
@@ -18,10 +18,11 @@ class ApacheLogParser
18
18
  :zone => m[8],
19
19
  :method => m[9],
20
20
  :resource => m[10],
21
- :status => m[11].to_i,
22
- :size => m[12],
23
- :referer => m[13],
24
- :user_agent => m[14]}
21
+ :http_ver => m[11],
22
+ :status => m[12].to_i,
23
+ :size => m[13],
24
+ :referer => m[14],
25
+ :user_agent => m[15]}
25
26
  else
26
27
  {}
27
28
  end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apache_log_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ hash: 19
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 0
10
+ version: 1.1.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - watsonian
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-27 00:00:00 -08:00
18
+ date: 2011-05-08 00:00:00 -05:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
23
34
  version: 1.2.9
24
- version:
35
+ type: :development
36
+ version_requirements: *id001
25
37
  description: Library to easily parse standard Apache log files.
26
38
  email: watsonian@gmail.com
27
39
  executables: []
@@ -33,7 +45,6 @@ extra_rdoc_files:
33
45
  - README.rdoc
34
46
  files:
35
47
  - .document
36
- - .gitignore
37
48
  - LICENSE
38
49
  - README.rdoc
39
50
  - Rakefile
@@ -48,29 +59,34 @@ homepage: http://github.com/watsonian/apache_log_parser
48
59
  licenses: []
49
60
 
50
61
  post_install_message:
51
- rdoc_options:
52
- - --charset=UTF-8
62
+ rdoc_options: []
63
+
53
64
  require_paths:
54
65
  - lib
55
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
56
68
  requirements:
57
69
  - - ">="
58
70
  - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
59
74
  version: "0"
60
- version:
61
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
62
77
  requirements:
63
78
  - - ">="
64
79
  - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
65
83
  version: "0"
66
- version:
67
84
  requirements: []
68
85
 
69
86
  rubyforge_project:
70
- rubygems_version: 1.3.5
87
+ rubygems_version: 1.6.2
71
88
  signing_key:
72
89
  specification_version: 3
73
90
  summary: Library to easily parse standard Apache log files.
74
- test_files:
75
- - spec/apache_log_parser_spec.rb
76
- - spec/spec_helper.rb
91
+ test_files: []
92
+
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC