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: 38cc126c4ad1685ae0d5566b172d1b46866a0700
4
- data.tar.gz: 78f7769d2ece39c928a636b8c56629c129304032
3
+ metadata.gz: d28f4204fceab2420d1150d0c5a17ba122128bc3
4
+ data.tar.gz: 6641cb39d73f035b7ea60c1020cd24dd760f7aed
5
5
  SHA512:
6
- metadata.gz: c3fc6829a53d4bcf72a82de0aade64f8449414b3d72e7e2890504f012059b0a955723d39fa3afa0cee0ade773cf9d1f771e6938359d325500e50a79ff7299c12
7
- data.tar.gz: 2b95b97e1b814c400672b85624517583b283071617a5843abb56fd3859e3e4919dbd9ae9f3cfd92e2e61c949aa635716a9bcc657af7bc489769ed3a4bda54517
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 + 1];
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, source_path + source_idx, 1);
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
- return rb_str_new(iseq_path, iseq_idx);
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()
@@ -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, "#{iseq_path}.yarb")
37
+ iseq_path = File.join(IseqRailsTools.iseq_dir, iseq_path)
38
38
  new(source_path, iseq_path).load
39
39
  end
40
40
 
@@ -1,3 +1,3 @@
1
1
  module IseqRailsTools
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iseq_rails_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Deisz