hello_rusty_world 0.1.1 → 0.1.3

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: 91216ec916750554769d25f5da10c19e963e4829bb1eb486b726abad0103f518
4
- data.tar.gz: efc2aeaea282013f03b90b3ab5a2abfcc0847c1cd8d40cf68ee95983fe832b37
3
+ metadata.gz: 306099db47d23337d5240060273a31f101449ceb54c33f61b94abe51a3f521fb
4
+ data.tar.gz: 7247addbf7a96782c69e812a22dbf06d9103c9446ea8f2971202475797d5cc8f
5
5
  SHA512:
6
- metadata.gz: a00df152fd10eb539008643a8c1ce4cd7dcb77db5376c16a78556de4b97aae6f87ded0a93c6bc6d8ab34072ca7f3d1513129dc2ec58676740de35b4625577a06
7
- data.tar.gz: f85c13d107ab094109a9720cf2021acb8fd72bac2960861890ebc5c72ae91128c408d6169912200e1773662203251095c26899e524deea9c3411cd8565d66b6b
6
+ metadata.gz: 15e0818e6319d8fd69b26819ee340937f853df63edde5fa4927bd8bb774ed7ea62b6aa0e00de919aa26384fa3798fd9474f26a3787e6d39b917bf242971b901d
7
+ data.tar.gz: be04f6329a27a3e9e0c73ab4ec498d17f5c4df58f682fec5d4e5abc246055500cc9463c9c0d5d89ea0842f33573eb0fdbd53c3a9f68740cf361dcd9949229eef
data/Cargo.toml CHANGED
@@ -6,8 +6,11 @@
6
6
  members = ["./ext/hello_rusty_world"]
7
7
  resolver = "2"
8
8
 
9
+ [profile.dev]
10
+ debug = true
11
+
9
12
  [profile.release]
10
13
  # By default, debug symbols are stripped from the final binary which makes it
11
14
  # harder to debug if something goes wrong. It's recommended to keep debug
12
15
  # symbols in the release build so that you can debug the final binary if needed.
13
- debug = true
16
+ debug = false
@@ -25,7 +25,7 @@ RUN rustup target add \
25
25
  x86_64-unknown-linux-gnu \
26
26
  aarch64-unknown-linux-gnu \
27
27
  x86_64-unknown-linux-musl \
28
- aarch64-unknown-linux-musl
28
+ aarch64-unknown-linux-musl
29
29
 
30
30
  RUN groupadd --gid ${USER_GID} ${USERNAME}
31
31
  RUN useradd --uid ${USER_UID} \
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HelloRustyWorld
4
+ class Greeting
5
+ def say
6
+ "Hello World!"
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HelloRustyWorld
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -1,9 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "hello_rusty_world/version"
4
- require "hello_rusty_world/hello_rusty_world"
5
-
6
3
  module HelloRustyWorld
7
4
  class Error < StandardError; end
8
- # Your code goes here...
5
+
6
+ class << self
7
+ def load_native_extension
8
+ ruby_api_ver = RbConfig::CONFIG.fetch("ruby_version").split(".", 3)[0, 2].join(".")
9
+ require_relative "hello_rusty_world/#{ruby_api_ver}/hello_rusty_world"
10
+ @native_enabled = true
11
+ rescue LoadError
12
+ @native_enabled = false
13
+ ensure
14
+ unless @native_enabled
15
+ require_relative "hello_rusty_world/hello_rusty_world"
16
+ @native_enabled = true
17
+ end
18
+ end
19
+
20
+ def native_enabled?
21
+ @native_enabled == true
22
+ end
23
+ end
24
+ private_class_method :load_native_extension
9
25
  end
26
+
27
+ HelloRustyWorld.send(:load_native_extension)
28
+ require_relative "hello_rusty_world/version"
29
+ require "hello_rusty_world/greeting"
data/mise.toml ADDED
@@ -0,0 +1,2 @@
1
+ [tools]
2
+ ruby = "4"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hello_rusty_world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken C. Demanawa
@@ -47,15 +47,17 @@ files:
47
47
  - ext/hello_rusty_world/extconf.rb
48
48
  - ext/hello_rusty_world/src/lib.rs
49
49
  - lib/hello_rusty_world.rb
50
+ - lib/hello_rusty_world/greeting.rb
50
51
  - lib/hello_rusty_world/version.rb
52
+ - mise.toml
51
53
  - sig/hello_rusty_world.rbs
52
- homepage: https://github.com/kanutocd/hello_rusty_world
54
+ homepage: https://kanutocd.github.com/hello_rusty_world
53
55
  licenses:
54
56
  - MIT
55
57
  metadata:
56
- homepage_uri: https://github.com/kanutocd/hello_rusty_world
58
+ homepage_uri: https://kanutocd.github.com/hello_rusty_world
57
59
  source_code_uri: https://github.com/kanutocd/hello_rusty_world
58
- changelog_uri: https://github.com/kanutocd/hello_rusty_world
60
+ changelog_uri: https://github.com/kanutocd/hello_rusty_world/blob/trunk/CHANGELOG.md
59
61
  rdoc_options: []
60
62
  require_paths:
61
63
  - lib