iseq_rails_tools 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d28f4204fceab2420d1150d0c5a17ba122128bc3
|
4
|
+
data.tar.gz: 6641cb39d73f035b7ea60c1020cd24dd760f7aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec01b35224e8fe4e22384cb2360e7ffa569a7233871e4fd02f17622503a940f8bfb2e09d07ab92979d33427dd54f7660bff45aaa47ebbb87dae351424cfbbfdc
|
7
|
+
data.tar.gz: 51bc4969778390ecbf215857de73a16003c10df4b699fcde8e95e330a60b9b0ca4c81001288050ef52005f02bf96d72b8ac2524e7255af9df11abcf9838f44d2
|
@@ -11,25 +11,22 @@ static int whitelisted(char ch)
|
|
11
11
|
static VALUE iseq_path_for(VALUE self, VALUE ruby_source_path)
|
12
12
|
{
|
13
13
|
char *source_path = rb_string_value_cstr(&ruby_source_path);
|
14
|
-
char iseq_path[strlen(source_path) * 2 +
|
14
|
+
char iseq_path[strlen(source_path) * 2 + 6];
|
15
15
|
|
16
16
|
int source_idx = 0;
|
17
17
|
int iseq_idx = 0;
|
18
18
|
|
19
19
|
while(source_path[source_idx] != '\0') {
|
20
20
|
if (whitelisted(source_path[source_idx])) {
|
21
|
-
memcpy(iseq_path + iseq_idx
|
22
|
-
source_idx++;
|
23
|
-
iseq_idx++;
|
21
|
+
memcpy(iseq_path + iseq_idx++, source_path + source_idx++, 1);
|
24
22
|
} else {
|
25
|
-
sprintf(iseq_path + iseq_idx, "%02x", source_path[source_idx]);
|
26
|
-
source_idx++;
|
23
|
+
sprintf(iseq_path + iseq_idx, "%02x", source_path[source_idx++]);
|
27
24
|
iseq_idx += 2;
|
28
25
|
}
|
29
26
|
}
|
30
|
-
iseq_path[iseq_idx] = '\0';
|
31
27
|
|
32
|
-
|
28
|
+
memcpy(iseq_path + iseq_idx, ".yarb", 5);
|
29
|
+
return rb_str_new(iseq_path, iseq_idx + 5);
|
33
30
|
}
|
34
31
|
|
35
32
|
void Init_iseq_rails_tools()
|
Binary file
|
@@ -34,7 +34,7 @@ module IseqRailsTools
|
|
34
34
|
|
35
35
|
def self.load(source_path)
|
36
36
|
iseq_path = IseqRailsTools.iseq_path_for(source_path)
|
37
|
-
iseq_path = File.join(IseqRailsTools.iseq_dir,
|
37
|
+
iseq_path = File.join(IseqRailsTools.iseq_dir, iseq_path)
|
38
38
|
new(source_path, iseq_path).load
|
39
39
|
end
|
40
40
|
|