auger 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.5
1
+ 1.3.6
data/bin/aug CHANGED
@@ -39,6 +39,10 @@ optparse = OptionParser.new do |opts|
39
39
  options[:server] = s
40
40
  end
41
41
 
42
+ opts.on('-t', '--time', 'Show request times.') do |t|
43
+ options[:time] = true
44
+ end
45
+
42
46
  opts.on('-v', '--version', 'Display version and exit.') do
43
47
  puts Auger::VERSION.color(:green)
44
48
  exit
@@ -102,9 +106,11 @@ Auger::Config.load(cfg).projects.each do |project|
102
106
  threads[server.name] << Thread.new do
103
107
  conn = connection.do_open(server)
104
108
  connection.requests.map do |request|
105
- response = request.do_run(conn)
109
+ response, time = request.do_run(conn)
106
110
  request.tests.map do |test|
107
- test.run(response)
111
+ result = test.run(response)
112
+ result.time = time
113
+ result
108
114
  end
109
115
  end
110
116
  end
@@ -121,7 +127,9 @@ Auger::Config.load(cfg).projects.each do |project|
121
127
  threads[server].each do |thread|
122
128
  results = thread.value # this waits on thread
123
129
  results.flatten.each do |result|
124
- puts " %+#{max_test_length}s %-30s" % [result.test.name, result.format]
130
+ output = " %+#{max_test_length}s %-30s" % [result.test.name, result.format]
131
+ output << "[#{result.time}]".color(:blue) if options[:time]
132
+ puts output
125
133
  end
126
134
  end
127
135
  end
@@ -22,7 +22,7 @@ module Auger
22
22
  end
23
23
 
24
24
  class SocketRequest < Auger::Request
25
- def run(socket)
25
+ def run(socket, arg)
26
26
  socket ? true : false
27
27
  end
28
28
  end
data/lib/auger/request.rb CHANGED
@@ -44,9 +44,11 @@ module Auger
44
44
  arg = @arg
45
45
  arg = self.before_request_proc.call(conn) if self.before_request_proc
46
46
 
47
+ start = Time.now
47
48
  response = self.run(conn, arg)
49
+ time = Time.now - start
48
50
  response = self.before_tests_proc.call(response) if self.before_tests_proc
49
- response
51
+ return response, time
50
52
  rescue => e
51
53
  e
52
54
  end
data/lib/auger/result.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Auger
2
2
 
3
3
  class Result
4
- attr_accessor :test, :outcome, :status
4
+ attr_accessor :test, :outcome, :status, :time
5
5
 
6
6
  def initialize(outcome = nil, status = outcome)
7
7
  @outcome = outcome
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-03 00:00:00.000000000 Z
13
+ date: 2012-07-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json