rcee_isolated 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ad8122cd8fd59ce71a825faa743476782c16b974640d27c315ee00faf744cf85
4
+ data.tar.gz: cd588fadacc9fed33249b6fae408ebd4fb2102e0e4a39574ae8566a3ff885096
5
+ SHA512:
6
+ metadata.gz: 33ef24a02739be741e0898789a710103c0bfa5a7957302b1316b23acabf07cc2b7ec20bc93a82e26a05f89a62b8ee93e9b2660786bad1c01a8c2d50eefa8b4fc
7
+ data.tar.gz: 35470156add2382ee65bcf9e7ec67e2410438aa320886fad76b42350fa2cdcb1c0c161bf0e7e5a71ee0368113c38873d6a1526f87547e1655f54efb3a8e244ea
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.bundle
10
+ *.so
11
+ *.o
12
+ *.a
13
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in isolated.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rake-compiler"
11
+
12
+ gem "minitest", "~> 5.0"
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+
2
+ This gem is part of the Ruby C Extensions Explained project at https://github.com/flavorjones/ruby-c-extensions-explained
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+ require "rubygems/package_task"
6
+
7
+ rcee_isolated_spec = Bundler.load_gemspec("rcee_isolated.gemspec")
8
+ Gem::PackageTask.new(rcee_isolated_spec).define
9
+
10
+ Rake::TestTask.new(:test) do |t|
11
+ t.libs << "test"
12
+ t.libs << "lib"
13
+ t.test_files = FileList["test/**/*_test.rb"]
14
+ end
15
+
16
+ require "rake/extensiontask"
17
+
18
+ task build: :compile
19
+
20
+ Rake::ExtensionTask.new("isolated") do |ext|
21
+ ext.lib_dir = "lib/rcee/isolated"
22
+ end
23
+
24
+ task default: %i[clobber compile test]
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile("rcee/isolated/isolated")
@@ -0,0 +1,22 @@
1
+ #include "isolated.h"
2
+
3
+ VALUE rb_mRCEE;
4
+ VALUE rb_mIsolated;
5
+ VALUE rb_cIsolatedExtension;
6
+
7
+ static VALUE
8
+ rb_isolated_extension_class_do_something(VALUE self)
9
+ {
10
+ /* todo: perform CPU-intensive operation */
11
+ return rb_str_new_cstr("something has been done");
12
+ }
13
+
14
+ void
15
+ Init_isolated(void)
16
+ {
17
+ rb_mRCEE = rb_define_module("RCEE");
18
+ rb_mIsolated = rb_define_module_under(rb_mRCEE, "Isolated");
19
+ rb_cIsolatedExtension = rb_define_class_under(rb_mIsolated, "Extension", rb_cObject);
20
+ rb_define_singleton_method(rb_cIsolatedExtension, "do_something",
21
+ rb_isolated_extension_class_do_something, 0);
22
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef ISOLATED_H
2
+ #define ISOLATED_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* ISOLATED_H */
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RCEE
4
+ module Isolated
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "isolated/version"
4
+ require_relative "isolated/isolated"
5
+
6
+ module RCEE
7
+ module Isolated
8
+ class Error < StandardError; end
9
+ # Your code goes here...
10
+ end
11
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rcee/isolated/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rcee_isolated"
7
+ spec.version = RCEE::Isolated::VERSION
8
+ spec.authors = ["Mike Dalessio"]
9
+ spec.email = ["mike.dalessio@gmail.com"]
10
+
11
+ spec.summary = "Example gem demonstrating a basic C extension."
12
+ spec.description = "Part of a project to explain how Ruby C extensions work."
13
+ spec.homepage = "https://github.com/flavorjones/ruby-c-extensions-explained"
14
+ spec.required_ruby_version = ">= 2.4.0"
15
+ spec.license = "MIT"
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+ spec.extensions = ["ext/isolated/extconf.rb"]
26
+
27
+ # Uncomment to register a new dependency of your gem
28
+ # spec.add_dependency "example-gem", "~> 1.0"
29
+
30
+ # For more information and examples about making a new gem, checkout our
31
+ # guide at: https://bundler.io/guides/creating_gem.html
32
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rcee_isolated
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mike Dalessio
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Part of a project to explain how Ruby C extensions work.
14
+ email:
15
+ - mike.dalessio@gmail.com
16
+ executables: []
17
+ extensions:
18
+ - ext/isolated/extconf.rb
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".gitignore"
22
+ - Gemfile
23
+ - README.md
24
+ - Rakefile
25
+ - ext/isolated/extconf.rb
26
+ - ext/isolated/isolated.c
27
+ - ext/isolated/isolated.h
28
+ - lib/rcee/isolated.rb
29
+ - lib/rcee/isolated/version.rb
30
+ - rcee_isolated.gemspec
31
+ homepage: https://github.com/flavorjones/ruby-c-extensions-explained
32
+ licenses:
33
+ - MIT
34
+ metadata: {}
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.4.0
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.2.15
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Example gem demonstrating a basic C extension.
54
+ test_files: []