crystalruby 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/examples/adder/adder.rb +2 -2
- data/lib/crystalruby/typemaps.rb +3 -0
- data/lib/crystalruby/types/variable_width/string.rb +2 -1
- data/lib/crystalruby/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 542a695dee21acb928d1c758ce8a48f31422b8b71940b6ea61d87c2744b3fc5c
|
4
|
+
data.tar.gz: 988da32111ca2a2a13f1b8da93c850a76ea6dda4191f55feabd768b35444e316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5109478ed499c9737dc008cae0f720ae03d30a31bffb9add0034303ba7d39b943b437074fb033b52f307cb09f838d64a1a037b36f80bf985e4141614b8ec983
|
7
|
+
data.tar.gz: 4e1f0831bf0eb15a889ad7ca0bd797ae02377968f41b365593102663ff828b0791cd500871e6ba3145b4613a2ed797690ca0b4866e57ee18d9032ddee546aa96
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ crystallize :int32
|
|
46
46
|
def count_primes_upto_cr(n: Int32)
|
47
47
|
(2..n).each.count do |i|
|
48
48
|
is_prime = true
|
49
|
-
(2..Math.
|
49
|
+
(2..Math.isqrt(i)).each do |j|
|
50
50
|
if i % j == 0
|
51
51
|
is_prime = false
|
52
52
|
break
|
@@ -59,7 +59,7 @@ end
|
|
59
59
|
def count_primes_upto_rb(n)
|
60
60
|
(2..n).each.count do |i|
|
61
61
|
is_prime = true
|
62
|
-
(2..
|
62
|
+
(2..Integer.sqrt(i)).each do |j|
|
63
63
|
if i % j == 0
|
64
64
|
is_prime = false
|
65
65
|
break
|
data/examples/adder/adder.rb
CHANGED
data/lib/crystalruby/typemaps.rb
CHANGED
@@ -108,6 +108,9 @@ module CrystalRuby
|
|
108
108
|
arg = crystalruby_type.new(arg) unless arg.is_a?(Types::Type)
|
109
109
|
crystalruby_type.anonymous? ? arg.native : arg
|
110
110
|
}
|
111
|
+
# Strings in Crystal are UTF-8 encoded by default
|
112
|
+
elsif crystalruby_type.equal?(:string)
|
113
|
+
->(arg) { arg.force_encoding("UTF-8") }
|
111
114
|
end,
|
112
115
|
convert_crystal_to_lib_type: ->(expr) { convert_crystal_to_lib_type(expr, crystalruby_type) },
|
113
116
|
convert_lib_to_crystal_type: ->(expr) { convert_lib_to_crystal_type(expr, crystalruby_type) }
|
data/lib/crystalruby/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
|
-
original_platform: ''
|
7
6
|
authors:
|
8
7
|
- Wouter Coppieters
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: digest
|
@@ -147,6 +147,7 @@ metadata:
|
|
147
147
|
homepage_uri: https://github.com/wouterken/crystalruby
|
148
148
|
source_code_uri: https://github.com/wouterken/crystalruby
|
149
149
|
changelog_uri: https://github.com/wouterken/crystalruby/CHANGELOG.md
|
150
|
+
post_install_message:
|
150
151
|
rdoc_options: []
|
151
152
|
require_paths:
|
152
153
|
- lib
|
@@ -161,7 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
162
|
- !ruby/object:Gem::Version
|
162
163
|
version: '0'
|
163
164
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
165
|
+
rubygems_version: 3.5.22
|
166
|
+
signing_key:
|
165
167
|
specification_version: 4
|
166
168
|
summary: Embed Crystal code directly in Ruby.
|
167
169
|
test_files: []
|