bin/request-log-analyzer in wvanbergen-request-log-analyzer-0.3.3 vs bin/request-log-analyzer in wvanbergen-request-log-analyzer-0.3.4
- old
+ new
@@ -5,44 +5,44 @@
puts "Request log analyzer, by Willem van Bergen and Bart ten Brinke\n\n"
# Parse the arguments given via commandline
begin
arguments = CommandLine::Arguments.parse do |command_line|
-
- #command_line.flag(:install, :alias => :i) # command_line.command(:install)
-
- command_line.flag(:format, :default => 'rails')
- command_line.flag(:aggregator, :alias => :a, :multiple => true)
- command_line.flag(:database, :alias => :d)
-
- command_line.switch(:combined_requests, :c)
- command_line.switch(:colorize, :z)
- #command_line.switch(:estimate_database_time, :e)
- #command_line.switch(:fast, :f) #
+ command_line.switch(:guess_database_time, :g)
+ command_line.switch(:fast, :f)
+ command_line.switch(:colorize, :z)
+ command_line.switch(:merb, :m)
+ command_line.switch(:install, :i)
+ command_line.flag(:output, :alias => :o)
+ command_line.flag(:amount, :alias => :c)
+ command_line.required_files = 1
end
rescue CommandLine::Error => e
puts "ARGUMENT ERROR: " + e.message
puts
load File.dirname(__FILE__) + "/../output/usage.rb"
exit(0)
end
-# if arguments[:install]
-# if arguments[:install] == 'rails'
-# require 'ftools'
-# if File.directory?('./lib/tasks/')
-# File.copy(File.dirname(__FILE__) + '/../tasks/request_log_analyzer.rake', './lib/tasks/request_log_analyze.rake')
-# puts "Installed rake tasks."
-# puts "To use, run: rake log:analyze"
-# else
-# puts "Cannot find /lib/tasks folder. Are you in your Rails directory?"
-# puts "Installation aborted."
-# end
-# else
-# raise "Cannot perform this install type!"
-# end
-# exit(0)
-# end
+if arguments[:install]
+ if arguments.files.first == 'rails'
+ require 'ftools'
+ if File.directory?('./lib/tasks/')
+ File.copy(File.dirname(__FILE__) + '/../tasks/request_log_analyzer.rake', './lib/tasks/request_log_analyze.rake')
+ puts "Installed rake tasks."
+ puts "To use, run: rake log:analyze"
+ else
+ puts "Cannot find /lib/tasks folder. Are you in your Rails directory?"
+ puts "Installation aborted."
+ end
+ end
+ exit(0)
+end
+$colorize = true if arguments[:colorize]
+
# Run the request_log_analyzer!
-request_log_analyzer = RequestLogAnalyzer::Controller.build(arguments).run!
\ No newline at end of file
+request_log_analyzer = RequestLogAnalyzer.new(arguments)
+request_log_analyzer.analyze_this(arguments.files)
+
+