hacks 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ext/hacks/hacks.c.erb +29 -0
  3. data/hacks.gemspec +1 -1
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16f90c56986bf11fcdd769d072e31c2e9a26e7f94279ed86bcf3b4f78363688c
4
- data.tar.gz: ab237d83bd1a90627c04f55f2751f8f6be9bc0ffe39c917cb25b1a4643b6712e
3
+ metadata.gz: 9d864adfb10ffe7141efe44a825a6691a50564bb5762a81d0ab970afe264eb34
4
+ data.tar.gz: a653799f9f87b99e9d83c893aa793da7f8152dbddabc9be987be45faac2cb527
5
5
  SHA512:
6
- metadata.gz: eb63ecb06db50c6146cfb69328d60fbe1e74f24affd8ddf448c7158a09a9bd86ad078fd7a8360c0233105f0a16a060b38a129b4c16c3d98db0a4179a9efd5fca
7
- data.tar.gz: 05c35d336f2264c79304651d5e911589fbed8d960210a2480ecbd5ae6c27b7660a04cee55a214e8c862374db81a669641dafe3ebcf226ae83b9f03dcf0fd6144
6
+ metadata.gz: 94a16bcccc2be2fe57c52f55e4b8370d1a4a056c42fd8ceeefc7e9d8a8992d0a5ae8021abd0d7a78278c094b56485b61817ba9ae46f3e98a7a6a23b187ce27d8
7
+ data.tar.gz: 537c8567c67ccc38f9df2f0e4eacaa5ea1ed7a5ddf3c95990ed9bb619e5db0657905f72cfccf9dd275ec1aaa7105e7edf03f068326c865147706340a6082ebc3
@@ -1,11 +1,36 @@
1
1
  #include <ruby.h>
2
2
 
3
+ static VALUE
4
+ hacks_rb_intern_str(VALUE mod, VALUE x)
5
+ {
6
+ return rb_intern_str(x);
7
+ }
8
+
9
+ static VALUE
10
+ hacks_rb_gc_writebarrier(VALUE mod, VALUE x, VALUE y)
11
+ {
12
+ rb_gc_writebarrier(x, y);
13
+ return Qtrue;
14
+ }
15
+
16
+ static VALUE
17
+ hacks_rb_obj_class(VALUE mod, VALUE x)
18
+ {
19
+ return rb_obj_class(x);
20
+ }
21
+
3
22
  static VALUE
4
23
  hacks_rb_type(VALUE mod, VALUE x)
5
24
  {
6
25
  return INT2NUM(rb_type(x));
7
26
  }
8
27
 
28
+ static VALUE
29
+ hacks_rb_id2sym(VALUE mod, VALUE x)
30
+ {
31
+ return rb_id2sym((ID)NUM2INT(x));
32
+ }
33
+
9
34
  void Init_hacks(void)
10
35
  {
11
36
  VALUE rb_mHacks = rb_define_module("Hacks");
@@ -31,4 +56,8 @@ void Init_hacks(void)
31
56
  rb_define_const(rb_mHacks, "STRUCTS", offsets);
32
57
 
33
58
  rb_define_singleton_method(rb_mHacks, "rb_type", hacks_rb_type, 1);
59
+ rb_define_singleton_method(rb_mHacks, "rb_id2sym", hacks_rb_id2sym, 1);
60
+ rb_define_singleton_method(rb_mHacks, "rb_obj_class", hacks_rb_obj_class, 1);
61
+ rb_define_singleton_method(rb_mHacks, "rb_gc_writebarrier", hacks_rb_gc_writebarrier, 2);
62
+ rb_define_singleton_method(rb_mHacks, "rb_intern_str", hacks_rb_intern_str, 1);
34
63
  }
data/hacks.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "hacks"
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
  s.summary = "Ruby C internals exposed as Ruby"
7
7
  s.description = "These are some hacks I use. This gem exposes some Ruby C internals as Ruby functions and constants"
8
8
  s.authors = ["Aaron Patterson"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-06 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -60,7 +60,7 @@ homepage: https://github.com/tenderlove/hacks
60
60
  licenses:
61
61
  - Apache-2.0
62
62
  metadata: {}
63
- post_install_message:
63
+ post_install_message:
64
64
  rdoc_options: []
65
65
  require_paths:
66
66
  - lib
@@ -75,8 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.0.3.1
79
- signing_key:
78
+ rubygems_version: 3.5.0.dev
79
+ signing_key:
80
80
  specification_version: 4
81
81
  summary: Ruby C internals exposed as Ruby
82
82
  test_files: []