appmap 0.26.1 → 0.27.0

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
  SHA256:
3
- metadata.gz: 969149d7dd70e1cdcf191b07a2f5e9a7678419474d7169ec2483071ef2ab8cde
4
- data.tar.gz: ad3ea01e6a3397452a69fd263cd21e70a50647e69445c269b86a40abad2cae76
3
+ metadata.gz: fd23faab460498cfac79b397c4fc87920df8d1a984142909542f524057d1e4cb
4
+ data.tar.gz: a967224c65d6a479287768389feb73a378e6e1be133f1033d06be6034a43b18e
5
5
  SHA512:
6
- metadata.gz: 323a5227476b547b8ef4fd8d1b35a5cfbf2d01ec46a0764f8a1e27c95a77c8aa3da8eb76eb971f13e9cb774976fdaa5a83462307730a4085a3e1a86f1f40be9f
7
- data.tar.gz: 622710776a9e8a9adfb29a876904c03e208b5ef219e1d0ee538f27c4dc5d7b1fd4556347dd9419f6b7e3d617c5b316d099233fe00819047c345fde2d7cdebe68
6
+ metadata.gz: 7822e4c821cb5e57579163fdd080bc3b74fb5ad0c8999bc6e3d29ace636301d8ed931966abfe9a59a6a59603f83af03e82130c241293ee198173ef6f6f41ebd1
7
+ data.tar.gz: 8ba03667929d4571e13439ab53420934e0b1c9ee4605dfd71e9a7ff82b984d34e37ca43e206cbf5dc750201df93dc8dc9babbdafbadf12a86051e52efc6ef985
@@ -1,3 +1,7 @@
1
+ # v0.27.0
2
+
3
+ * Add **AppMap.record** to programatically record and capture an AppMap of a Ruby block.
4
+
1
5
  # v0.26.1
2
6
 
3
7
  * Fix a bug that caused duplicate entries in the list of frameworks that appear
@@ -56,6 +56,20 @@ module AppMap
56
56
  @tracing ||= Trace::Tracers.new
57
57
  end
58
58
 
59
+ # Record a block and return the array of events.
60
+ def record
61
+ tracer = tracing.trace
62
+ begin
63
+ yield
64
+ ensure
65
+ tracing.delete(tracer)
66
+ end
67
+
68
+ [].tap do |events|
69
+ events << tracer.next_event.to_h while tracer.event?
70
+ end
71
+ end
72
+
59
73
  # Build a class map from a config and a list of Ruby methods.
60
74
  def class_map(config, methods)
61
75
  require 'appmap/class_map'
@@ -107,7 +107,17 @@ module AppMap
107
107
 
108
108
  def parent
109
109
  # An example group always has a parent; but it might be 'self'...
110
- example_group.parent != example_group ? ScopeExampleGroup.new(example_group.parent) : nil
110
+
111
+ # DEPRECATION WARNING: `Module#parent` has been renamed to `module_parent`. `parent` is deprecated and will be
112
+ # removed in Rails 6.1. (called from parent at /Users/kgilpin/source/appland/appmap-ruby/lib/appmap/rspec.rb:110)
113
+ example_group_parent = \
114
+ if example_group.respond_to?(:module_parent)
115
+ example_group.module_parent
116
+ else
117
+ example_group.parent
118
+ end
119
+
120
+ example_group_parent != example_group ? ScopeExampleGroup.new(example_group_parent) : nil
111
121
  end
112
122
  end
113
123
 
@@ -18,7 +18,7 @@ module AppMap
18
18
  @tracers << tracer
19
19
  tracer.enable if enable
20
20
  end
21
- end
21
+ end
22
22
 
23
23
  def enabled?
24
24
  @tracers.any?(&:enabled?)
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.26.1'
6
+ VERSION = '0.27.0'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.2'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport