galgo 0.1.0.pre → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Cargo.lock +7 -7
- data/Cargo.toml +1 -1
- data/README.md +3 -3
- data/Rakefile +3 -3
- data/ext/{gal → galgo}/Cargo.toml +3 -3
- data/ext/{gal → galgo}/extconf.rb +1 -1
- data/ext/galgo/src/lib.rs +26 -0
- data/lib/{gal → galgo}/version.rb +2 -2
- data/lib/{gal.rb → galgo.rb} +3 -3
- data/sig/{gal.rbs → galgo.rbs} +1 -1
- metadata +9 -9
- data/ext/gal/src/lib.rs +0 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bda65d26f03a491bbc54708e7275b08c4495077ad979f16cea5c21fbbadb8a66
|
|
4
|
+
data.tar.gz: 0e8200e77efc685a8b3d36475b1957e81f588632138f168a818431b6e6d21ca2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc4430cd319c76092c0a04418fa3976b89a53e0fddfa3b36052875703e5bafbf78b5a82022e4a3e84e86c7bbc8066578d6bdb2b9ca3df333a47951d67ca5c9ba
|
|
7
|
+
data.tar.gz: e537109d560e70e6d6c81df652b84960e587c29cfc85d607d17fb34ca0080a66e4f94ac8ad528503eda4811084612ad9ba0015d8291da1fa7e5224a9d7e0a8e7
|
data/.rubocop.yml
CHANGED
data/Cargo.lock
CHANGED
|
@@ -106,7 +106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
106
106
|
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
|
107
107
|
|
|
108
108
|
[[package]]
|
|
109
|
-
name = "
|
|
109
|
+
name = "galgo"
|
|
110
110
|
version = "0.1.0"
|
|
111
111
|
dependencies = [
|
|
112
112
|
"magnus",
|
|
@@ -223,9 +223,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
|
223
223
|
|
|
224
224
|
[[package]]
|
|
225
225
|
name = "magnus"
|
|
226
|
-
version = "0.
|
|
226
|
+
version = "0.8.2"
|
|
227
227
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
-
checksum = "
|
|
228
|
+
checksum = "3b36a5b126bbe97eb0d02d07acfeb327036c6319fd816139a49824a83b7f9012"
|
|
229
229
|
dependencies = [
|
|
230
230
|
"magnus-macros",
|
|
231
231
|
"rb-sys",
|
|
@@ -235,9 +235,9 @@ dependencies = [
|
|
|
235
235
|
|
|
236
236
|
[[package]]
|
|
237
237
|
name = "magnus-macros"
|
|
238
|
-
version = "0.
|
|
238
|
+
version = "0.8.0"
|
|
239
239
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
-
checksum = "
|
|
240
|
+
checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
|
|
241
241
|
dependencies = [
|
|
242
242
|
"proc-macro2",
|
|
243
243
|
"quote",
|
|
@@ -343,9 +343,9 @@ dependencies = [
|
|
|
343
343
|
|
|
344
344
|
[[package]]
|
|
345
345
|
name = "rb-sys-env"
|
|
346
|
-
version = "0.
|
|
346
|
+
version = "0.2.3"
|
|
347
347
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
348
|
-
checksum = "
|
|
348
|
+
checksum = "cca7ad6a7e21e72151d56fe2495a259b5670e204c3adac41ee7ef676ea08117a"
|
|
349
349
|
|
|
350
350
|
[[package]]
|
|
351
351
|
name = "regex"
|
data/Cargo.toml
CHANGED
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Galgo
|
|
2
2
|
|
|
3
3
|
TODO: Delete this and the text below, and describe your gem
|
|
4
4
|
|
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/
|
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/galgo`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
32
|
|
|
33
33
|
## Contributing
|
|
34
34
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/galgo.
|
|
36
36
|
|
|
37
37
|
## License
|
|
38
38
|
|
data/Rakefile
CHANGED
|
@@ -13,10 +13,10 @@ require "rb_sys/extensiontask"
|
|
|
13
13
|
|
|
14
14
|
task build: :compile
|
|
15
15
|
|
|
16
|
-
GEMSPEC = Gem::Specification.load("
|
|
16
|
+
GEMSPEC = Gem::Specification.load("galgo.gemspec")
|
|
17
17
|
|
|
18
|
-
RbSys::ExtensionTask.new("
|
|
19
|
-
ext.lib_dir = "lib/
|
|
18
|
+
RbSys::ExtensionTask.new("galgo", GEMSPEC) do |ext|
|
|
19
|
+
ext.lib_dir = "lib/galgo"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
task default: %i[compile spec rubocop]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[package]
|
|
2
|
-
name = "
|
|
2
|
+
name = "galgo"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["yuriko1211 <yuriko11d@gmail.com>"]
|
|
@@ -10,5 +10,5 @@ publish = false
|
|
|
10
10
|
crate-type = ["cdylib"]
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
|
-
magnus = { version = "0.
|
|
14
|
-
rand = "0.10.1"
|
|
13
|
+
magnus = { version = "0.8.2" }
|
|
14
|
+
rand = "0.10.1"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use magnus::{function, prelude::*, Error, Ruby};
|
|
2
|
+
use rand::prelude::*;
|
|
3
|
+
use rand::rng;
|
|
4
|
+
|
|
5
|
+
fn change_galgo(message: String) -> String {
|
|
6
|
+
format!(" {message} {}", random_gal_emoji())
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
fn random_gal_emoji() -> String {
|
|
10
|
+
let mut emojis = [
|
|
11
|
+
"(*•̀ᴗ•́*)و ̑̑",
|
|
12
|
+
"(⌒_⌒)",
|
|
13
|
+
"( ˘ω˘ )",
|
|
14
|
+
"٩(˘◡˘)۶",
|
|
15
|
+
"(˶′◡‵˶)"
|
|
16
|
+
];
|
|
17
|
+
emojis.shuffle(&mut rng());
|
|
18
|
+
emojis[0].to_string()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#[magnus::init]
|
|
22
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
23
|
+
let module = ruby.define_module("Galgo")?;
|
|
24
|
+
module.define_singleton_method("change_galgo", function!(change_galgo, 1))?;
|
|
25
|
+
Ok(())
|
|
26
|
+
}
|
data/lib/{gal.rb → galgo.rb}
RENAMED
data/sig/{gal.rbs → galgo.rbs}
RENAMED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: galgo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yuriko1211
|
|
@@ -28,7 +28,7 @@ email:
|
|
|
28
28
|
- yuriko11d@gmail.com
|
|
29
29
|
executables: []
|
|
30
30
|
extensions:
|
|
31
|
-
- ext/
|
|
31
|
+
- ext/galgo/extconf.rb
|
|
32
32
|
extra_rdoc_files: []
|
|
33
33
|
files:
|
|
34
34
|
- ".rspec"
|
|
@@ -39,12 +39,12 @@ files:
|
|
|
39
39
|
- LICENSE.txt
|
|
40
40
|
- README.md
|
|
41
41
|
- Rakefile
|
|
42
|
-
- ext/
|
|
43
|
-
- ext/
|
|
44
|
-
- ext/
|
|
45
|
-
- lib/
|
|
46
|
-
- lib/
|
|
47
|
-
- sig/
|
|
42
|
+
- ext/galgo/Cargo.toml
|
|
43
|
+
- ext/galgo/extconf.rb
|
|
44
|
+
- ext/galgo/src/lib.rs
|
|
45
|
+
- lib/galgo.rb
|
|
46
|
+
- lib/galgo/version.rb
|
|
47
|
+
- sig/galgo.rbs
|
|
48
48
|
homepage: https://github.com/yuriko1211/galgo
|
|
49
49
|
licenses:
|
|
50
50
|
- MIT
|
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: 3.3.11
|
|
68
68
|
requirements: []
|
|
69
|
-
rubygems_version:
|
|
69
|
+
rubygems_version: 4.0.6
|
|
70
70
|
specification_version: 4
|
|
71
71
|
summary: translate gal style
|
|
72
72
|
test_files: []
|
data/ext/gal/src/lib.rs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
use magnus::{function, prelude::*, Error, Ruby};
|
|
2
|
-
use rand::prelude::*;
|
|
3
|
-
use rand::rng;
|
|
4
|
-
|
|
5
|
-
fn change_gal(message: String) -> String {
|
|
6
|
-
format!(" {message} {}", random_gal())
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
fn random_gal() -> String {
|
|
10
|
-
let mut emojis = [
|
|
11
|
-
"(*•̀ᴗ•́*)و ̑̑",
|
|
12
|
-
"(⌒_⌒)",
|
|
13
|
-
"( ˘ω˘ )",
|
|
14
|
-
"٩(˘◡˘)۶",
|
|
15
|
-
"(˶′◡‵˶)"
|
|
16
|
-
];
|
|
17
|
-
emojis.shuffle(&mut rng());
|
|
18
|
-
emojis[0].to_string()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
fn hello(subject: String) -> String {
|
|
22
|
-
format!("Hello from Rust, {subject}!")
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#[magnus::init]
|
|
26
|
-
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
27
|
-
let module = ruby.define_module("Gal")?;
|
|
28
|
-
module.define_singleton_method("hello", function!(hello, 1))?;
|
|
29
|
-
module.define_singleton_method("change_gal", function!(change_gal, 1))?;
|
|
30
|
-
Ok(())
|
|
31
|
-
}
|