request-log-analyzer 1.12.2 → 1.12.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
-
2
1
  class DatabaseConsole
3
2
 
4
3
  IRB = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
@@ -8,7 +7,7 @@ class DatabaseConsole
8
7
  end
9
8
 
10
9
  def run!
11
- libraries = ['irb/completion', 'rubygems','./lib/cli/database_console_init']
10
+ libraries = ['irb/completion', 'rubygems','cli/database_console_init']
12
11
  libaries_string = libraries.map { |l| "-r #{l}" }.join(' ')
13
12
 
14
13
  ENV['RLA_DBCONSOLE_DATABASE'] = @arguments[:database]
@@ -97,7 +97,7 @@ module RequestLogAnalyzer
97
97
  #
98
98
  # Options
99
99
  # * <tt>:after</tt> Drop all requests after this date (Date, DateTime, Time, or a String in "YYYY-MM-DD hh:mm:ss" format)
100
- # * <tt>:aggregator</tt> Array of aggregators (ATM: STRINGS OR SYMBOLS ONLY! - Defaults to [:summarizer]).
100
+ # * <tt>:aggregator</tt> Array of aggregators (Strings or Symbols for the builtin aggregators or a RequestLogAnalyzer::Aggregator class - Defaults to [:summarizer]).
101
101
  # * <tt>:boring</tt> Do not show color on STDOUT (Defaults to false).
102
102
  # * <tt>:before</tt> Drop all requests before this date (Date, DateTime, Time or a String in "YYYY-MM-DD hh:mm:ss" format)
103
103
  # * <tt>:database</tt> Database file to insert encountered requests to.
@@ -116,6 +116,7 @@ module RequestLogAnalyzer
116
116
  # * <tt>:source_files</tt> Source files to analyze. Provide either File, array of files or STDIN.
117
117
  # * <tt>:yaml</tt> Output to YAML file.
118
118
  # * <tt>:silent</tt> Minimal output automatically implies :no_progress
119
+ # * <tt>:source</tt> The class to instantiate to grab the requestes, must be a RequestLogAnalyzer::Source::Base descendant. (Defaults to RequestLogAnalyzer::Source::LogParser)
119
120
  #
120
121
  # === Example
121
122
  # RequestLogAnalyzer::Controller.build(
@@ -138,6 +139,7 @@ module RequestLogAnalyzer
138
139
  options[:report_sort] ||= 'sum,mean'
139
140
  options[:boring] ||= false
140
141
  options[:silent] ||= false
142
+ options[:source] ||= RequestLogAnalyzer::Source::LogParser
141
143
 
142
144
  options[:no_progress] = true if options[:silent]
143
145
 
@@ -182,9 +184,9 @@ module RequestLogAnalyzer
182
184
 
183
185
  # Kickstart the controller
184
186
  controller =
185
- Controller.new(RequestLogAnalyzer::Source::LogParser.new(file_format,
186
- :source_files => options[:source_files],
187
- :parse_strategy => options[:parse_strategy]),
187
+ Controller.new(options[:source].new(file_format,
188
+ :source_files => options[:source_files],
189
+ :parse_strategy => options[:parse_strategy]),
188
190
  { :output => output_instance,
189
191
  :database => options[:database], # FUGLY!
190
192
  :yaml => options[:yaml],
@@ -220,7 +222,7 @@ module RequestLogAnalyzer
220
222
  end
221
223
 
222
224
  # register aggregators
223
- options[:aggregator].each { |agg| controller.add_aggregator(agg.to_sym) }
225
+ options[:aggregator].each { |agg| controller.add_aggregator(agg) }
224
226
  controller.add_aggregator(:summarizer) if options[:aggregator].empty?
225
227
  controller.add_aggregator(:echo) if options[:debug]
226
228
  controller.add_aggregator(:database_inserter) if options[:database] && !options[:aggregator].include?('database')
@@ -284,7 +286,7 @@ module RequestLogAnalyzer
284
286
  # Adds an aggregator to the controller. The aggregator will be called for every request
285
287
  # that is parsed from the provided sources (see add_source)
286
288
  def add_aggregator(agg)
287
- agg = RequestLogAnalyzer::Aggregator.const_get(RequestLogAnalyzer.to_camelcase(agg)) if agg.kind_of?(Symbol)
289
+ agg = RequestLogAnalyzer::Aggregator.const_get(RequestLogAnalyzer.to_camelcase(agg)) if agg.kind_of?(String) || agg.kind_of?(Symbol)
288
290
  @aggregators << agg.new(@source, @options)
289
291
  end
290
292
 
@@ -309,7 +309,7 @@ module RequestLogAnalyzer::Source
309
309
  end
310
310
  else
311
311
  @skipped_lines += 1
312
- warn(:no_current_request, "Parsebale line (#{request_data[:line_definition].name.inspect}) found outside of a request!")
312
+ warn(:no_current_request, "Parseable line (#{request_data[:line_definition].name.inspect}) found outside of a request!")
313
313
  end
314
314
  end
315
315
  end
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
2
2
  s.name = "request-log-analyzer"
3
3
 
4
4
  # Do not set the version and date field manually, this is done by the release script
5
- s.version = "1.12.2"
6
- s.date = "2012-02-29"
5
+ s.version = "1.12.3"
6
+ s.date = "2012-07-09"
7
7
 
8
8
  s.rubyforge_project = 'r-l-a'
9
9
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.requirements << "To use the database inserter, ActiveRecord and an appropriate database adapter are required."
29
29
 
30
30
  s.add_development_dependency('rake')
31
- s.add_development_dependency('rspec', '~> 2.0')
31
+ s.add_development_dependency('rspec', '= 2.8.0')
32
32
 
33
33
  s.add_development_dependency('activerecord')
34
34
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: request-log-analyzer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.12.2
5
+ version: 1.12.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Willem van Bergen
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2012-02-29 00:00:00 +01:00
14
+ date: 2012-07-09 00:00:00 +02:00
15
15
  default_executable: request-log-analyzer
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -31,9 +31,9 @@ dependencies:
31
31
  requirement: &id002 !ruby/object:Gem::Requirement
32
32
  none: false
33
33
  requirements:
34
- - - ~>
34
+ - - "="
35
35
  - !ruby/object:Gem::Version
36
- version: "2.0"
36
+ version: 2.8.0
37
37
  type: :development
38
38
  version_requirements: *id002
39
39
  - !ruby/object:Gem::Dependency