rotoscope 0.3.1.pre.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131b31e53265ab28834e10e524193c4140df6c4a550b97b4c069bd5144f2c0b9
4
- data.tar.gz: 8bcacd887b9c1dc7dec386dfd750f2e5521da85552183211370c67292ec7ea2d
3
+ metadata.gz: fb0b39e7f67f3038593c3dc6021e903404a75117afbe8364eb80a2941bbfa8ef
4
+ data.tar.gz: 7d3fceeb211a47f13088b099e26db5e5e8847b84c14090aa64d58bf6c919d92d
5
5
  SHA512:
6
- metadata.gz: 1acb66647386b79262fc77ad90433f920ffb36b75d2c7527b005abb68c377563a448b99d90e573518369171ddb05908c5a95fc5d9f88a646de72e385405c4087
7
- data.tar.gz: fc010fa94e7669b902aa7285dd85bccea72781cf6cb9b3165941c6c2023491e2f945ed9b2a4f7cb87fa3f55e30c5fbb5b0857726eda1b859b3385d9370e641b9
6
+ metadata.gz: 493b13e1a1f905be9c9c4774cd5d7280f5c163b791bfbe0d3b3dec81b0c575cc3b35063d0db62ba21ce5126810431dbf2d9197f3d224f008e9e143cfb346b81c
7
+ data.tar.gz: f67d35ba99ba3400714365ed02475bf5efc345bafb2f76f9834ad964fbfbc4538698deb00ea8e159320b5b788aa8d2f880f60c78fd463511e97d17cf1ba9790c
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ time: "14:00"
8
+ open-pull-requests-limit: 100
9
+ insecure-external-code-execution: allow
10
+ registries: "*"
11
+ groups:
12
+ minor-gem-update:
13
+ update-types:
14
+ - "minor"
15
+ patch-gem-update:
16
+ update-types:
17
+ - "patch"
@@ -6,21 +6,27 @@ on:
6
6
  jobs:
7
7
  test:
8
8
  runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ ruby: ["2.7"]
9
12
  steps:
10
13
  - uses: actions/checkout@v2
11
14
  - uses: ruby/setup-ruby@v1
12
15
  with:
13
- ruby-version: 2.7
16
+ ruby-version: ${{ matrix.ruby }}
14
17
  bundler-cache: true
15
18
  - run: bundle exec rake
16
19
 
17
20
  valgrind:
18
21
  runs-on: ubuntu-latest
22
+ strategy:
23
+ matrix:
24
+ ruby: ["2.7"]
19
25
  steps:
20
- - run: sudo apt-get install -y valgrind
26
+ - run: sudo apt-get update && sudo apt-get install -y valgrind
21
27
  - uses: actions/checkout@v2
22
28
  - uses: ruby/setup-ruby@v1
23
29
  with:
24
- ruby-version: 2.7
30
+ ruby-version: ${{ matrix.ruby }}
25
31
  bundler-cache: true
26
32
  - run: bundle exec rake test:valgrind
data/.rubocop.yml CHANGED
@@ -6,9 +6,12 @@ inherit_gem:
6
6
  AllCops:
7
7
  Exclude:
8
8
  - 'tmp/**/*'
9
- TargetRubyVersion: 2.7
10
9
 
11
- Metrics/LineLength:
10
+ Layout/LineLength:
11
+ Exclude:
12
+ - 'test/**/*'
13
+
14
+ Naming/MethodName:
12
15
  Exclude:
13
16
  - 'test/**/*'
14
17
 
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.8
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ gemspec
5
5
 
6
6
  gem "rubocop", require: false
7
7
  gem "rubocop-shopify", require: false
8
- gem "ruby_memcheck", "~> 0.3.0", require: false
8
+ gem "ruby_memcheck", "~> 2.3.0", require: false
data/README.md CHANGED
@@ -9,6 +9,13 @@ Rotoscope is a high-performance logger of Ruby method invocations.
9
9
 
10
10
  Rotoscope is subject to breaking changes in minor versions until `1.0` is available.
11
11
 
12
+ ## Table of Contents
13
+
14
+ - [Example](https://github.com/Shopify/rotoscope?tab=readme-ov-file#example)
15
+ - [API](https://github.com/Shopify/rotoscope?tab=readme-ov-file#api)
16
+ - [Default Logging Interface](https://github.com/Shopify/rotoscope?tab=readme-ov-file#default-logging-interface)
17
+ - [Low-level API](https://github.com/Shopify/rotoscope?tab=readme-ov-file#low-level-api)
18
+
12
19
  ## Example
13
20
 
14
21
  ```ruby
data/dev.yml CHANGED
@@ -5,7 +5,7 @@ env:
5
5
  ROTOSCOPE_COMPILE_ERROR: '1'
6
6
 
7
7
  up:
8
- - ruby: 2.7.8
8
+ - ruby
9
9
  - homebrew:
10
10
  - clang-format
11
11
  - bundler
@@ -124,7 +124,11 @@ static void event_hook(VALUE tpval, void *data) {
124
124
 
125
125
  config->callsite = tracearg_path(trace_arg);
126
126
 
127
- config->caller = rs_stack_peek(&config->stack);
127
+ rs_stack_frame_t *caller = rs_stack_peek(&config->stack);
128
+ config->has_caller = caller != NULL;
129
+ if (caller != NULL) {
130
+ config->caller = *caller;
131
+ }
128
132
 
129
133
  rs_method_desc_t method_desc = called_method_desc(trace_arg);
130
134
  rs_stack_push(&config->stack, (rs_stack_frame_t){.method = method_desc});
@@ -137,6 +141,9 @@ static void rs_gc_mark(void *data) {
137
141
  rb_gc_mark(config->tracepoint);
138
142
  rb_gc_mark(config->trace_proc);
139
143
  rs_stack_mark(&config->stack);
144
+ if (config->has_caller) {
145
+ rs_method_desc_mark(&config->caller.method);
146
+ }
140
147
  }
141
148
 
142
149
  static void rs_dealloc(void *data) {
@@ -165,7 +172,7 @@ static VALUE rs_alloc(VALUE klass) {
165
172
  config->pid = getpid();
166
173
  config->tid = current_thread_id();
167
174
  config->tracing = false;
168
- config->caller = NULL;
175
+ config->has_caller = false;
169
176
  config->callsite = (rs_callsite_t){
170
177
  .filepath = Qnil,
171
178
  .lineno = 0,
@@ -204,6 +211,7 @@ VALUE rotoscope_stop_trace(VALUE self) {
204
211
  rb_tracepoint_disable(config->tracepoint);
205
212
  config->tracing = false;
206
213
  rs_stack_reset(&config->stack);
214
+ config->has_caller = false;
207
215
  }
208
216
 
209
217
  return Qnil;
@@ -256,18 +264,18 @@ VALUE rotoscope_singleton_method_p(VALUE self) {
256
264
 
257
265
  VALUE rotoscope_caller_object(VALUE self) {
258
266
  Rotoscope *config = get_config(self);
259
- if (config->caller == NULL) {
267
+ if (!config->has_caller) {
260
268
  return Qnil;
261
269
  }
262
- return config->caller->method.receiver;
270
+ return config->caller.method.receiver;
263
271
  }
264
272
 
265
273
  VALUE rotoscope_caller_class(VALUE self) {
266
274
  Rotoscope *config = get_config(self);
267
- if (config->caller == NULL) {
275
+ if (!config->has_caller) {
268
276
  return Qnil;
269
277
  }
270
- return rs_method_class(&config->caller->method);
278
+ return rs_method_class(&config->caller.method);
271
279
  }
272
280
 
273
281
  VALUE rotoscope_caller_class_name(VALUE self) {
@@ -19,7 +19,9 @@ typedef struct {
19
19
  unsigned long tid;
20
20
  bool tracing;
21
21
  rs_stack_t stack;
22
- rs_stack_frame_t *caller;
22
+ // Copy, not a pointer into `stack`: pushing may realloc the stack buffer.
23
+ rs_stack_frame_t caller;
24
+ bool has_caller;
23
25
  rs_callsite_t callsite;
24
26
  VALUE trace_proc;
25
27
  } Rotoscope;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Rotoscope
4
- VERSION = "0.3.1.pre.3"
4
+ VERSION = "0.3.1"
5
5
  end
data/rotoscope.gemspec CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
21
21
  end
22
22
  s.metadata["allowed_push_host"] = "https://rubygems.org/"
23
23
 
24
- s.required_ruby_version = ">= 2.2.0"
24
+ s.required_ruby_version = ">= 2.7.0"
25
25
  s.extensions = ["ext/rotoscope/extconf.rb"]
26
26
 
27
27
  s.add_development_dependency("minitest", "~> 5.0")
28
- s.add_development_dependency("mocha", "~> 0.14")
29
- s.add_development_dependency("rake-compiler", "~> 0.9")
28
+ s.add_development_dependency("mocha", "~> 2.4")
29
+ s.add_development_dependency("rake-compiler", "~> 1.2")
30
30
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rotoscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.pre.3
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jahfer Husain
8
8
  - Dylan Thacker-Smith
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2023-12-08 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: minitest
@@ -31,28 +30,28 @@ dependencies:
31
30
  requirements:
32
31
  - - "~>"
33
32
  - !ruby/object:Gem::Version
34
- version: '0.14'
33
+ version: '2.4'
35
34
  type: :development
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
38
  - - "~>"
40
39
  - !ruby/object:Gem::Version
41
- version: '0.14'
40
+ version: '2.4'
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rake-compiler
44
43
  requirement: !ruby/object:Gem::Requirement
45
44
  requirements:
46
45
  - - "~>"
47
46
  - !ruby/object:Gem::Version
48
- version: '0.9'
47
+ version: '1.2'
49
48
  type: :development
50
49
  prerelease: false
51
50
  version_requirements: !ruby/object:Gem::Requirement
52
51
  requirements:
53
52
  - - "~>"
54
53
  - !ruby/object:Gem::Version
55
- version: '0.9'
54
+ version: '1.2'
56
55
  description: High-performance logger of Ruby method invocations
57
56
  email: jahfer.husain@shopify.com
58
57
  executables: []
@@ -62,11 +61,13 @@ extra_rdoc_files: []
62
61
  files:
63
62
  - ".clang-format"
64
63
  - ".github/PULL_REQUEST_TEMPLATE"
64
+ - ".github/dependabot.yml"
65
65
  - ".github/workflows/ci.yml"
66
66
  - ".github/workflows/cla.yml"
67
67
  - ".gitignore"
68
68
  - ".rubocop.yml"
69
69
  - ".rubocop_todo.yml"
70
+ - ".ruby-version"
70
71
  - Gemfile
71
72
  - LICENSE
72
73
  - README.md
@@ -93,7 +94,6 @@ licenses:
93
94
  - MIT
94
95
  metadata:
95
96
  allowed_push_host: https://rubygems.org/
96
- post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
99
99
  - lib
@@ -101,15 +101,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 2.2.0
104
+ version: 2.7.0
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">"
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 1.3.1
109
+ version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.4.22
112
- signing_key:
111
+ rubygems_version: 4.0.21
113
112
  specification_version: 4
114
113
  summary: Tracing Ruby
115
114
  test_files: []