mkmf-lite 0.5.0 → 0.5.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/{CHANGES.rdoc → CHANGES.md} +23 -15
- data/Gemfile +2 -7
- data/{README.rdoc → README.md} +25 -20
- data/Rakefile +5 -2
- data/lib/mkmf/lite.rb +30 -25
- data/lib/mkmf-lite.rb +2 -0
- data/mkmf-lite.gemspec +11 -9
- data/spec/mkmf_lite_spec.rb +42 -40
- data.tar.gz.sig +0 -0
- metadata +51 -11
- metadata.gz.sig +0 -0
- /data/{MANIFEST.rdoc → MANIFEST.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2bb0ebe67ed8844ab179b66b5818a0affe93ce2d762bca7a43b920161b7dfdb
|
4
|
+
data.tar.gz: 7d972aa186c36a84b613409ebc15c9223a21a2520f9565483976ae8d875bff0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5064c3121ff5d770339e482f0d1a6b42113c2f405ce1265886e122e9754eb58c1152028deb0662bf9c46ed25b8c7204c946cbf6c162346c522cc65431ac301
|
7
|
+
data.tar.gz: 00e32c33cfb6d7125ddb1c66151d1b775693a0705b07bf1e525ba5428574e9b4cca146ea52c02123ff485fb098aac4c919e2b24b69c7913971e4544ba0f4edf5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/{CHANGES.rdoc → CHANGES.md}
RENAMED
@@ -1,43 +1,51 @@
|
|
1
|
-
|
1
|
+
## 0.5.2 - 24-Mar-2022
|
2
|
+
* Lots of rubocop updates and minor cleanup, including the addition of
|
3
|
+
rubocop and rubocop-rspec as deve dependencies.
|
4
|
+
* Deprecation warning fixes (actually bug fixes for Ruby 3.2).
|
5
|
+
|
6
|
+
## 0.5.1 - 18-Dec-2020
|
7
|
+
* Switch docs to markdown format because github isn't rendering rdoc properly.
|
8
|
+
|
9
|
+
## 0.5.0 - 6-Dec-2020
|
2
10
|
* Added the check_valueof method.
|
3
11
|
|
4
|
-
|
12
|
+
## 0.4.2 - 31-Aug-2020
|
5
13
|
* Did I say I didn't need ptools? Well I was wrong. It's back.
|
6
14
|
|
7
|
-
|
15
|
+
## 0.4.1 - 31-Aug-2020
|
8
16
|
* Removed the ptools dependency, just use IO::NULL.
|
9
17
|
|
10
|
-
|
18
|
+
## 0.4.0 - 4-Jul-2020
|
11
19
|
* Replaced test-unit with rspec, rewrote the tests, and made relevant
|
12
20
|
changes to the gemspec, etc.
|
13
21
|
* Pinned the ptools version to 1.3.x.
|
14
22
|
|
15
|
-
|
23
|
+
## 0.3.2 - 19-Mar-2020
|
16
24
|
* Properly include a LICENSE file as per the Apache-2.0 license.
|
17
25
|
|
18
|
-
|
26
|
+
## 0.3.1 - 11-Dec-2019
|
19
27
|
* Added .rdoc extension to various text files so that they render more nicely
|
20
28
|
on github.
|
21
29
|
|
22
|
-
|
30
|
+
## 0.3.0 - 6-Jan-2019
|
23
31
|
* Changed license to Apache-2.0.
|
24
32
|
* Replaced class variables with methods.
|
25
33
|
* Updated cert.
|
26
34
|
|
27
|
-
|
35
|
+
## 0.2.6 - 6-Sep-2015
|
28
36
|
* Added an mkmf-lite.rb file for convenience.
|
29
37
|
* Assume Rubygems 2.x.
|
30
38
|
* This gem is now signed.
|
31
39
|
|
32
|
-
|
40
|
+
## 0.2.5 - 2-Oct-2014
|
33
41
|
* The CC command for mingw now defaults to searching your path rather than
|
34
42
|
relying on an environment variable because it wasn't trustworthy.
|
35
43
|
* Updated the gem:install task for Rubygems 2.x.
|
36
44
|
|
37
|
-
|
45
|
+
## 0.2.4 - 7-Mar-2013
|
38
46
|
* The have_header method now accepts an optional list of directories to search.
|
39
47
|
|
40
|
-
|
48
|
+
## 0.2.3 - 25-Apr-2012
|
41
49
|
* No longer assumes mingw/gcc on Windows. Now passes all tests with a
|
42
50
|
version of Ruby compiled with MSVC++.
|
43
51
|
* Eliminate Config vs RbConfig warnings in 1.9.3.
|
@@ -45,17 +53,17 @@
|
|
45
53
|
result in unwanted output.
|
46
54
|
* Upgraded test-unit prerequisite to 2.4.0 or later.
|
47
55
|
|
48
|
-
|
56
|
+
## 0.2.2 - 6-Dec-2011
|
49
57
|
* Added the check_sizeof method.
|
50
58
|
* If CONFIG['COMMON_HEADERS'] is blank then stdio.h and stdlib.h are
|
51
59
|
used instead. On MS Windows the windows.h header is also used.
|
52
60
|
|
53
|
-
|
61
|
+
## 0.2.1 - 21-Jan-2011
|
54
62
|
* Minor platform detection adjustments for MS Windows.
|
55
63
|
|
56
|
-
|
64
|
+
## 0.2.0 - 8-Jun-2010
|
57
65
|
* Now works properly with JRuby (though it still requires a compiler
|
58
66
|
somewhere on your system).
|
59
67
|
|
60
|
-
|
68
|
+
## 0.1.0 - 24-May-2010
|
61
69
|
* Initial release.
|
data/Gemfile
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,28 +1,33 @@
|
|
1
|
-
|
1
|
+
## Summary
|
2
2
|
A light version of mkmf designed for use within programs.
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
## Installation
|
5
|
+
`gem install mkmf-lite`
|
6
6
|
|
7
|
-
|
7
|
+
## Adding the trusted cert
|
8
|
+
`gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/mkmf-lite/main/certs/djberg96_pub.pem)`
|
9
|
+
|
10
|
+
## Prerequisites
|
8
11
|
A C compiler somewhere on your system.
|
9
12
|
|
10
|
-
|
11
|
-
|
13
|
+
## Synopsis
|
14
|
+
```ruby
|
15
|
+
require 'mkmf/lite'
|
12
16
|
|
13
|
-
|
14
|
-
|
17
|
+
class System
|
18
|
+
extend Mkmf::Lite
|
15
19
|
|
16
|
-
|
20
|
+
HAVE_PW_NAME = have_struct_member('struct passwd', 'pw_name', 'pwd.h')
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
+
def some_method
|
23
|
+
if HAVE_PW_NAME
|
24
|
+
# Do something
|
22
25
|
end
|
23
26
|
end
|
27
|
+
end
|
28
|
+
```
|
24
29
|
|
25
|
-
|
30
|
+
## Description
|
26
31
|
The mkmf library that ships as part of the Ruby standard library is not
|
27
32
|
meant for use as an internal library. It's strictly designed for building
|
28
33
|
C extensions. It's huge, its methods sit in a global namespace, it contains
|
@@ -36,24 +41,24 @@ used in conjunction with FFI. Also, the source code is quite readable.
|
|
36
41
|
It does not package C extensions, nor generate a log file or a Makefile. It
|
37
42
|
does, however, require that you have a C compiler somewhere on your system.
|
38
43
|
|
39
|
-
|
44
|
+
## Known Issues
|
40
45
|
You may see this warning from JRuby 1.4.x and earlier:
|
41
46
|
|
42
47
|
warning: Useless use of a variable in void context.
|
43
48
|
|
44
49
|
You can ignore these (or, upgrade your Jruby).
|
45
50
|
|
46
|
-
|
51
|
+
## License
|
47
52
|
Apache-2.0
|
48
53
|
|
49
|
-
|
54
|
+
## Copyright
|
50
55
|
(C) 2010-2020 Daniel J. Berger
|
51
56
|
All Rights Reserved
|
52
57
|
|
53
|
-
|
58
|
+
## Warranty
|
54
59
|
This library is provided "as is" and without any express or
|
55
60
|
implied warranties, including, without limitation, the implied
|
56
61
|
warranties of merchantability and fitness for a particular purpose.
|
57
62
|
|
58
|
-
|
59
|
-
Daniel Berger
|
63
|
+
## Author
|
64
|
+
Daniel J. Berger
|
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 =
|
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,28 @@
|
|
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'
|
6
8
|
|
9
|
+
# The Mkmf module serves as a namespace only.
|
7
10
|
module Mkmf
|
11
|
+
# The Lite module scopes the Mkmf module to differentiate it from the
|
12
|
+
# Mkmf module in the standard library.
|
8
13
|
module Lite
|
9
14
|
# The version of the mkmf-lite library
|
10
|
-
MKMF_LITE_VERSION = '0.5.
|
15
|
+
MKMF_LITE_VERSION = '0.5.2'
|
11
16
|
|
12
17
|
private
|
13
18
|
|
19
|
+
# rubocop:disable Layout/LineLength
|
14
20
|
def cpp_command
|
15
21
|
command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP'] || File.which('cc') || File.which('gcc') || File.which('cl')
|
16
|
-
raise
|
22
|
+
raise 'Compiler not found' unless command
|
17
23
|
command
|
18
24
|
end
|
25
|
+
# rubocop:enable Layout/LineLength
|
19
26
|
|
20
27
|
def cpp_source_file
|
21
28
|
'conftest.c'
|
@@ -53,7 +60,7 @@ module Mkmf
|
|
53
60
|
if directories.empty?
|
54
61
|
options = nil
|
55
62
|
else
|
56
|
-
options =
|
63
|
+
options = ''
|
57
64
|
directories.each{ |dir| options += "-I#{dir} " }
|
58
65
|
options.rstrip!
|
59
66
|
end
|
@@ -156,9 +163,7 @@ module Mkmf
|
|
156
163
|
end
|
157
164
|
|
158
165
|
headers = headers.flatten.uniq
|
159
|
-
headers
|
160
|
-
|
161
|
-
headers
|
166
|
+
headers.map{ |h| "#include <#{h}>" }.join("\n")
|
162
167
|
end
|
163
168
|
|
164
169
|
# Create a temporary bit of C source code in the temp directory, and
|
@@ -177,11 +182,11 @@ module Mkmf
|
|
177
182
|
stderr_orig = $stderr.dup
|
178
183
|
stdout_orig = $stdout.dup
|
179
184
|
|
180
|
-
Dir.chdir(Dir.tmpdir)
|
181
|
-
File.
|
185
|
+
Dir.chdir(Dir.tmpdir) do
|
186
|
+
File.write(cpp_source_file, code)
|
182
187
|
|
183
|
-
command = cpp_command
|
184
|
-
command += cpp_out_file
|
188
|
+
command = "#{cpp_command} "
|
189
|
+
command += "#{cpp_out_file} "
|
185
190
|
command += cpp_source_file
|
186
191
|
|
187
192
|
# Temporarily close these
|
@@ -191,7 +196,7 @@ module Mkmf
|
|
191
196
|
if system(command)
|
192
197
|
$stdout.reopen(stdout_orig) # We need this back for open3 to work.
|
193
198
|
|
194
|
-
conftest = File::ALT_SEPARATOR ?
|
199
|
+
conftest = File::ALT_SEPARATOR ? 'conftest.exe' : './conftest.exe'
|
195
200
|
|
196
201
|
Open3.popen3(conftest) do |stdin, stdout, stderr|
|
197
202
|
stdin.close
|
@@ -199,12 +204,12 @@ module Mkmf
|
|
199
204
|
result = stdout.gets.chomp.to_i
|
200
205
|
end
|
201
206
|
else
|
202
|
-
raise "Failed to compile source code with command '#{command}':\n===\n
|
207
|
+
raise "Failed to compile source code with command '#{command}':\n===\n#{code}==="
|
203
208
|
end
|
204
|
-
|
209
|
+
end
|
205
210
|
ensure
|
206
|
-
File.delete(cpp_source_file) if File.
|
207
|
-
File.delete(cpp_out_file) if File.
|
211
|
+
File.delete(cpp_source_file) if File.exist?(cpp_source_file)
|
212
|
+
File.delete(cpp_out_file) if File.exist?(cpp_out_file)
|
208
213
|
$stderr.reopen(stderr_orig)
|
209
214
|
$stdout.reopen(stdout_orig)
|
210
215
|
end
|
@@ -219,31 +224,31 @@ module Mkmf
|
|
219
224
|
# Note that $stderr is temporarily redirected to the null device because
|
220
225
|
# we don't actually care about the reason for failure.
|
221
226
|
#
|
222
|
-
def try_to_compile(code, command_options=nil)
|
227
|
+
def try_to_compile(code, command_options = nil)
|
223
228
|
begin
|
224
229
|
boolean = false
|
225
230
|
stderr_orig = $stderr.dup
|
226
231
|
stdout_orig = $stdout.dup
|
227
232
|
|
228
|
-
Dir.chdir(Dir.tmpdir)
|
229
|
-
File.
|
233
|
+
Dir.chdir(Dir.tmpdir) do
|
234
|
+
File.write(cpp_source_file, code)
|
230
235
|
|
231
236
|
if command_options
|
232
|
-
command = cpp_command
|
237
|
+
command = "#{cpp_command} #{command_options} "
|
233
238
|
else
|
234
|
-
command = cpp_command
|
239
|
+
command = "#{cpp_command} "
|
235
240
|
end
|
236
241
|
|
237
|
-
command += cpp_out_file
|
242
|
+
command += "#{cpp_out_file} "
|
238
243
|
command += cpp_source_file
|
239
244
|
|
240
245
|
$stderr.reopen(IO::NULL)
|
241
246
|
$stdout.reopen(IO::NULL)
|
242
247
|
boolean = system(command)
|
243
|
-
|
248
|
+
end
|
244
249
|
ensure
|
245
|
-
File.delete(cpp_source_file) if File.
|
246
|
-
File.delete(cpp_out_file) if File.
|
250
|
+
File.delete(cpp_source_file) if File.exist?(cpp_source_file)
|
251
|
+
File.delete(cpp_out_file) if File.exist?(cpp_out_file)
|
247
252
|
$stdout.reopen(stdout_orig)
|
248
253
|
$stderr.reopen(stderr_orig)
|
249
254
|
end
|
@@ -254,7 +259,7 @@ module Mkmf
|
|
254
259
|
# Slurp the contents of the template file for evaluation later.
|
255
260
|
#
|
256
261
|
def read_template(file)
|
257
|
-
|
262
|
+
File.read(get_template_file(file))
|
258
263
|
end
|
259
264
|
|
260
265
|
# Retrieve the path to the template +file+ name.
|
data/lib/mkmf-lite.rb
CHANGED
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.
|
6
|
+
spec.version = '0.5.2'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.license = 'Apache-2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
@@ -12,18 +12,20 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = ['certs/djberg96_pub.pem']
|
14
14
|
|
15
|
-
spec.extra_rdoc_files = Dir['*.rdoc']
|
16
|
-
|
17
15
|
spec.add_dependency('ptools', '~> 1.4')
|
16
|
+
spec.add_development_dependency('rake')
|
18
17
|
spec.add_development_dependency('rspec', '~> 3.9')
|
18
|
+
spec.add_development_dependency('rubocop')
|
19
|
+
spec.add_development_dependency('rubocop-rspec')
|
19
20
|
|
20
21
|
spec.metadata = {
|
21
|
-
'homepage_uri'
|
22
|
-
'bug_tracker_uri'
|
23
|
-
'changelog_uri'
|
24
|
-
'documentation_uri'
|
25
|
-
'source_code_uri'
|
26
|
-
'wiki_uri'
|
22
|
+
'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
|
23
|
+
'bug_tracker_uri' => 'https://github.com/djberg96/mkmf-lite/issues',
|
24
|
+
'changelog_uri' => 'https://github.com/djberg96/mkmf-lite/blob/main/CHANGES.md',
|
25
|
+
'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
26
|
+
'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
|
27
|
+
'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
28
|
+
'rubygems_mfa_required' => 'true'
|
27
29
|
}
|
28
30
|
|
29
31
|
spec.description = <<-EOF
|
data/spec/mkmf_lite_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
########################################################################
|
2
4
|
# mkmf_lite_spec.rb
|
3
5
|
#
|
@@ -7,7 +9,7 @@ require 'rubygems'
|
|
7
9
|
require 'rspec'
|
8
10
|
require 'mkmf/lite'
|
9
11
|
|
10
|
-
describe Mkmf::Lite do
|
12
|
+
RSpec.describe Mkmf::Lite do
|
11
13
|
subject { Class.new{ |obj| obj.extend Mkmf::Lite } }
|
12
14
|
|
13
15
|
let(:st_type) { 'struct stat' }
|
@@ -15,120 +17,120 @@ describe Mkmf::Lite do
|
|
15
17
|
let(:st_header) { 'sys/stat.h' }
|
16
18
|
let(:constant) { 'EOF' }
|
17
19
|
|
18
|
-
describe
|
19
|
-
example
|
20
|
-
expect(described_class::MKMF_LITE_VERSION).to eq('0.5.
|
20
|
+
describe 'constants' do
|
21
|
+
example 'version information' do
|
22
|
+
expect(described_class::MKMF_LITE_VERSION).to eq('0.5.2')
|
21
23
|
expect(described_class::MKMF_LITE_VERSION).to be_frozen
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
describe
|
26
|
-
example
|
27
|
+
describe 'have_header' do
|
28
|
+
example 'have_header basic functionality' do
|
27
29
|
expect(subject).to respond_to(:have_header)
|
28
30
|
end
|
29
31
|
|
30
|
-
example
|
31
|
-
expect(subject.have_header('stdio.h')).to
|
32
|
-
expect(subject.have_header('foobar.h')).to
|
32
|
+
example 'have_header returns expected boolean value' do
|
33
|
+
expect(subject.have_header('stdio.h')).to be(true)
|
34
|
+
expect(subject.have_header('foobar.h')).to be(false)
|
33
35
|
end
|
34
36
|
|
35
|
-
example
|
37
|
+
example 'have_header accepts an array of directories as a second argument' do
|
36
38
|
expect{ subject.have_header('stdio.h', '/usr/local/include') }.not_to raise_error
|
37
39
|
expect{ subject.have_header('stdio.h', '/usr/local/include', '/usr/include') }.not_to raise_error
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
41
|
-
context
|
42
|
-
example
|
43
|
+
context 'have_func' do
|
44
|
+
example 'have_func basic functionality' do
|
43
45
|
expect(subject).to respond_to(:have_func)
|
44
46
|
end
|
45
47
|
|
46
|
-
example
|
47
|
-
expect(subject.have_func('abort')).to
|
48
|
-
expect(subject.have_func('abortxyz')).to
|
48
|
+
example 'have_func with no arguments returns expected boolean value' do
|
49
|
+
expect(subject.have_func('abort')).to be(true)
|
50
|
+
expect(subject.have_func('abortxyz')).to be(false)
|
49
51
|
end
|
50
52
|
|
51
|
-
example
|
52
|
-
expect(subject.have_func('printf', 'stdio.h')).to
|
53
|
-
expect(subject.have_func('printfx', 'stdio.h')).to
|
53
|
+
example 'have_func with arguments returns expected boolean value' do
|
54
|
+
expect(subject.have_func('printf', 'stdio.h')).to be(true)
|
55
|
+
expect(subject.have_func('printfx', 'stdio.h')).to be(false)
|
54
56
|
end
|
55
57
|
|
56
|
-
example
|
58
|
+
example 'have_func requires at least one argument' do
|
57
59
|
expect{ subject.have_func }.to raise_error(ArgumentError)
|
58
60
|
end
|
59
61
|
|
60
|
-
example
|
62
|
+
example 'have_func accepts a maximum of two arguments' do
|
61
63
|
expect{ subject.have_func('printf', 'stdio.h', 'bogus') }.to raise_error(ArgumentError)
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
65
|
-
context
|
66
|
-
example
|
67
|
+
context 'have_struct_member' do
|
68
|
+
example 'have_struct_member basic functionality' do
|
67
69
|
expect(subject).to respond_to(:have_struct_member)
|
68
70
|
end
|
69
71
|
|
70
|
-
example
|
71
|
-
expect(subject.have_struct_member(st_type, st_member, st_header)).to
|
72
|
-
expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to
|
73
|
-
expect(subject.have_struct_member(st_type, st_member)).to
|
72
|
+
example 'have_struct_member returns expected boolean value' do
|
73
|
+
expect(subject.have_struct_member(st_type, st_member, st_header)).to be(true)
|
74
|
+
expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to be(false)
|
75
|
+
expect(subject.have_struct_member(st_type, st_member)).to be(false)
|
74
76
|
end
|
75
77
|
|
76
|
-
example
|
78
|
+
example 'have_struct_member requires at least two arguments' do
|
77
79
|
expect{ subject.have_struct_member() }.to raise_error(ArgumentError)
|
78
80
|
expect{ subject.have_struct_member('struct passwd') }.to raise_error(ArgumentError)
|
79
81
|
end
|
80
82
|
|
81
|
-
example
|
83
|
+
example 'have_struct_member accepts a maximum of three arguments' do
|
82
84
|
expect{ subject.have_struct_member('struct passwd', 'pw_name', 'pwd.h', true) }.to raise_error(ArgumentError)
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
86
|
-
context
|
87
|
-
example
|
88
|
+
context 'check_valueof' do
|
89
|
+
example 'check_valueof basic functionality' do
|
88
90
|
expect(subject).to respond_to(:check_valueof)
|
89
91
|
expect{ subject.check_sizeof(constant) }.not_to raise_error
|
90
92
|
end
|
91
93
|
|
92
|
-
example
|
94
|
+
example 'check_valueof requires at least one argument' do
|
93
95
|
expect{ subject.check_valueof }.to raise_error(ArgumentError)
|
94
96
|
end
|
95
97
|
|
96
|
-
example
|
98
|
+
example 'check_valueof accepts a maximum of two arguments' do
|
97
99
|
expect{ subject.check_valueof(constant, 'stdio.h', 1) }.to raise_error(ArgumentError)
|
98
100
|
end
|
99
101
|
|
100
|
-
example
|
102
|
+
example 'check_valueof works with one or two arguments' do
|
101
103
|
expect{ subject.check_valueof(constant) }.not_to raise_error
|
102
104
|
expect{ subject.check_valueof(constant, 'stdio.h') }.not_to raise_error
|
103
105
|
end
|
104
106
|
|
105
|
-
example
|
107
|
+
example 'check_valueof returns an integer value' do
|
106
108
|
value = subject.check_valueof(constant)
|
107
109
|
expect(value).to be_kind_of(Integer)
|
108
110
|
expect(value).to eq(-1)
|
109
111
|
end
|
110
112
|
end
|
111
113
|
|
112
|
-
context
|
113
|
-
example
|
114
|
+
context 'check_sizeof' do
|
115
|
+
example 'check_sizeof basic functionality' do
|
114
116
|
expect(subject).to respond_to(:check_sizeof)
|
115
117
|
expect{ subject.check_sizeof(st_type, st_header) }.not_to raise_error
|
116
118
|
end
|
117
119
|
|
118
|
-
example
|
120
|
+
example 'check_sizeof requires at least one argument' do
|
119
121
|
expect{ subject.check_sizeof }.to raise_error(ArgumentError)
|
120
122
|
end
|
121
123
|
|
122
|
-
example
|
124
|
+
example 'check_sizeof accepts a maximum of two arguments' do
|
123
125
|
expect{ subject.check_sizeof('div_t', 'stdlib.h', 1) }.to raise_error(ArgumentError)
|
124
126
|
end
|
125
127
|
|
126
|
-
example
|
128
|
+
example 'check_sizeof works with one or two arguments' do
|
127
129
|
expect{ subject.check_sizeof('div_t') }.not_to raise_error
|
128
130
|
expect{ subject.check_sizeof('div_t', 'stdlib.h') }.not_to raise_error
|
129
131
|
end
|
130
132
|
|
131
|
-
example
|
133
|
+
example 'check_sizeof returns an integer value' do
|
132
134
|
size = subject.check_sizeof(st_type, st_header)
|
133
135
|
expect(size).to be_kind_of(Integer)
|
134
136
|
expect(size).to be > 0
|
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.
|
4
|
+
version: 0.5.2
|
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:
|
38
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ptools
|
@@ -51,6 +51,20 @@ dependencies:
|
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '1.4'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rake
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
54
68
|
- !ruby/object:Gem::Dependency
|
55
69
|
name: rspec
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +79,34 @@ dependencies:
|
|
65
79
|
- - "~>"
|
66
80
|
- !ruby/object:Gem::Version
|
67
81
|
version: '3.9'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rubocop
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rubocop-rspec
|
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'
|
68
110
|
description: |2
|
69
111
|
The mkmf-lite library is a light version of the the mkmf library
|
70
112
|
designed for use as a library. It does not create packages, builds,
|
@@ -74,16 +116,13 @@ description: |2
|
|
74
116
|
email: djberg96@gmail.com
|
75
117
|
executables: []
|
76
118
|
extensions: []
|
77
|
-
extra_rdoc_files:
|
78
|
-
- CHANGES.rdoc
|
79
|
-
- MANIFEST.rdoc
|
80
|
-
- README.rdoc
|
119
|
+
extra_rdoc_files: []
|
81
120
|
files:
|
82
|
-
- CHANGES.
|
121
|
+
- CHANGES.md
|
83
122
|
- Gemfile
|
84
123
|
- LICENSE
|
85
|
-
- MANIFEST.
|
86
|
-
- README.
|
124
|
+
- MANIFEST.md
|
125
|
+
- README.md
|
87
126
|
- Rakefile
|
88
127
|
- certs/djberg96_pub.pem
|
89
128
|
- lib/mkmf-lite.rb
|
@@ -102,10 +141,11 @@ licenses:
|
|
102
141
|
metadata:
|
103
142
|
homepage_uri: https://github.com/djberg96/mkmf-lite
|
104
143
|
bug_tracker_uri: https://github.com/djberg96/mkmf-lite/issues
|
105
|
-
changelog_uri: https://github.com/djberg96/mkmf-lite/blob/
|
144
|
+
changelog_uri: https://github.com/djberg96/mkmf-lite/blob/main/CHANGES.md
|
106
145
|
documentation_uri: https://github.com/djberg96/mkmf-lite/wiki
|
107
146
|
source_code_uri: https://github.com/djberg96/mkmf-lite
|
108
147
|
wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
|
148
|
+
rubygems_mfa_required: 'true'
|
109
149
|
post_install_message:
|
110
150
|
rdoc_options: []
|
111
151
|
require_paths:
|
@@ -121,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
161
|
- !ruby/object:Gem::Version
|
122
162
|
version: '0'
|
123
163
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.4.6
|
125
165
|
signing_key:
|
126
166
|
specification_version: 4
|
127
167
|
summary: A lighter version of mkmf designed for use as a library
|
metadata.gz.sig
CHANGED
Binary file
|
File without changes
|