crystalruby 0.1.7 → 0.1.8

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: fe68e58781b8314afb53b268ba9314472ee93c611565f7398d0ff29b445f8ece
4
- data.tar.gz: acd5e80d5709cc6f831daa39f58f74fe95642e16a4c44d25c8fab24106b47bcd
3
+ metadata.gz: 95d9eecc4d47a8d9f83417779c6174eea95ebeea593e5127a89b6cfbc7884664
4
+ data.tar.gz: b4f241f826e4f2b6c704bda0fd01c201e79a9bc26027bd4702717fd371687650
5
5
  SHA512:
6
- metadata.gz: 85516d1372b2467147cb5c61e6d33dc27e6e2c0d11876b32dbee1007152096fd54551926177b56e066fa9bc8e4329b8ef13d133280305018428775267eb4a24e
7
- data.tar.gz: 207284740bef726d1a8c5df35b21ebe33b8611725363acac451bbadc3b7c714585513027be2398dd4cdd6ff94761c00585c94546fb198a4b90047d91edbef2ce
6
+ metadata.gz: d98f1e4a671679cfb8d9da45298954e01def202802bd5a64db9d0d9cba08de0776971d031648642f402fe0310d741dc6b2d163253884ad25082298226c1be1a0
7
+ data.tar.gz: 141658885f763ca3088a7058131e7227434920d6213e755e21f85d6bb4d68a062a2a3163127f4e9f0db03a8c9a27a0549837714b38789647028075cc3b77660c
data/README.md CHANGED
@@ -143,7 +143,7 @@ require 'bundler/inline'
143
143
 
144
144
  gemfile do
145
145
  source 'https://rubygems.org'
146
- gem 'crystalruby', path: '../crystalruby'
146
+ gem 'crystalruby'
147
147
  end
148
148
 
149
149
  require 'crystalruby'
@@ -1,63 +1,63 @@
1
1
  module CrystalRuby
2
2
  module Typemaps
3
3
  CRYSTAL_TYPE_MAP = {
4
- :char => "Int8", # In Crystal, :char is typically represented as Int8
5
- :uchar => "UInt8", # Unsigned char
6
- :int8 => "Int8", # Same as :char
7
- :uint8 => "UInt8", # Same as :uchar
8
- :short => "Int16", # Short integer
9
- :ushort => "UInt16", # Unsigned short integer
10
- :int16 => "Int16", # Same as :short
11
- :uint16 => "UInt16", # Same as :ushort
12
- :int => "Int32", # Integer, Crystal defaults to 32 bits
13
- :uint => "UInt32", # Unsigned integer
14
- :int32 => "Int32", # 32-bit integer
15
- :uint32 => "UInt32", # 32-bit unsigned integer
16
- :long => "Int32 | Int64", # Long integer, size depends on the platform (32 or 64 bits)
17
- :ulong => "UInt32 | UInt64", # Unsigned long integer, size depends on the platform
18
- :int64 => "Int64", # 64-bit integer
19
- :uint64 => "UInt64", # 64-bit unsigned integer
20
- :long_long => "Int64", # Same as :int64
21
- :ulong_long => "UInt64", # Same as :uint64
22
- :float => "Float32", # Floating point number (single precision)
23
- :double => "Float64", # Double precision floating point number
24
- :bool => "Bool", # Boolean type
25
- :void => "Void", # Void type
26
- :string => "String" # String type
4
+ char: "Int8", # In Crystal, :char is typically represented as Int8
5
+ uchar: "UInt8", # Unsigned char
6
+ int8: "Int8", # Same as :char
7
+ uint8: "UInt8", # Same as :uchar
8
+ short: "Int16", # Short integer
9
+ ushort: "UInt16", # Unsigned short integer
10
+ int16: "Int16", # Same as :short
11
+ uint16: "UInt16", # Same as :ushort
12
+ int: "Int32", # Integer, Crystal defaults to 32 bits
13
+ uint: "UInt32", # Unsigned integer
14
+ int32: "Int32", # 32-bit integer
15
+ uint32: "UInt32", # 32-bit unsigned integer
16
+ long: "Int32 | Int64", # Long integer, size depends on the platform (32 or 64 bits)
17
+ ulong: "UInt32 | UInt64", # Unsigned long integer, size depends on the platform
18
+ int64: "Int64", # 64-bit integer
19
+ uint64: "UInt64", # 64-bit unsigned integer
20
+ long_long: "Int64", # Same as :int64
21
+ ulong_long: "UInt64", # Same as :uint64
22
+ float: "Float32", # Floating point number (single precision)
23
+ double: "Float64", # Double precision floating point number
24
+ bool: "Bool", # Boolean type
25
+ void: "Void", # Void type
26
+ string: "String" # String type
27
27
  }
28
28
 
29
29
  ERROR_VALUE = {
30
- :char => "0", # In Crystal, :char is typically represented as Int8
31
- :uchar => "0", # Unsigned char
32
- :int8 => "0", # Same as :char
33
- :uint8 => "0", # Same as :uchar
34
- :short => "0", # Short integer
35
- :ushort => "0", # Unsigned short integer
36
- :int16 => "0", # Same as :short
37
- :uint16 => "0", # Same as :ushort
38
- :int => "0", # Integer, Crystal defaults to 32 bits
39
- :uint => "0", # Unsigned integer
40
- :int32 => "0", # 32-bit integer
41
- :uint32 => "0", # 32-bit unsigned integer
42
- :long => "0", # Long integer, size depends on the platform (32 or 64 bits)
43
- :ulong => "0", # Unsigned long integer, size depends on the platform
44
- :int64 => "0", # 64-bit integer
45
- :uint64 => "0", # 64-bit unsigned integer
46
- :long_long => "0", # Same as :int64
47
- :ulong_long => "0", # Same as :uint64
48
- :float => "0.0", # Floating point number (single precision)
49
- :double => "0.0", # Double precision floating point number
50
- :bool => "false", # Boolean type
51
- :void => "Void", # Void type
52
- :string => '""' # String type
30
+ char: "0", # In Crystal, :char is typically represented as Int8
31
+ uchar: "0", # Unsigned char
32
+ int8: "0", # Same as :char
33
+ uint8: "0", # Same as :uchar
34
+ short: "0", # Short integer
35
+ ushort: "0", # Unsigned short integer
36
+ int16: "0", # Same as :short
37
+ uint16: "0", # Same as :ushort
38
+ int: "0", # Integer, Crystal defaults to 32 bits
39
+ uint: "0", # Unsigned integer
40
+ int32: "0", # 32-bit integer
41
+ uint32: "0", # 32-bit unsigned integer
42
+ long: "0", # Long integer, size depends on the platform (32 or 64 bits)
43
+ ulong: "0", # Unsigned long integer, size depends on the platform
44
+ int64: "0", # 64-bit integer
45
+ uint64: "0", # 64-bit unsigned integer
46
+ long_long: "0", # Same as :int64
47
+ ulong_long: "0", # Same as :uint64
48
+ float: "0.0", # Floating point number (single precision)
49
+ double: "0.0", # Double precision floating point number
50
+ bool: "false", # Boolean type
51
+ void: "Void", # Void type
52
+ string: '"".to_unsafe' # String type
53
53
  }
54
54
 
55
55
  C_TYPE_MAP = CRYSTAL_TYPE_MAP.merge({
56
- :string => "UInt8*"
57
- })
56
+ string: "UInt8*"
57
+ })
58
58
 
59
59
  C_TYPE_CONVERSIONS = {
60
- :string => {
60
+ string: {
61
61
  from: "String.new(%s)",
62
62
  to: "%s.to_unsafe"
63
63
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crystalruby
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crystalruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-10 00:00:00.000000000 Z
11
+ date: 2024-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest