tracing 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20ef811dadb9ee19941f4848e9ba99ae47f705c1
4
- data.tar.gz: a6f2ee9abc71081e56b8f1a1c6d85e526952d284
3
+ metadata.gz: 36f3224f033fafe706d1f03dde9e2760e6f0795a
4
+ data.tar.gz: 0bb8418875f386516d22ef3163bd84540362a442
5
5
  SHA512:
6
- metadata.gz: b7f5e1d033b5d162496945ba150ebb692f89766bd902e5629a2bd8dac33f1aecacbf17d6bc60988d8d3e91771bd21fab82b42a3e58e5610723be1e2b01ad4915
7
- data.tar.gz: d68c6e4611334cb883756fefeeeb36cb4768461aaffdc4fdaf34f51ee87cb5f247b2d655b16164c708f5eb674ef0bff6ccf42a4c975255b093f5893a2d40ae15
6
+ metadata.gz: cf79beb12168c343f4c8f99f6852eca891abc5489b73873a1822644e16524f16977884954eaed7dd5163a6a209fb1afbe5943be1696c61673df10794ad08cab8
7
+ data.tar.gz: a48974a3ec56cd41677730af6acc310bdd02acd5e91a0fe2581736875906884ad159cba44a8190f43a10e8ab6261003b07477b52e112289cc0b76f1c12faee50
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ task :default => :spec
8
8
 
9
9
  desc "Bump gem version patch number"
10
10
  task :bump do
11
- path = File.expand_path('../lib/activefacts/api/version.rb', __FILE__)
11
+ path = File.expand_path('../lib/tracing/version.rb', __FILE__)
12
12
  lines = File.open(path) do |fp| fp.readlines; end
13
13
  File.open(path, "w") do |fp|
14
14
  fp.write(
@@ -22,68 +22,3 @@ task :bump do
22
22
  )
23
23
  end
24
24
  end
25
-
26
- desc "Run Rspec tests"
27
- RSpec::Core::RakeTask.new(:spec) do |t|
28
- t.rspec_opts = %w{-f d}
29
- end
30
-
31
- namespace :spec do
32
- namespace :rubies do
33
- SUPPORTED_RUBIES = %w{ 1.9.2 1.9.3 2.0.0 jruby-1.7.0 }
34
-
35
- desc "Run Rspec tests on all supported rubies"
36
- task :all_tasks => [:install_gems, :exec]
37
-
38
- desc "Run `bundle install` on all rubies"
39
- task :install_gems do
40
- sh %{ rvm #{SUPPORTED_RUBIES.join(',')} exec bundle install }
41
- end
42
-
43
- desc "Run `bundle exec rake` on all rubies"
44
- task :exec do
45
- sh %{ rvm #{SUPPORTED_RUBIES.join(',')} exec bundle exec rake spec }
46
- end
47
-
48
- SUPPORTED_RUBIES.each do |ruby|
49
- desc "Run `bundle install` on #{ruby}"
50
- task :"install_gems_#{ruby}" do
51
- sh %{ rvm #{ruby} exec bundle install }
52
- end
53
-
54
- desc "Run `bundle exec rake` on #{ruby}"
55
- task :"exec_#{ruby}" do
56
- sh %{ rvm #{ruby} exec bundle exec rake spec }
57
- end
58
- end
59
-
60
- end
61
- end
62
-
63
- desc "Run RSpec tests and produce coverage files (results viewable in coverage/index.html)"
64
- RSpec::Core::RakeTask.new(:coverage) do |spec|
65
- if RUBY_VERSION < '1.9'
66
- spec.rcov_opts = %{ --exclude spec --exclude lib/activefacts/tracer.rb --exclude gem/* }
67
- spec.rcov = true
68
- else
69
- spec.rspec_opts = %w{ --require simplecov_helper }
70
- end
71
- end
72
-
73
- task :cov => :coverage
74
- task :rcov => :coverage
75
- task :simplecov => :coverage
76
-
77
- Rake::RDocTask.new do |rdoc|
78
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
79
-
80
- rdoc.rdoc_dir = 'rdoc'
81
- rdoc.title = "activefacts-api #{version}"
82
- rdoc.rdoc_files.include('README*')
83
- rdoc.rdoc_files.include('lib/**/*.rb')
84
- end
85
-
86
- task :wait do
87
- print "Waiting for you to hit Enter"
88
- $stdin.gets
89
- end
data/lib/tracing.rb CHANGED
@@ -67,11 +67,11 @@ module Tracing
67
67
 
68
68
  def trace(*args, &block)
69
69
  begin
70
- old_indent, old_nested, old_delayed, enabled = @indent, @nested, @delayed, show(*args)
70
+ old_indent, old_nested, enabled = @indent, @nested, show(*args)
71
71
  # This monstrosity reduces the steps when single-stepping:
72
72
  block ? yield : (args.size == 0 ? self : enabled)
73
73
  ensure
74
- @indent, @nested, @delayed = old_indent, old_nested, old_delayed
74
+ @indent, @nested = old_indent, old_nested
75
75
  end
76
76
  end
77
77
 
@@ -215,13 +215,15 @@ module Tracing
215
215
  map{|a| a.respond_to?(:call) ? a.call : a}.
216
216
  join(' ')
217
217
 
218
- if @delayed == true
219
- @delayed = message # Arrange to display this message later, if necessary
220
- elsif @delayed
221
- display key, @delayed # Display a delayed message, then the current one
222
- @delayed = nil
223
- display key, message
218
+ if @delay
219
+ @delayed = [@delayed, message].compact*"\n" # Arrange to display this message later, if necessary
220
+ @delay = false
224
221
  else
222
+ if @delayed
223
+ display key, @delayed # Display a delayed message, then the current one
224
+ @delayed = nil
225
+ @delay = false
226
+ end
225
227
  display key, message
226
228
  end
227
229
  end
@@ -239,7 +241,7 @@ module Tracing
239
241
  nested = true
240
242
  s.sub(/!\Z/, '').to_sym
241
243
  when /\?\Z/ # Delay this message until a nested active trace
242
- @delayed = true
244
+ @delay = true
243
245
  s.sub(/\?\Z/, '').to_sym
244
246
  else
245
247
  control
@@ -1,3 +1,3 @@
1
1
  module Tracing
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clifford Heath