hello_rusty_world 0.1.2 → 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: c9690043b914b1e83b2f2d715425591f35c5900e1b75a527346918f1f02665e3
4
- data.tar.gz: e025153a139d3cd27950ecbd60e6550c1979a006a39462d7da424cafa4f246b0
3
+ metadata.gz: 306099db47d23337d5240060273a31f101449ceb54c33f61b94abe51a3f521fb
4
+ data.tar.gz: 7247addbf7a96782c69e812a22dbf06d9103c9446ea8f2971202475797d5cc8f
5
5
  SHA512:
6
- metadata.gz: 656aadd8c2a3f1e8a10c6f7e8e16b9ca96d03fd67e0f54578f7426c33faaf5ae74acdf6f93342684a3d13410d202d74f02b51e7e1991b1a400e869cfcd742310
7
- data.tar.gz: 1706313198727a9023aa9ae1b8f8e5fd59315230f049c467460097deabfb20918d379908bcb3169e44143bd4084a597aebd92c740c06877381d94844c1230007
6
+ metadata.gz: 15e0818e6319d8fd69b26819ee340937f853df63edde5fa4927bd8bb774ed7ea62b6aa0e00de919aa26384fa3798fd9474f26a3787e6d39b917bf242971b901d
7
+ data.tar.gz: be04f6329a27a3e9e0c73ab4ec498d17f5c4df58f682fec5d4e5abc246055500cc9463c9c0d5d89ea0842f33573eb0fdbd53c3a9f68740cf361dcd9949229eef
@@ -3,7 +3,7 @@
3
3
  module HelloRustyWorld
4
4
  class Greeting
5
5
  def say
6
- puts "Hello World!"
6
+ "Hello World!"
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HelloRustyWorld
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -1,10 +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
- require "hello_rusty_world/greeting"
6
-
7
3
  module HelloRustyWorld
8
4
  class Error < StandardError; end
9
- # 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
10
25
  end
26
+
27
+ HelloRustyWorld.send(:load_native_extension)
28
+ require_relative "hello_rusty_world/version"
29
+ require "hello_rusty_world/greeting"
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken C. Demanawa