wvanbergen-request-log-analyzer 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -8,6 +8,34 @@ task :default => :test
8
8
 
9
9
  namespace :gem do
10
10
 
11
+ desc "Sets the version and date of the gem"
12
+ task :spec_version do
13
+
14
+ require 'date'
15
+
16
+ new_version = ENV['VERSION']
17
+ raise "VERSION is required" unless /\d+(\.\d+)*/ =~ new_version
18
+
19
+ spec_file = Dir['*.gemspec'].first
20
+
21
+ spec = File.read(spec_file)
22
+ spec.gsub!(/^(\s*s\.version\s*=\s*)('|")(.+)('|")(\s*)$/) { "#{$1}'#{new_version}'#{$5}" }
23
+ spec.gsub!(/^(\s*s\.date\s*=\s*)('|")(.+)('|")(\s*)$/) { "#{$1}'#{Date.today.strftime('%Y-%m-%d')}'#{$5}" }
24
+ File.open(spec_file, 'w') { |f| f << spec }
25
+ end
26
+
27
+ task :version => [:spec_version] do
28
+
29
+ new_version = ENV['VERSION']
30
+ raise "VERSION is required" unless /\d+(\.\d+)*/ =~ new_version
31
+
32
+ sh "git add request-log-analyzer.gemspec"
33
+ sh "git commit -m \"Set gem version to #{new_version}\""
34
+ sh "git push origin"
35
+ sh "git tag -a \"request-log-analyzer-#{new_version}\" -m \"Tagged version #{new_version}\""
36
+ sh "git push --tags"
37
+ end
38
+
11
39
  desc "Builds a ruby gem for request-log-analyzer"
12
40
  task :build => [:manifest] do
13
41
  system %[gem build request-log-analyzer.gemspec]
@@ -38,7 +38,7 @@ def print_table(summarizer, field, amount = 20)
38
38
  # As we show count by default, show totaltime if we sort by count
39
39
  field = :total_time if field == :count
40
40
 
41
- puts "#{a[0].ljust(50)}: %10.03fs [#{green("%d requests")}]" % [a[1][field], a[1][:count]]
41
+ puts "%-50s: %10.03fs [#{green("%d requests")}]" % [a[0], a[1][field], a[1][:count]]
42
42
  end
43
43
  end
44
44
 
data/output/blockers.rb CHANGED
@@ -6,6 +6,6 @@ puts "Mongrel process blockers (> #{$summarizer.blocker_duration} seconds)"
6
6
  puts green("========================================================================")
7
7
 
8
8
  $summarizer.sort_blockers_by(:count).reverse[0, amount.to_i].each do |a|
9
- puts "#{a[0].ljust(50)}: %10.03fs [#{green("%d requests")}]" % [a[1][:total_time], a[1][:count]]
9
+ puts "%-50s: %10.03fs [#{green("%d requests")}]" % [a[0], a[1][:total_time], a[1][:count]]
10
10
  end
11
11
 
data/output/errors.rb CHANGED
@@ -4,6 +4,6 @@ puts
4
4
  puts "Errors"
5
5
  puts green("========================================================================")
6
6
  $summarizer.sort_errors_by(:count).reverse[0, amount.to_i].each do |a|
7
- puts "#{(a[0] + 'Error').ljust(50)}: [#{green("%d requests")}]" % a[1][:count]
7
+ puts "%s: [#{green("%d requests")}]" % [a[0] + 'Error', a[1][:count]]
8
8
  puts blue(' -> ' + (a[1][:exception_strings].invert[ a[1][:exception_strings].values.max ])[0..79])
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wvanbergen-request-log-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-08-29 00:00:00 -07:00
13
+ date: 2008-09-03 00:00:00 -07:00
14
14
  default_executable: request-log-analyzer
15
15
  dependencies: []
16
16