mkmf-lite 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES.rdoc +5 -0
- data/MANIFEST.rdoc +1 -2
- data/README.rdoc +1 -1
- data/Rakefile +4 -6
- data/lib/mkmf/lite.rb +1 -1
- data/mkmf-lite.gemspec +4 -4
- data/spec/mkmf_lite_spec.rb +111 -0
- metadata +14 -14
- metadata.gz.sig +0 -0
- data/test/test_mkmf_lite.rb +0 -119
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b31149c447c19e46fb23c75314391a1ce130d13d3682a6c27c908f65b4ebf4c
|
4
|
+
data.tar.gz: 46e3d7df97248fe7e57f371b75ba3ecff658e1410d598c501d091f8cd8982117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3421a088bf652b63d4ba22ab5ba488488527641dd3a2e37173373c6c182ded5bbb2a79f83e98719e0a09d6fb40db1180a4c41639130ef1c28a67159dc0dfa5f7
|
7
|
+
data.tar.gz: ceec89082d0e5a2e40347855d3934f425004a38753d0e9920e0ca98af50e39980c892aa0489e10524c48438dba40a5cec4d5fe070a16c245d2aad9528c737fe7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES.rdoc
CHANGED
data/MANIFEST.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
* CHANGES.rdoc
|
2
2
|
* LICENSE
|
3
3
|
* MANIFEST.rdoc
|
4
|
-
* README.rdoc
|
5
4
|
* Rakefile
|
6
5
|
* mkmf-lite.gemspec
|
7
6
|
* certs/djberg96_pub.pem
|
@@ -10,4 +9,4 @@
|
|
10
9
|
* lib/mkmf/templates/have_func_pointer.erb
|
11
10
|
* lib/mkmf/templates/have_header.erb
|
12
11
|
* lib/mkmf/templates/have_struct_member.erb
|
13
|
-
*
|
12
|
+
* spec/mkmf_lite_spec.rb
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/clean'
|
3
|
-
require '
|
3
|
+
require 'rspec/core/rake_task'
|
4
4
|
|
5
5
|
CLEAN.include("**/*.gem", "**/*.rbc")
|
6
6
|
|
@@ -20,9 +20,7 @@ namespace 'gem' do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
t.warning = true
|
26
|
-
end
|
23
|
+
desc "Run the test suite"
|
24
|
+
RSpec::Core::RakeTask.new(:spec)
|
27
25
|
|
28
|
-
task :default => :
|
26
|
+
task :default => :spec
|
data/lib/mkmf/lite.rb
CHANGED
data/mkmf-lite.gemspec
CHANGED
@@ -3,19 +3,19 @@ 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.
|
6
|
+
spec.version = '0.4.0'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.license = 'Apache-2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
10
10
|
spec.homepage = 'http://github.com/djberg96/mkmf-lite'
|
11
|
-
spec.test_file = '
|
11
|
+
spec.test_file = 'spec/mkmf_lite_spec.rb'
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = ['certs/djberg96_pub.pem']
|
14
14
|
|
15
15
|
spec.extra_rdoc_files = Dir['*.rdoc']
|
16
16
|
|
17
|
-
spec.add_dependency('ptools')
|
18
|
-
spec.add_development_dependency('
|
17
|
+
spec.add_dependency('ptools', '~> 1.3')
|
18
|
+
spec.add_development_dependency('rspec', '~> 3.9')
|
19
19
|
|
20
20
|
spec.metadata = {
|
21
21
|
'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
|
@@ -0,0 +1,111 @@
|
|
1
|
+
########################################################################
|
2
|
+
# mkmf_lite_spec.rb
|
3
|
+
#
|
4
|
+
# Tests for the mkmf-lite library.
|
5
|
+
########################################################################
|
6
|
+
require 'rubygems'
|
7
|
+
require 'rspec'
|
8
|
+
require 'mkmf/lite'
|
9
|
+
|
10
|
+
describe Mkmf::Lite do
|
11
|
+
subject { Class.new{ |obj| obj.extend Mkmf::Lite } }
|
12
|
+
|
13
|
+
let(:st_type) { 'struct stat' }
|
14
|
+
let(:st_member) { 'st_uid' }
|
15
|
+
let(:st_header) { 'sys/stat.h' }
|
16
|
+
|
17
|
+
describe "constants" do
|
18
|
+
example "version information" do
|
19
|
+
expect(described_class::MKMF_LITE_VERSION).to eq('0.4.0')
|
20
|
+
expect(described_class::MKMF_LITE_VERSION).to be_frozen
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "have_header" do
|
25
|
+
example "have_header basic functionality" do
|
26
|
+
expect(subject).to respond_to(:have_header)
|
27
|
+
end
|
28
|
+
|
29
|
+
example "have_header returns expected boolean value" do
|
30
|
+
expect(subject.have_header('stdio.h')).to eq(true)
|
31
|
+
expect(subject.have_header('foobar.h')).to eq(false)
|
32
|
+
end
|
33
|
+
|
34
|
+
example "have_header accepts an array of directories as a second argument" do
|
35
|
+
expect{ subject.have_header('stdio.h', '/usr/local/include') }.not_to raise_error
|
36
|
+
expect{ subject.have_header('stdio.h', '/usr/local/include', '/usr/include') }.not_to raise_error
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "have_func" do
|
41
|
+
example "have_func basic functionality" do
|
42
|
+
expect(subject).to respond_to(:have_func)
|
43
|
+
end
|
44
|
+
|
45
|
+
example "have_func with no arguments returns expected boolean value" do
|
46
|
+
expect(subject.have_func('abort')).to eq(true)
|
47
|
+
expect(subject.have_func('abortxyz')).to eq(false)
|
48
|
+
end
|
49
|
+
|
50
|
+
example "have_func with arguments returns expected boolean value" do
|
51
|
+
expect(subject.have_func('printf', 'stdio.h')).to eq(true)
|
52
|
+
expect(subject.have_func('printfx', 'stdio.h')).to eq(false)
|
53
|
+
end
|
54
|
+
|
55
|
+
example "have_func requires at least one argument" do
|
56
|
+
expect{ subject.have_func }.to raise_error(ArgumentError)
|
57
|
+
end
|
58
|
+
|
59
|
+
example "have_func accepts a maximum of two arguments" do
|
60
|
+
expect{ subject.have_func('printf', 'stdio.h', 'bogus') }.to raise_error(ArgumentError)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "have_struct_member" do
|
65
|
+
example "have_struct_member basic functionality" do
|
66
|
+
expect(subject).to respond_to(:have_struct_member)
|
67
|
+
end
|
68
|
+
|
69
|
+
example "have_struct_member returns expected boolean value" do
|
70
|
+
expect(subject.have_struct_member(st_type, st_member, st_header)).to eq(true)
|
71
|
+
expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to eq(false)
|
72
|
+
expect(subject.have_struct_member(st_type, st_member)).to eq(false)
|
73
|
+
end
|
74
|
+
|
75
|
+
example "have_struct_member requires at least two arguments" do
|
76
|
+
expect{ subject.have_struct_member() }.to raise_error(ArgumentError)
|
77
|
+
expect{ subject.have_struct_member('struct passwd') }.to raise_error(ArgumentError)
|
78
|
+
end
|
79
|
+
|
80
|
+
example "have_struct_member accepts a maximum of three arguments" do
|
81
|
+
expect{ subject.have_struct_member('struct passwd', 'pw_name', 'pwd.h', true) }.to raise_error(ArgumentError)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context "check_sizeof" do
|
86
|
+
example "check_sizeof basic functionality" do
|
87
|
+
expect(subject).to respond_to(:check_sizeof)
|
88
|
+
expect{ subject.check_sizeof(st_type, st_header) }.not_to raise_error
|
89
|
+
end
|
90
|
+
|
91
|
+
example "check_sizeof requires at least one argument" do
|
92
|
+
expect{ subject.check_sizeof }.to raise_error(ArgumentError)
|
93
|
+
expect{ subject.check_sizeof('struct passwd', 'pw_name', 1) }.to raise_error(ArgumentError)
|
94
|
+
end
|
95
|
+
|
96
|
+
example "check_sizeof accepts a maximum of two arguments" do
|
97
|
+
expect{ subject.check_sizeof('div_t', 'stdlib.h', 1) }.to raise_error(ArgumentError)
|
98
|
+
end
|
99
|
+
|
100
|
+
example "check_sizeof works with one or two arguments" do
|
101
|
+
expect{ subject.check_sizeof('div_t') }.not_to raise_error
|
102
|
+
expect{ subject.check_sizeof('div_t', 'stdlib.h') }.not_to raise_error
|
103
|
+
end
|
104
|
+
|
105
|
+
example "check_sizeof returns an integer value" do
|
106
|
+
size = subject.check_sizeof(st_type, st_header)
|
107
|
+
expect(size).to be_kind_of(Integer)
|
108
|
+
expect(size).to be > 0
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -35,36 +35,36 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-
|
38
|
+
date: 2020-07-05 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ptools
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - "
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '1.3'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '1.3'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: rspec
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '3.9'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: '3.9'
|
68
68
|
description: |2
|
69
69
|
The mkmf-lite library is a light version of the the mkmf library
|
70
70
|
designed for use as a library. It does not create packages, builds,
|
@@ -75,9 +75,9 @@ email: djberg96@gmail.com
|
|
75
75
|
executables: []
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files:
|
78
|
+
- README.rdoc
|
78
79
|
- CHANGES.rdoc
|
79
80
|
- MANIFEST.rdoc
|
80
|
-
- README.rdoc
|
81
81
|
files:
|
82
82
|
- CHANGES.rdoc
|
83
83
|
- LICENSE
|
@@ -93,7 +93,7 @@ files:
|
|
93
93
|
- lib/mkmf/templates/have_header.erb
|
94
94
|
- lib/mkmf/templates/have_struct_member.erb
|
95
95
|
- mkmf-lite.gemspec
|
96
|
-
-
|
96
|
+
- spec/mkmf_lite_spec.rb
|
97
97
|
homepage: http://github.com/djberg96/mkmf-lite
|
98
98
|
licenses:
|
99
99
|
- Apache-2.0
|
@@ -124,4 +124,4 @@ signing_key:
|
|
124
124
|
specification_version: 4
|
125
125
|
summary: A lighter version of mkmf designed for use as a library
|
126
126
|
test_files:
|
127
|
-
-
|
127
|
+
- spec/mkmf_lite_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/test/test_mkmf_lite.rb
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
########################################################################
|
2
|
-
# test_mkmf_lite.rb
|
3
|
-
#
|
4
|
-
# Tests for the mkmf-lite library.
|
5
|
-
########################################################################
|
6
|
-
require 'rubygems'
|
7
|
-
require 'test-unit'
|
8
|
-
require 'mkmf/lite'
|
9
|
-
|
10
|
-
class TC_Mkmf_Lite < Test::Unit::TestCase
|
11
|
-
include Mkmf::Lite
|
12
|
-
|
13
|
-
def self.startup
|
14
|
-
@@windows = File::ALT_SEPARATOR
|
15
|
-
end
|
16
|
-
|
17
|
-
def setup
|
18
|
-
@st_type = 'struct stat'
|
19
|
-
@st_member = 'st_uid'
|
20
|
-
@st_header = 'sys/stat.h'
|
21
|
-
end
|
22
|
-
|
23
|
-
test "version information" do
|
24
|
-
assert_equal('0.3.2', MKMF_LITE_VERSION)
|
25
|
-
assert_true(MKMF_LITE_VERSION.frozen?)
|
26
|
-
end
|
27
|
-
|
28
|
-
test "have_header basic functionality" do
|
29
|
-
assert_respond_to(self, :have_header)
|
30
|
-
end
|
31
|
-
|
32
|
-
test "have_header returns expected boolean value" do
|
33
|
-
assert_true(have_header('stdio.h'))
|
34
|
-
assert_false(have_header('foobar.h'))
|
35
|
-
end
|
36
|
-
|
37
|
-
test "have_header accepts an array of directories as a second argument" do
|
38
|
-
assert_nothing_raised{ have_header('stdio.h', '/usr/local/include') }
|
39
|
-
assert_nothing_raised{ have_header('stdio.h', '/usr/local/include', '/usr/include') }
|
40
|
-
end
|
41
|
-
|
42
|
-
test "have_func basic functionality" do
|
43
|
-
assert_respond_to(self, :have_func)
|
44
|
-
end
|
45
|
-
|
46
|
-
test "have_func with no arguments returns expected boolean value" do
|
47
|
-
assert_true(have_func('abort'))
|
48
|
-
assert_false(have_func('abortxyz'))
|
49
|
-
end
|
50
|
-
|
51
|
-
test "have_func with arguments returns expected boolean value" do
|
52
|
-
assert_true(have_func('printf', 'stdio.h'))
|
53
|
-
assert_false(have_func('printfx', 'stdio.h'))
|
54
|
-
end
|
55
|
-
|
56
|
-
test "have_func requires at least one argument" do
|
57
|
-
assert_raise(ArgumentError){ have_func }
|
58
|
-
end
|
59
|
-
|
60
|
-
test "have_func accepts a maximum of two arguments" do
|
61
|
-
assert_raise(ArgumentError){ have_func('printf', 'stdio.h', 'bogus') }
|
62
|
-
end
|
63
|
-
|
64
|
-
test "have_struct_member basic functionality" do
|
65
|
-
assert_respond_to(self, :have_struct_member)
|
66
|
-
end
|
67
|
-
|
68
|
-
test "have_struct_member returns expected boolean value" do
|
69
|
-
assert_true(have_struct_member(@st_type, @st_member, @st_header))
|
70
|
-
assert_false(have_struct_member(@st_type, 'pw_bogus', @st_header))
|
71
|
-
assert_false(have_struct_member(@st_type, @st_member))
|
72
|
-
end
|
73
|
-
|
74
|
-
test "have_struct_member requires at least two arguments" do
|
75
|
-
assert_raise(ArgumentError){ have_struct_member() }
|
76
|
-
assert_raise(ArgumentError){ have_struct_member('struct passwd') }
|
77
|
-
end
|
78
|
-
|
79
|
-
test "have_struct_member accepts a maximum of three arguments" do
|
80
|
-
assert_raise(ArgumentError){
|
81
|
-
have_struct_member('struct passwd', 'pw_name', 'pwd.h', true)
|
82
|
-
}
|
83
|
-
end
|
84
|
-
|
85
|
-
test "check_sizeof basic functionality" do
|
86
|
-
assert_respond_to(self, :check_sizeof)
|
87
|
-
assert_nothing_raised{ check_sizeof(@st_type, @st_header) }
|
88
|
-
end
|
89
|
-
|
90
|
-
test "check_sizeof requires at least one argument" do
|
91
|
-
assert_raise(ArgumentError){ check_sizeof }
|
92
|
-
assert_raise(ArgumentError){ check_sizeof('struct passwd', 'pw_name', 1) }
|
93
|
-
end
|
94
|
-
|
95
|
-
test "check_sizeof accepts a maximum of two arguments" do
|
96
|
-
assert_raise(ArgumentError){ check_sizeof('div_t', 'stdlib.h', 1) }
|
97
|
-
end
|
98
|
-
|
99
|
-
test "check_sizeof works with one or two arguments" do
|
100
|
-
assert_nothing_raised{ check_sizeof('div_t') }
|
101
|
-
assert_nothing_raised{ check_sizeof('div_t', 'stdlib.h') }
|
102
|
-
end
|
103
|
-
|
104
|
-
test "check_sizeof returns an integer value" do
|
105
|
-
size = check_sizeof(@st_type, @st_header)
|
106
|
-
assert_kind_of(Integer, size)
|
107
|
-
assert_true(size > 0)
|
108
|
-
end
|
109
|
-
|
110
|
-
def teardown
|
111
|
-
@st_type = nil
|
112
|
-
@st_member = nil
|
113
|
-
@st_header = nil
|
114
|
-
end
|
115
|
-
|
116
|
-
def self.shutdown
|
117
|
-
@@windows = nil
|
118
|
-
end
|
119
|
-
end
|