evalhook 0.1.0 → 0.1.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.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/ext/evalhook_base/evalhook_base.c +13 -0
- data/lib/evalhook.rb +2 -0
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -630,6 +630,18 @@ VALUE caller_obj(VALUE self, VALUE rblevel) {
|
|
630
630
|
}
|
631
631
|
|
632
632
|
|
633
|
+
VALUE validate_syntax(VALUE self, VALUE code) {
|
634
|
+
|
635
|
+
NODE* node = rb_compile_string("(eval)", code, 1);
|
636
|
+
|
637
|
+
if (node == 0) {
|
638
|
+
rb_raise(rb_eSyntaxError,"");
|
639
|
+
}
|
640
|
+
|
641
|
+
return Qnil;
|
642
|
+
}
|
643
|
+
|
644
|
+
|
633
645
|
extern void Init_evalhook_base() {
|
634
646
|
m_EvalHook = rb_define_module("EvalHook");
|
635
647
|
|
@@ -662,6 +674,7 @@ See README for more examples
|
|
662
674
|
c_HookHandler = rb_define_class_under(m_EvalHook, "HookHandler", rb_cObject);
|
663
675
|
|
664
676
|
rb_define_singleton_method(m_EvalHook, "hook_block", hook_block, 1);
|
677
|
+
rb_define_singleton_method(m_EvalHook, "validate_syntax", validate_syntax, 1);
|
665
678
|
|
666
679
|
rb_define_method(c_HookHandler, "hook_method_tree", hook_method_tree, 1);
|
667
680
|
|
data/lib/evalhook.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evalhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dario Seminara
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-19 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|