rucy 0.1.16 → 0.1.18

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
  SHA256:
3
- metadata.gz: 316378a11ef7b873b7d77adeb9856280df55a130daf7997d5bb5fe114fc15331
4
- data.tar.gz: 81cf980b50bd54f9ea3e77275baa9852456e14aedddcc4dbdd5158038f1f6478
3
+ metadata.gz: 590d30c635bbc6cdf9d3f4f4c2022a0d024c62c0d2f3e08a83f075ac2ef50681
4
+ data.tar.gz: 20f747540814744c0444d7606c488167f9cc1d1ae5f751527e21cf57f7880bef
5
5
  SHA512:
6
- metadata.gz: 735e517eb093760b6f459273849919474002c3040eff84866102069009824e06e5c87018707786c32fbadf32ad72026ca3b924c0929e2fee966191f112b5d561
7
- data.tar.gz: 21efee6f049361ac15e032a2ad043a70fa921f94be2b1f33d2da8f89dd5a7e5c80608c6210527ec3fd9af2daef25bc479d98aa3f2f52005efc796e88765ea7df
6
+ metadata.gz: ee3769c74d21c01131a036582c16ce6083c5eacc87bd528044f00c459a5480cae28dc129ec306dd171385a22588b07ffe62de6ccea946e0cb5a4f643ede20144
7
+ data.tar.gz: 9af4e962f4b62b49ed5c7d213fb28357f7ebe00279b6b7d981e2dd5991d17e289547ac28a69e247f96277973aeee13b94ab7fef462c65276ad4f59b049e3711f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.16
1
+ 0.1.18
@@ -5,7 +5,6 @@
5
5
 
6
6
 
7
7
  #include <ruby.h>
8
- #include <ruby/intern.h>
9
8
 
10
9
 
11
10
  namespace Rucy
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.platform = Gem::Platform::RUBY
29
29
  s.required_ruby_version = '~> 2'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.16'
32
32
 
33
33
  s.files = `git ls-files`.split $/
34
34
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
@@ -3,6 +3,7 @@
3
3
 
4
4
 
5
5
  #include <assert.h>
6
+ #include <ruby/encoding.h>
6
7
  #include "rucy/function.h"
7
8
  #include "rucy/exception.h"
8
9
  #include "rucy/debug.h"
@@ -55,15 +56,29 @@ namespace Rucy
55
56
  {
56
57
  }
57
58
 
59
+ static VALUE
60
+ str_new (const char* s)
61
+ {
62
+ rb_encoding* e = rb_default_internal_encoding();
63
+ return e ? rb_enc_str_new_cstr(s, e) : rb_str_new_cstr(s);
64
+ }
65
+
66
+ static VALUE
67
+ str_new (const char* s, size_t len)
68
+ {
69
+ rb_encoding* e = rb_default_internal_encoding();
70
+ return e ? rb_enc_str_new(s, len, e) : rb_str_new(s, len);
71
+ }
72
+
58
73
  Value::Value (const char* s)
59
- : val(s ? rb_str_new2(s) : Qnil)
74
+ : val(s ? str_new(s) : Qnil)
60
75
  {
61
76
  if (!s)
62
77
  argument_error(__FILE__, __LINE__);
63
78
  }
64
79
 
65
80
  Value::Value (const char* s, size_t len)
66
- : val(s ? rb_str_new(s, len) : Qnil)
81
+ : val(s ? str_new(s, len) : Qnil)
67
82
  {
68
83
  if (!s)
69
84
  argument_error(__FILE__, __LINE__);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rucy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2020-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: 0.1.16
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.1'
26
+ version: 0.1.16
27
27
  description: This library helps you to develop Ruby Extension by C++.
28
28
  email: xordog@gmail.com
29
29
  executables: