mkmf-lite 0.5.1 → 0.6.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: 7bb580c0250d33fdbd926c5f85c792e13015866a0c4d18e67aa4acf6b16491f9
4
- data.tar.gz: 23d85c79fcb12a6030b812653e78fce81ed7d33fcfe1a4ef4d2200b919e26bfe
3
+ metadata.gz: e9c5878b974662c777fea5c8d6d31df14c3d098168a3cf393f8849cb0e9b4277
4
+ data.tar.gz: 363a30d11f1c788cb8a234b221e8a937f2f2b47d0fb71fcfdfecab5e21a9847b
5
5
  SHA512:
6
- metadata.gz: 73afcb819c629c2d88eb46aa52bdaab5dd43ebdd148259f3b72291490c0ddf311af9525d1dfabeb5d530e23576bb2161074964275689fe6f77193b706a863dd5
7
- data.tar.gz: fa5c1b19b4697cb5481fcac641ae4ae86eb0b3a3b19f623f8336b251f6dd3962f78d96582952f687c1af4522dad0c59824c2adf1aea966da86d94969dc467ffe
6
+ metadata.gz: 96fc5d53b094dae8f3fbe95a0e946e51c304855ff5363961a9d7906b9724321b585f7d69bbce903f861673ced068547fc17bdcd3a56a5c921ef51784b3f6c1d3
7
+ data.tar.gz: fd8e851d41e663ab6fe3419ca8892fae78be63d8260eca88a4856067ed8de17030adf42001c1a9bd0944ffa36186b33bec3e99d0a2d43b896a08cfbd40ac4f8a
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.6.0 - 26-Sep-2023
2
+ * Added the memoist gem and memoized the results of all public methods since
3
+ the odds of them changing between calls is basically zero.
4
+
5
+ ## 0.5.2 - 24-Mar-2023
6
+ * Lots of rubocop updates and minor cleanup, including the addition of
7
+ rubocop and rubocop-rspec as deve dependencies.
8
+ * Deprecation warning fixes (actually bug fixes for Ruby 3.2).
9
+
1
10
  ## 0.5.1 - 18-Dec-2020
2
11
  * Switch docs to markdown format because github isn't rendering rdoc properly.
3
12
 
data/Gemfile CHANGED
@@ -1,7 +1,2 @@
1
- source 'https://rubygems.org' do
2
- gem 'rake'
3
- gem 'ptools', '~> 1.4'
4
- group 'test' do
5
- gem 'rspec', '~> 3.9'
6
- end
7
- end
1
+ source 'https://rubygems.org'
2
+ gemspec
data/README.md CHANGED
@@ -1,14 +1,19 @@
1
+ [![Ruby](https://github.com/djberg96/mkmf-lite/actions/workflows/ruby.yml/badge.svg)](https://github.com/djberg96/mkmf-lite/actions/workflows/ruby.yml)
2
+
1
3
  ## Summary
2
4
  A light version of mkmf designed for use within programs.
3
5
 
4
6
  ## Installation
5
7
  `gem install mkmf-lite`
6
8
 
9
+ ## Adding the trusted cert
10
+ `gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/mkmf-lite/main/certs/djberg96_pub.pem)`
11
+
7
12
  ## Prerequisites
8
13
  A C compiler somewhere on your system.
9
14
 
10
15
  ## Synopsis
11
- ```
16
+ ```ruby
12
17
  require 'mkmf/lite'
13
18
 
14
19
  class System
@@ -38,18 +43,18 @@ used in conjunction with FFI. Also, the source code is quite readable.
38
43
  It does not package C extensions, nor generate a log file or a Makefile. It
39
44
  does, however, require that you have a C compiler somewhere on your system.
40
45
 
41
- ## Known Issues
42
- You may see this warning from JRuby 1.4.x and earlier:
43
-
44
- warning: Useless use of a variable in void context.
46
+ As of version 0.6.0 it memoizes the results of any checks that you make
47
+ since they wouldn't ever change without requiring a reboot/restart of your
48
+ server, container, etc, anyway.
45
49
 
46
- You can ignore these (or, upgrade your Jruby).
50
+ ## Known Issues
51
+ Very old versions of JRuby will emit a warning. You should upgrade.
47
52
 
48
53
  ## License
49
54
  Apache-2.0
50
55
 
51
56
  ## Copyright
52
- (C) 2010-2020 Daniel J. Berger
57
+ (C) 2010-2023 Daniel J. Berger
53
58
  All Rights Reserved
54
59
 
55
60
  ## Warranty
data/Rakefile CHANGED
@@ -1,14 +1,15 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
3
  require 'rspec/core/rake_task'
4
+ require 'rubocop/rake_task'
4
5
 
5
- CLEAN.include("**/*.gem", "**/*.rbc")
6
+ CLEAN.include("**/*.gem", "**/*.rbc", "**/*.lock")
6
7
 
7
8
  namespace 'gem' do
8
9
  desc 'Create the mkmf-lite gem.'
9
10
  task :create => [:clean] do
10
11
  require 'rubygems/package'
11
- spec = eval(IO.read('mkmf-lite.gemspec'))
12
+ spec = Gem::Specification.load('mkmf-lite.gemspec')
12
13
  spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
14
  Gem::Package.build(spec)
14
15
  end
@@ -20,6 +21,8 @@ namespace 'gem' do
20
21
  end
21
22
  end
22
23
 
24
+ RuboCop::RakeTask.new
25
+
23
26
  desc "Run the test suite"
24
27
  RSpec::Core::RakeTask.new(:spec)
25
28
 
data/lib/mkmf/lite.rb CHANGED
@@ -1,21 +1,34 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'erb'
2
4
  require 'rbconfig'
3
5
  require 'tmpdir'
4
6
  require 'open3'
5
7
  require 'ptools'
8
+ require 'fileutils'
9
+ require 'memoist'
6
10
 
11
+ # The Mkmf module serves as a namespace only.
7
12
  module Mkmf
13
+ # The Lite module scopes the Mkmf module to differentiate it from the
14
+ # Mkmf module in the standard library.
8
15
  module Lite
16
+ extend Memoist
17
+
9
18
  # The version of the mkmf-lite library
10
- MKMF_LITE_VERSION = '0.5.1'.freeze
19
+ MKMF_LITE_VERSION = '0.6.0'
11
20
 
12
21
  private
13
22
 
23
+ # rubocop:disable Layout/LineLength
14
24
  def cpp_command
15
25
  command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP'] || File.which('cc') || File.which('gcc') || File.which('cl')
16
- raise "Compiler not found" unless command
26
+ raise 'Compiler not found' unless command
17
27
  command
18
28
  end
29
+ # rubocop:enable Layout/LineLength
30
+
31
+ memoize :cpp_command
19
32
 
20
33
  def cpp_source_file
21
34
  'conftest.c'
@@ -29,6 +42,8 @@ module Mkmf
29
42
  end
30
43
  end
31
44
 
45
+ memoize :cpp_out_file
46
+
32
47
  # TODO: We should adjust this based on OS. For now we're using
33
48
  # arguments I think you'll typically see set on Linux and BSD.
34
49
  def cpp_libraries
@@ -39,6 +54,8 @@ module Mkmf
39
54
  end
40
55
  end
41
56
 
57
+ memoize :cpp_libraries
58
+
42
59
  public
43
60
 
44
61
  # Check for the presence of the given +header+ file. You may optionally
@@ -53,7 +70,7 @@ module Mkmf
53
70
  if directories.empty?
54
71
  options = nil
55
72
  else
56
- options = ""
73
+ options = ''
57
74
  directories.each{ |dir| options += "-I#{dir} " }
58
75
  options.rstrip!
59
76
  end
@@ -61,6 +78,8 @@ module Mkmf
61
78
  try_to_compile(code, options)
62
79
  end
63
80
 
81
+ memoize :have_header
82
+
64
83
  # Check for the presence of the given +function+ in the common header
65
84
  # files, or within any +headers+ that you provide.
66
85
  #
@@ -80,6 +99,8 @@ module Mkmf
80
99
  try_to_compile(ptr_code) || try_to_compile(std_code)
81
100
  end
82
101
 
102
+ memoize :have_func
103
+
83
104
  # Checks whether or not the struct of type +struct_type+ contains the
84
105
  # +struct_member+. If it does not, or the struct type cannot be found,
85
106
  # then false is returned.
@@ -95,6 +116,8 @@ module Mkmf
95
116
  try_to_compile(code)
96
117
  end
97
118
 
119
+ memoize :have_struct_member
120
+
98
121
  # Returns the value of the given +constant+ (which could also be a macro)
99
122
  # using +headers+, or common headers if no headers are specified.
100
123
  #
@@ -109,6 +132,8 @@ module Mkmf
109
132
  try_to_execute(code)
110
133
  end
111
134
 
135
+ memoize :check_valueof
136
+
112
137
  # Returns the sizeof +type+ using +headers+, or common headers if no
113
138
  # headers are specified.
114
139
  #
@@ -130,6 +155,8 @@ module Mkmf
130
155
  try_to_execute(code)
131
156
  end
132
157
 
158
+ memoize :check_sizeof
159
+
133
160
  private
134
161
 
135
162
  # Take an array of header file names (or convert it to an array if it's a
@@ -156,9 +183,7 @@ module Mkmf
156
183
  end
157
184
 
158
185
  headers = headers.flatten.uniq
159
- headers = headers.map{ |h| "#include <#{h}>" }.join("\n")
160
-
161
- headers
186
+ headers.map{ |h| "#include <#{h}>" }.join("\n")
162
187
  end
163
188
 
164
189
  # Create a temporary bit of C source code in the temp directory, and
@@ -177,11 +202,11 @@ module Mkmf
177
202
  stderr_orig = $stderr.dup
178
203
  stdout_orig = $stdout.dup
179
204
 
180
- Dir.chdir(Dir.tmpdir){
181
- File.open(cpp_source_file, 'w'){ |fh| fh.write(code) }
205
+ Dir.chdir(Dir.tmpdir) do
206
+ File.write(cpp_source_file, code)
182
207
 
183
- command = cpp_command + ' '
184
- command += cpp_out_file + ' '
208
+ command = "#{cpp_command} "
209
+ command += "#{cpp_out_file} "
185
210
  command += cpp_source_file
186
211
 
187
212
  # Temporarily close these
@@ -191,7 +216,7 @@ module Mkmf
191
216
  if system(command)
192
217
  $stdout.reopen(stdout_orig) # We need this back for open3 to work.
193
218
 
194
- conftest = File::ALT_SEPARATOR ? "conftest.exe" : "./conftest.exe"
219
+ conftest = File::ALT_SEPARATOR ? 'conftest.exe' : './conftest.exe'
195
220
 
196
221
  Open3.popen3(conftest) do |stdin, stdout, stderr|
197
222
  stdin.close
@@ -199,12 +224,12 @@ module Mkmf
199
224
  result = stdout.gets.chomp.to_i
200
225
  end
201
226
  else
202
- raise "Failed to compile source code with command '#{command}':\n===\n" + code + "==="
227
+ raise "Failed to compile source code with command '#{command}':\n===\n#{code}==="
203
228
  end
204
- }
229
+ end
205
230
  ensure
206
- File.delete(cpp_source_file) if File.exists?(cpp_source_file)
207
- File.delete(cpp_out_file) if File.exists?(cpp_out_file)
231
+ FileUtils.rm_f(cpp_source_file)
232
+ FileUtils.rm_f(cpp_out_file)
208
233
  $stderr.reopen(stderr_orig)
209
234
  $stdout.reopen(stdout_orig)
210
235
  end
@@ -219,31 +244,31 @@ module Mkmf
219
244
  # Note that $stderr is temporarily redirected to the null device because
220
245
  # we don't actually care about the reason for failure.
221
246
  #
222
- def try_to_compile(code, command_options=nil)
247
+ def try_to_compile(code, command_options = nil)
223
248
  begin
224
249
  boolean = false
225
250
  stderr_orig = $stderr.dup
226
251
  stdout_orig = $stdout.dup
227
252
 
228
- Dir.chdir(Dir.tmpdir){
229
- File.open(cpp_source_file, 'w'){ |fh| fh.write(code) }
253
+ Dir.chdir(Dir.tmpdir) do
254
+ File.write(cpp_source_file, code)
230
255
 
231
256
  if command_options
232
- command = cpp_command + ' ' + command_options + ' '
257
+ command = "#{cpp_command} #{command_options} "
233
258
  else
234
- command = cpp_command + ' '
259
+ command = "#{cpp_command} "
235
260
  end
236
261
 
237
- command += cpp_out_file + ' '
262
+ command += "#{cpp_out_file} "
238
263
  command += cpp_source_file
239
264
 
240
265
  $stderr.reopen(IO::NULL)
241
266
  $stdout.reopen(IO::NULL)
242
267
  boolean = system(command)
243
- }
268
+ end
244
269
  ensure
245
- File.delete(cpp_source_file) if File.exists?(cpp_source_file)
246
- File.delete(cpp_out_file) if File.exists?(cpp_out_file)
270
+ FileUtils.rm_f(cpp_source_file)
271
+ FileUtils.rm_f(cpp_out_file)
247
272
  $stdout.reopen(stdout_orig)
248
273
  $stderr.reopen(stderr_orig)
249
274
  end
@@ -254,7 +279,7 @@ module Mkmf
254
279
  # Slurp the contents of the template file for evaluation later.
255
280
  #
256
281
  def read_template(file)
257
- IO.read(get_template_file(file))
282
+ File.read(get_template_file(file))
258
283
  end
259
284
 
260
285
  # Retrieve the path to the template +file+ name.
data/lib/mkmf-lite.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'mkmf/lite'
data/mkmf-lite.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'mkmf-lite'
5
5
  spec.summary = 'A lighter version of mkmf designed for use as a library'
6
- spec.version = '0.5.1'
6
+ spec.version = '0.6.0'
7
7
  spec.author = 'Daniel J. Berger'
8
8
  spec.license = 'Apache-2.0'
9
9
  spec.email = 'djberg96@gmail.com'
@@ -13,15 +13,21 @@ Gem::Specification.new do |spec|
13
13
  spec.cert_chain = ['certs/djberg96_pub.pem']
14
14
 
15
15
  spec.add_dependency('ptools', '~> 1.4')
16
+ spec.add_dependency('memoist', '~> 0.16.2')
17
+
18
+ spec.add_development_dependency('rake')
16
19
  spec.add_development_dependency('rspec', '~> 3.9')
20
+ spec.add_development_dependency('rubocop')
21
+ spec.add_development_dependency('rubocop-rspec')
17
22
 
18
23
  spec.metadata = {
19
- 'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
20
- 'bug_tracker_uri' => 'https://github.com/djberg96/mkmf-lite/issues',
21
- 'changelog_uri' => 'https://github.com/djberg96/mkmf-lite/blob/master/CHANGES.rdoc',
22
- 'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
23
- 'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
24
- 'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki'
24
+ 'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
25
+ 'bug_tracker_uri' => 'https://github.com/djberg96/mkmf-lite/issues',
26
+ 'changelog_uri' => 'https://github.com/djberg96/mkmf-lite/blob/main/CHANGES.md',
27
+ 'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
28
+ 'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
29
+ 'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
30
+ 'rubygems_mfa_required' => 'true'
25
31
  }
26
32
 
27
33
  spec.description = <<-EOF
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ########################################################################
2
4
  # mkmf_lite_spec.rb
3
5
  #
@@ -6,8 +8,9 @@
6
8
  require 'rubygems'
7
9
  require 'rspec'
8
10
  require 'mkmf/lite'
11
+ require 'fileutils'
9
12
 
10
- describe Mkmf::Lite do
13
+ RSpec.describe Mkmf::Lite do
11
14
  subject { Class.new{ |obj| obj.extend Mkmf::Lite } }
12
15
 
13
16
  let(:st_type) { 'struct stat' }
@@ -15,122 +18,122 @@ describe Mkmf::Lite do
15
18
  let(:st_header) { 'sys/stat.h' }
16
19
  let(:constant) { 'EOF' }
17
20
 
18
- describe "constants" do
19
- example "version information" do
20
- expect(described_class::MKMF_LITE_VERSION).to eq('0.5.1')
21
+ describe 'constants' do
22
+ example 'version information' do
23
+ expect(described_class::MKMF_LITE_VERSION).to eq('0.6.0')
21
24
  expect(described_class::MKMF_LITE_VERSION).to be_frozen
22
25
  end
23
26
  end
24
27
 
25
- describe "have_header" do
26
- example "have_header basic functionality" do
28
+ describe 'have_header' do
29
+ example 'have_header basic functionality' do
27
30
  expect(subject).to respond_to(:have_header)
28
31
  end
29
32
 
30
- example "have_header returns expected boolean value" do
31
- expect(subject.have_header('stdio.h')).to eq(true)
32
- expect(subject.have_header('foobar.h')).to eq(false)
33
+ example 'have_header returns expected boolean value' do
34
+ expect(subject.have_header('stdio.h')).to be(true)
35
+ expect(subject.have_header('foobar.h')).to be(false)
33
36
  end
34
37
 
35
- example "have_header accepts an array of directories as a second argument" do
38
+ example 'have_header accepts an array of directories as a second argument' do
36
39
  expect{ subject.have_header('stdio.h', '/usr/local/include') }.not_to raise_error
37
40
  expect{ subject.have_header('stdio.h', '/usr/local/include', '/usr/include') }.not_to raise_error
38
41
  end
39
42
  end
40
43
 
41
- context "have_func" do
42
- example "have_func basic functionality" do
44
+ context 'have_func' do
45
+ example 'have_func basic functionality' do
43
46
  expect(subject).to respond_to(:have_func)
44
47
  end
45
48
 
46
- example "have_func with no arguments returns expected boolean value" do
47
- expect(subject.have_func('abort')).to eq(true)
48
- expect(subject.have_func('abortxyz')).to eq(false)
49
+ example 'have_func with no arguments returns expected boolean value' do
50
+ expect(subject.have_func('abort')).to be(true)
51
+ expect(subject.have_func('abortxyz')).to be(false)
49
52
  end
50
53
 
51
- example "have_func with arguments returns expected boolean value" do
52
- expect(subject.have_func('printf', 'stdio.h')).to eq(true)
53
- expect(subject.have_func('printfx', 'stdio.h')).to eq(false)
54
+ example 'have_func with arguments returns expected boolean value' do
55
+ expect(subject.have_func('printf', 'stdio.h')).to be(true)
56
+ expect(subject.have_func('printfx', 'stdio.h')).to be(false)
54
57
  end
55
58
 
56
- example "have_func requires at least one argument" do
59
+ example 'have_func requires at least one argument' do
57
60
  expect{ subject.have_func }.to raise_error(ArgumentError)
58
61
  end
59
62
 
60
- example "have_func accepts a maximum of two arguments" do
63
+ example 'have_func accepts a maximum of two arguments' do
61
64
  expect{ subject.have_func('printf', 'stdio.h', 'bogus') }.to raise_error(ArgumentError)
62
65
  end
63
66
  end
64
67
 
65
- context "have_struct_member" do
66
- example "have_struct_member basic functionality" do
68
+ context 'have_struct_member' do
69
+ example 'have_struct_member basic functionality' do
67
70
  expect(subject).to respond_to(:have_struct_member)
68
71
  end
69
72
 
70
- example "have_struct_member returns expected boolean value" do
71
- expect(subject.have_struct_member(st_type, st_member, st_header)).to eq(true)
72
- expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to eq(false)
73
- expect(subject.have_struct_member(st_type, st_member)).to eq(false)
73
+ example 'have_struct_member returns expected boolean value' do
74
+ expect(subject.have_struct_member(st_type, st_member, st_header)).to be(true)
75
+ expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to be(false)
76
+ expect(subject.have_struct_member(st_type, st_member)).to be(false)
74
77
  end
75
78
 
76
- example "have_struct_member requires at least two arguments" do
79
+ example 'have_struct_member requires at least two arguments' do
77
80
  expect{ subject.have_struct_member() }.to raise_error(ArgumentError)
78
81
  expect{ subject.have_struct_member('struct passwd') }.to raise_error(ArgumentError)
79
82
  end
80
83
 
81
- example "have_struct_member accepts a maximum of three arguments" do
82
- expect{ subject.have_struct_member('struct passwd', 'pw_name', 'pwd.h', true) }.to raise_error(ArgumentError)
84
+ example 'have_struct_member accepts a maximum of three arguments' do
85
+ expect{ subject.have_struct_member('struct passwd', 'pw_name', 'pwd.h', 1) }.to raise_error(ArgumentError)
83
86
  end
84
87
  end
85
88
 
86
- context "check_valueof" do
87
- example "check_valueof basic functionality" do
89
+ context 'check_valueof' do
90
+ example 'check_valueof basic functionality' do
88
91
  expect(subject).to respond_to(:check_valueof)
89
92
  expect{ subject.check_sizeof(constant) }.not_to raise_error
90
93
  end
91
94
 
92
- example "check_valueof requires at least one argument" do
95
+ example 'check_valueof requires at least one argument' do
93
96
  expect{ subject.check_valueof }.to raise_error(ArgumentError)
94
97
  end
95
98
 
96
- example "check_valueof accepts a maximum of two arguments" do
99
+ example 'check_valueof accepts a maximum of two arguments' do
97
100
  expect{ subject.check_valueof(constant, 'stdio.h', 1) }.to raise_error(ArgumentError)
98
101
  end
99
102
 
100
- example "check_valueof works with one or two arguments" do
103
+ example 'check_valueof works with one or two arguments' do
101
104
  expect{ subject.check_valueof(constant) }.not_to raise_error
102
105
  expect{ subject.check_valueof(constant, 'stdio.h') }.not_to raise_error
103
106
  end
104
107
 
105
- example "check_valueof returns an integer value" do
108
+ example 'check_valueof returns an integer value' do
106
109
  value = subject.check_valueof(constant)
107
- expect(value).to be_kind_of(Integer)
110
+ expect(value).to be_a(Integer)
108
111
  expect(value).to eq(-1)
109
112
  end
110
113
  end
111
114
 
112
- context "check_sizeof" do
113
- example "check_sizeof basic functionality" do
115
+ context 'check_sizeof' do
116
+ example 'check_sizeof basic functionality' do
114
117
  expect(subject).to respond_to(:check_sizeof)
115
118
  expect{ subject.check_sizeof(st_type, st_header) }.not_to raise_error
116
119
  end
117
120
 
118
- example "check_sizeof requires at least one argument" do
121
+ example 'check_sizeof requires at least one argument' do
119
122
  expect{ subject.check_sizeof }.to raise_error(ArgumentError)
120
123
  end
121
124
 
122
- example "check_sizeof accepts a maximum of two arguments" do
125
+ example 'check_sizeof accepts a maximum of two arguments' do
123
126
  expect{ subject.check_sizeof('div_t', 'stdlib.h', 1) }.to raise_error(ArgumentError)
124
127
  end
125
128
 
126
- example "check_sizeof works with one or two arguments" do
129
+ example 'check_sizeof works with one or two arguments' do
127
130
  expect{ subject.check_sizeof('div_t') }.not_to raise_error
128
131
  expect{ subject.check_sizeof('div_t', 'stdlib.h') }.not_to raise_error
129
132
  end
130
133
 
131
- example "check_sizeof returns an integer value" do
134
+ example 'check_sizeof returns an integer value' do
132
135
  size = subject.check_sizeof(st_type, st_header)
133
- expect(size).to be_kind_of(Integer)
136
+ expect(size).to be_a(Integer)
134
137
  expect(size).to be > 0
135
138
  end
136
139
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmf-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2020-12-18 00:00:00.000000000 Z
38
+ date: 2023-09-26 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ptools
@@ -51,6 +51,34 @@ dependencies:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.4'
54
+ - !ruby/object:Gem::Dependency
55
+ name: memoist
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.16.2
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.16.2
68
+ - !ruby/object:Gem::Dependency
69
+ name: rake
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
54
82
  - !ruby/object:Gem::Dependency
55
83
  name: rspec
56
84
  requirement: !ruby/object:Gem::Requirement
@@ -65,6 +93,34 @@ dependencies:
65
93
  - - "~>"
66
94
  - !ruby/object:Gem::Version
67
95
  version: '3.9'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rubocop
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rubocop-rspec
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
68
124
  description: |2
69
125
  The mkmf-lite library is a light version of the the mkmf library
70
126
  designed for use as a library. It does not create packages, builds,
@@ -99,10 +155,11 @@ licenses:
99
155
  metadata:
100
156
  homepage_uri: https://github.com/djberg96/mkmf-lite
101
157
  bug_tracker_uri: https://github.com/djberg96/mkmf-lite/issues
102
- changelog_uri: https://github.com/djberg96/mkmf-lite/blob/master/CHANGES.rdoc
158
+ changelog_uri: https://github.com/djberg96/mkmf-lite/blob/main/CHANGES.md
103
159
  documentation_uri: https://github.com/djberg96/mkmf-lite/wiki
104
160
  source_code_uri: https://github.com/djberg96/mkmf-lite
105
161
  wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
162
+ rubygems_mfa_required: 'true'
106
163
  post_install_message:
107
164
  rdoc_options: []
108
165
  require_paths:
@@ -118,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
175
  - !ruby/object:Gem::Version
119
176
  version: '0'
120
177
  requirements: []
121
- rubygems_version: 3.0.3
178
+ rubygems_version: 3.3.26
122
179
  signing_key:
123
180
  specification_version: 4
124
181
  summary: A lighter version of mkmf designed for use as a library
metadata.gz.sig CHANGED
Binary file