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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 626edadfa2677f0a1632ade4fad54606e95929f2f936ef7e3b782b80a6ad927f
4
- data.tar.gz: 4027675043d71f95ea72db5736b2a6b1e96a1a4bfee044d1400c2ff50afe1da5
3
+ metadata.gz: bda65d26f03a491bbc54708e7275b08c4495077ad979f16cea5c21fbbadb8a66
4
+ data.tar.gz: 0e8200e77efc685a8b3d36475b1957e81f588632138f168a818431b6e6d21ca2
5
5
  SHA512:
6
- metadata.gz: 446c3cb7c05ab52bd371e43da790a02366b5267410da9d7ff349cb7d77c18fa3359903d56d44e5bb72fa0e1534250701fd62fc4bb4577adc425e50046912c402
7
- data.tar.gz: 77ee318105886cc987f9ca30623a841657fd85d0e4c1dc17284488d6fe732f3033ca1d638d2897ce50f772786c0881f51d3c7aacead7bed98923b80de4587180
6
+ metadata.gz: bc4430cd319c76092c0a04418fa3976b89a53e0fddfa3b36052875703e5bafbf78b5a82022e4a3e84e86c7bbc8066578d6bdb2b9ca3df333a47951d67ca5c9ba
7
+ data.tar.gz: e537109d560e70e6d6c81df652b84960e587c29cfc85d607d17fb34ca0080a66e4f94ac8ad528503eda4811084612ad9ba0015d8291da1fa7e5224a9d7e0a8e7
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 3.1
2
+ TargetRubyVersion: 3.2
3
3
 
4
4
  Style/StringLiterals:
5
5
  EnforcedStyle: double_quotes
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 = "gal"
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.6.4"
226
+ version = "0.8.2"
227
227
  source = "registry+https://github.com/rust-lang/crates.io-index"
228
- checksum = "b1597ef40aa8c36be098249e82c9a20cf7199278ac1c1a1a995eeead6a184479"
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.6.0"
238
+ version = "0.8.0"
239
239
  source = "registry+https://github.com/rust-lang/crates.io-index"
240
- checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
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.1.2"
346
+ version = "0.2.3"
347
347
  source = "registry+https://github.com/rust-lang/crates.io-index"
348
- checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
348
+ checksum = "cca7ad6a7e21e72151d56fe2495a259b5670e204c3adac41ee7ef676ea08117a"
349
349
 
350
350
  [[package]]
351
351
  name = "regex"
data/Cargo.toml CHANGED
@@ -3,5 +3,5 @@
3
3
  # in the ext/ directory.
4
4
 
5
5
  [workspace]
6
- members = ["./ext/gal"]
6
+ members = ["./ext/galgo"]
7
7
  resolver = "2"
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Gal
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/gal`. To experiment with that code, run `bin/console` for an interactive prompt.
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]/gal.
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("gal.gemspec")
16
+ GEMSPEC = Gem::Specification.load("galgo.gemspec")
17
17
 
18
- RbSys::ExtensionTask.new("gal", GEMSPEC) do |ext|
19
- ext.lib_dir = "lib/gal"
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 = "gal"
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.6.2" }
14
- rand = "0.10.1"
13
+ magnus = { version = "0.8.2" }
14
+ rand = "0.10.1"
@@ -3,4 +3,4 @@
3
3
  require "mkmf"
4
4
  require "rb_sys/mkmf"
5
5
 
6
- create_rust_makefile("gal/gal")
6
+ create_rust_makefile("galgo/galgo")
@@ -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
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Gal
4
- VERSION = "0.1.0.pre"
3
+ module Galgo
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "gal/version"
4
- require_relative "gal/gal"
3
+ require_relative "galgo/version"
4
+ require "galgo/galgo"
5
5
 
6
- module Gal
6
+ module Galgo
7
7
  class Error < StandardError; end
8
8
  # Your code goes here...
9
9
  end
@@ -1,4 +1,4 @@
1
- module Gal
1
+ module Galgo
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
4
  end
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.1.0.pre
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/gal/extconf.rb
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/gal/Cargo.toml
43
- - ext/gal/extconf.rb
44
- - ext/gal/src/lib.rs
45
- - lib/gal.rb
46
- - lib/gal/version.rb
47
- - sig/gal.rbs
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: 3.6.9
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
- }