ilios 0.4.10 → 1.0.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: 1e873b74dbb71ac4a950cf02eed7f2edf1207e8e2aabfd70575643b981af4f6c
4
- data.tar.gz: 8312031b4094cc1a8849ca87530960e8140109a520e08421ed5ef9c21418f3ce
3
+ metadata.gz: 77733851acee687dec34d008c22f855c1e8630952f3989850a6cf99000b2e5ff
4
+ data.tar.gz: 4b2dd035a5212ad4da4d561b5669dd6bd6017e1a667588b01d4156a6353c7621
5
5
  SHA512:
6
- metadata.gz: 86df26c6d95ec57893a84a77e032d3380fb6f6e7f0bda23b59b8e8a8e170bea2a98c2fa1db32c9e7860220a6b3768fec3048c823c8093c23efdc87a16604d4a1
7
- data.tar.gz: 51357dab484bf3ef443db260292c62f9f45cff02a40439d80f1ca580bcf828816bfe38db916a448a350b89b3e78ae5dafaa0ec7e1756b6a92f228070e6dcdfc2
6
+ metadata.gz: ec6a735ad9981a59760daa6b1916acf362e4032ece3c1dd4fcf4fabca80b8ac1cd4137bb0481a2f9955c9852fb99899071c0d199492b232c9370c547ad61f377
7
+ data.tar.gz: 597c69a77e126e358821c65d394ec95e7198b5554498ad25a7bf695f6eb6d4ab4f58bd66bd023a6d8044db398d4d78836cb2385c7b68be3988ba34e4e6716c77
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ ## 1.0.0
4
+
5
+ - Support for
6
+ - Ruby 3.1 or later
7
+ - Cassandra 3.0 or later
8
+ - Used libraries
9
+ - DataStax C/C++ Driver 2.17.1
10
+ - libuv 1.48.0
data/Gemfile CHANGED
@@ -10,5 +10,8 @@ gem 'rake', '~> 13.0'
10
10
  gem 'rake-compiler', '~> 1.2'
11
11
  gem 'rbs', '~> 3.4'
12
12
  gem 'rubocop', '~> 1.57'
13
- gem 'rubocop-minitest', '~> 0.33.0'
13
+ gem 'rubocop-minitest', '~> 0.33'
14
14
  gem 'rubocop-performance', '~> 1.19'
15
+ gem 'rubocop-rake', '~> 0.6'
16
+
17
+ gem 'rubocop-on-rbs', '~> 0.2'
data/README.md CHANGED
@@ -37,10 +37,12 @@ $ gem install ilios -- --with-libuv-dir=/path/to/libuv-installed-dir --with-cass
37
37
  ## Requirements
38
38
 
39
39
  - cmake (in order to build the DataStax C/C++ Driver and libuv)
40
+ - C/C++ compiler
41
+ - install_name_tool (macOS only)
40
42
 
41
43
  ## Supported
42
44
 
43
- - Ruby 3.0 or later
45
+ - Ruby 3.1 or later
44
46
  - Cassandra 3.0 or later
45
47
  - Linux and macOS platform
46
48
 
data/Rakefile CHANGED
@@ -4,7 +4,9 @@ require 'bundler/gem_tasks'
4
4
  require 'rake/extensiontask'
5
5
  require 'rake/testtask'
6
6
 
7
+ desc 'Run tests'
7
8
  task test: :compile
9
+
8
10
  task default: :test
9
11
 
10
12
  Rake::ExtensionTask.new('ilios') do |ext|
data/ext/ilios/extconf.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require File.expand_path('../../lib/ilios/version', __dir__)
4
+ require 'etc'
4
5
  require 'fileutils'
5
6
  require 'mini_portile2'
6
7
  require 'mkmf'
@@ -8,23 +9,19 @@ require 'mkmf'
8
9
  have_func('malloc_usable_size')
9
10
  have_func('malloc_size')
10
11
 
11
- MAX_CORES = 8
12
-
13
- def num_cpu_cores
14
- cores =
15
- begin
16
- if RUBY_PLATFORM.include?('darwin')
17
- Integer(`sysctl -n hw.ncpu`, 10)
18
- else
19
- Integer(`nproc`, 10)
20
- end
21
- rescue StandardError
22
- 2
23
- end
24
-
25
- return 1 if cores <= 0
26
-
27
- cores >= 7 ? MAX_CORES : cores
12
+ def create_compile_flags_txt
13
+ cppflags = $CPPFLAGS.split
14
+ include_flags = cppflags.select { |flag| flag.start_with?('-I') }
15
+ define_flags = cppflags.select { |flag| flag.start_with?('-D') } + $defs
16
+
17
+ File.open('compile_flags.txt', 'w') do |f|
18
+ include_flags.each { |flag| f.puts(flag) }
19
+ f.puts("-I#{Dir.pwd}")
20
+ f.puts("-I#{RbConfig::CONFIG['rubyhdrdir']}")
21
+ f.puts("-I#{RbConfig::CONFIG['rubyhdrdir']}/ruby/backward")
22
+ f.puts("-I#{RbConfig::CONFIG['rubyarchhdrdir']}")
23
+ define_flags.each { |flag| f.puts(flag) }
24
+ end
28
25
  end
29
26
 
30
27
  module LibuvInstaller
@@ -45,7 +42,7 @@ module LibuvInstaller
45
42
 
46
43
  def self.install_from_source
47
44
  unless File.exist?(LIBUV_INSTALL_PATH)
48
- libuv_recipe = LibuvRecipe.new('libuv', Ilios::LIBUV_VERSION, make_command: "make -j #{num_cpu_cores}")
45
+ libuv_recipe = LibuvRecipe.new('libuv', Ilios::LIBUV_VERSION, make_command: "make -j #{Etc.nprocessors}")
49
46
  libuv_recipe.files << {
50
47
  url: "https://github.com/libuv/libuv/archive/v#{Ilios::LIBUV_VERSION}.tar.gz"
51
48
  }
@@ -78,7 +75,7 @@ module CassandraDriverInstaller
78
75
  def initialize(name, version, **kwargs)
79
76
  ENV['LIBUV_ROOT_DIR'] ||= LibuvInstaller.special_install_path
80
77
 
81
- super(name, version, **kwargs)
78
+ super
82
79
  end
83
80
 
84
81
  def configure_prefix
@@ -92,7 +89,7 @@ module CassandraDriverInstaller
92
89
 
93
90
  def self.install_from_source
94
91
  unless File.exist?(CASSANDRA_CPP_DRIVER_INSTALL_PATH)
95
- cassandra_recipe = CassandraRecipe.new('cpp-driver', Ilios::CASSANDRA_CPP_DRIVER_VERSION, make_command: "make -j #{num_cpu_cores}")
92
+ cassandra_recipe = CassandraRecipe.new('cpp-driver', Ilios::CASSANDRA_CPP_DRIVER_VERSION, make_command: "make -j #{Etc.nprocessors}")
96
93
  cassandra_recipe.files << {
97
94
  url: "https://github.com/datastax/cpp-driver/archive/#{Ilios::CASSANDRA_CPP_DRIVER_VERSION}.tar.gz"
98
95
  }
@@ -146,3 +143,4 @@ $CPPFLAGS += " #{ENV['CPPFLAGS']}"
146
143
  $LDFLAGS += " #{ENV['LDFLAGS']}"
147
144
 
148
145
  create_makefile('ilios')
146
+ create_compile_flags_txt
data/ext/ilios/future.c CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "ilios.h"
2
2
 
3
3
  #define THREAD_MAX 5
4
+ #define QUEUE_MAX 100
4
5
 
5
6
  typedef struct
6
7
  {
@@ -31,7 +32,7 @@ const rb_data_type_t cassandra_future_data_type = {
31
32
 
32
33
  static void future_thread_pool_init(future_thread_pool *pool)
33
34
  {
34
- pool->queue = rb_funcall(cQueue, id_new, 0);
35
+ pool->queue = rb_funcall(cSizedQueue, id_new, 1, INT2NUM(QUEUE_MAX));
35
36
  rb_gc_register_mark_object(pool->queue);
36
37
  }
37
38
 
data/ext/ilios/ilios.c CHANGED
@@ -11,7 +11,7 @@ VALUE eConnectError;
11
11
  VALUE eExecutionError;
12
12
  VALUE eStatementError;
13
13
 
14
- VALUE cQueue;
14
+ VALUE cSizedQueue;
15
15
 
16
16
  VALUE id_to_time;
17
17
  VALUE id_new;
@@ -85,7 +85,7 @@ void Init_ilios(void)
85
85
  eExecutionError = rb_define_class_under(mCassandra, "ExecutionError", rb_eStandardError);
86
86
  eStatementError = rb_define_class_under(mCassandra, "StatementError", rb_eStandardError);
87
87
 
88
- cQueue = rb_const_get(rb_cThread, rb_intern("Queue"));
88
+ cSizedQueue = rb_const_get(rb_cThread, rb_intern("SizedQueue"));
89
89
 
90
90
  id_to_time = rb_intern("to_time");
91
91
  id_new = rb_intern("new");
data/ext/ilios/ilios.h CHANGED
@@ -84,7 +84,7 @@ extern VALUE eConnectError;
84
84
  extern VALUE eExecutionError;
85
85
  extern VALUE eStatementError;
86
86
 
87
- extern VALUE cQueue;
87
+ extern VALUE cSizedQueue;
88
88
 
89
89
  extern VALUE id_to_time;
90
90
  extern VALUE id_new;
@@ -170,7 +170,7 @@ static VALUE statement_bind(VALUE self, VALUE hash)
170
170
  }
171
171
 
172
172
  /**
173
- * Sets the statement's page size.
173
+ * Sets the statement's page size. The default is +10000+.
174
174
  *
175
175
  * @param page_size [Integer] A page size.
176
176
  * @return [Cassandra::Statement] self.
data/ilios.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Cassandra driver written by C language'
13
13
  spec.homepage = 'https://github.com/Watson1978/ilios'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = '>= 3.0.0'
15
+ spec.required_ruby_version = '>= 3.1.0'
16
16
 
17
17
  spec.requirements << 'cmake'
18
18
 
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.require_paths = ['lib']
35
35
  spec.extensions << 'ext/ilios/extconf.rb'
36
36
 
37
- spec.add_runtime_dependency('mini_portile2', '~> 2.8')
37
+ spec.add_dependency('mini_portile2', '~> 2.8')
38
38
  end
data/lib/ilios/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ilios
4
- VERSION = '0.4.10'
4
+ VERSION = '1.0.0'
5
5
  public_constant :VERSION
6
6
 
7
7
  CASSANDRA_CPP_DRIVER_VERSION = '2.17.1'
data/sig/ilios.rbs CHANGED
@@ -43,7 +43,7 @@ module Ilios
43
43
  class Statement
44
44
  def bind: (Hash[Symbol | String, untyped]) -> self
45
45
  def page_size=: (Integer) -> self
46
- def idempotent=: (true | false) -> self
46
+ def idempotent=: (bool) -> self
47
47
  end
48
48
 
49
49
  class Future
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ilios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-19 00:00:00.000000000 Z
11
+ date: 2024-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_portile2
@@ -33,6 +33,7 @@ extensions:
33
33
  extra_rdoc_files: []
34
34
  files:
35
35
  - ".yardopts"
36
+ - CHANGELOG.md
36
37
  - Gemfile
37
38
  - LICENSE
38
39
  - README.md
@@ -58,7 +59,7 @@ metadata:
58
59
  homepage_uri: https://github.com/Watson1978/ilios
59
60
  source_code_uri: https://github.com/Watson1978/ilios
60
61
  bug_tracker_uri: https://github.com/Watson1978/ilios/issues
61
- documentation_uri: https://www.rubydoc.info/gems/ilios/0.4.10
62
+ documentation_uri: https://www.rubydoc.info/gems/ilios/1.0.0
62
63
  rubygems_mfa_required: 'true'
63
64
  post_install_message:
64
65
  rdoc_options: []
@@ -68,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
69
  requirements:
69
70
  - - ">="
70
71
  - !ruby/object:Gem::Version
71
- version: 3.0.0
72
+ version: 3.1.0
72
73
  required_rubygems_version: !ruby/object:Gem::Requirement
73
74
  requirements:
74
75
  - - ">="
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  version: '0'
77
78
  requirements:
78
79
  - cmake
79
- rubygems_version: 3.5.3
80
+ rubygems_version: 3.5.9
80
81
  signing_key:
81
82
  specification_version: 4
82
83
  summary: Cassandra driver written by C language