mkmf-lite 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c947061b06ef0a542f1dfdb1658b1d13fadf607dfbb56e6483447e25949641ea
4
- data.tar.gz: 1691ad33a45b080a430656cdfef9a714370fcd19915ec9a1607107c10529352b
3
+ metadata.gz: 88d355dec9e35c8aeb5f4a8b4d4dd7a9fbcb5cd9b1e0c8bb834c145614da101a
4
+ data.tar.gz: c17345e5ad9278f73c30cd7ed8b9f71541eae5bd86626de21136dade61948e50
5
5
  SHA512:
6
- metadata.gz: 95cd4d638127ed7d7868a70fba690d103be76ba5b5a24461c214d8b78077cc27f5994709a52c6fc9d52b6d7e72c6e2cdd8989075803bd10db1f4081b2ea20f1a
7
- data.tar.gz: 62f6b553d0d8891b5d4adcccc5333e4fc1385dbab58ca704a71bfc24d9c5ed59d637030605ca5a3dd3c65c62005e805b2190b53d7d2c1adb4cef4f05346c0733
6
+ metadata.gz: 66a36e2889bc69802560be194ee77d5f4bde94302efa7f3db16ee60b335ddc7aa6a401ecc9b3486de803f1247b53868baea5b018192ab06211d1f232858d332d
7
+ data.tar.gz: 0e11e957998ef6870ce0dcfb2ac3440822311cb05912630f3559a1cbe70844fca48e89594d492f694fffc82def4b74e8afe645cfa6b131181da3996d955773bf
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,20 @@
1
+ == 0.5.0 - 6-Dec-2020
2
+ * Added the check_valueof method.
3
+
4
+ == 0.4.2 - 31-Aug-2020
5
+ * Did I say I didn't need ptools? Well I was wrong. It's back.
6
+
7
+ == 0.4.1 - 31-Aug-2020
8
+ * Removed the ptools dependency, just use IO::NULL.
9
+
10
+ == 0.4.0 - 4-Jul-2020
11
+ * Replaced test-unit with rspec, rewrote the tests, and made relevant
12
+ changes to the gemspec, etc.
13
+ * Pinned the ptools version to 1.3.x.
14
+
15
+ == 0.3.2 - 19-Mar-2020
16
+ * Properly include a LICENSE file as per the Apache-2.0 license.
17
+
1
18
  == 0.3.1 - 11-Dec-2019
2
19
  * Added .rdoc extension to various text files so that they render more nicely
3
20
  on github.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
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
data/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -1,12 +1,14 @@
1
1
  * CHANGES.rdoc
2
+ * LICENSE
2
3
  * MANIFEST.rdoc
3
- * README.rdoc
4
4
  * Rakefile
5
5
  * mkmf-lite.gemspec
6
6
  * certs/djberg96_pub.pem
7
7
  * lib/mkmf/lite.rb
8
+ * lib/mkmf/templates/check_sizeof.erb
9
+ * lib/mkmf/templates/check_valueof.erb
8
10
  * lib/mkmf/templates/have_func.erb
9
11
  * lib/mkmf/templates/have_func_pointer.erb
10
12
  * lib/mkmf/templates/have_header.erb
11
13
  * lib/mkmf/templates/have_struct_member.erb
12
- * test/test_mkmf_lite.rb
14
+ * spec/mkmf_lite_spec.rb
@@ -47,7 +47,7 @@ You can ignore these (or, upgrade your Jruby).
47
47
  Apache-2.0
48
48
 
49
49
  == Copyright
50
- (C) 2010-2019 Daniel J. Berger
50
+ (C) 2010-2020 Daniel J. Berger
51
51
  All Rights Reserved
52
52
 
53
53
  == Warranty
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
- require 'rake/testtask'
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
- Rake::TestTask.new do |t|
24
- t.verbose = true
25
- t.warning = true
26
- end
23
+ desc "Run the test suite"
24
+ RSpec::Core::RakeTask.new(:spec)
27
25
 
28
- task :default => :test
26
+ task :default => :spec
@@ -1,13 +1,13 @@
1
1
  require 'erb'
2
2
  require 'rbconfig'
3
3
  require 'tmpdir'
4
- require 'ptools'
5
4
  require 'open3'
5
+ require 'ptools'
6
6
 
7
7
  module Mkmf
8
8
  module Lite
9
9
  # The version of the mkmf-lite library
10
- MKMF_LITE_VERSION = '0.3.1'.freeze
10
+ MKMF_LITE_VERSION = '0.5.0'.freeze
11
11
 
12
12
  private
13
13
 
@@ -95,6 +95,20 @@ module Mkmf
95
95
  try_to_compile(code)
96
96
  end
97
97
 
98
+ # Returns the value of the given +constant+ (which could also be a macro)
99
+ # using +headers+, or common headers if no headers are specified.
100
+ #
101
+ # If this method fails an error is raised. This could happen if the constant
102
+ # can't be found and/or the header files do not include the indicated constant.
103
+ #
104
+ def check_valueof(constant, headers = [])
105
+ headers = get_header_string(headers)
106
+ erb = ERB.new(read_template('check_valueof.erb'))
107
+ code = erb.result(binding)
108
+
109
+ try_to_execute(code)
110
+ end
111
+
98
112
  # Returns the sizeof +type+ using +headers+, or common headers if no
99
113
  # headers are specified.
100
114
  #
@@ -171,8 +185,8 @@ module Mkmf
171
185
  command += cpp_source_file
172
186
 
173
187
  # Temporarily close these
174
- $stderr.reopen(File.null)
175
- $stdout.reopen(File.null)
188
+ $stderr.reopen(IO::NULL)
189
+ $stdout.reopen(IO::NULL)
176
190
 
177
191
  if system(command)
178
192
  $stdout.reopen(stdout_orig) # We need this back for open3 to work.
@@ -223,8 +237,8 @@ module Mkmf
223
237
  command += cpp_out_file + ' '
224
238
  command += cpp_source_file
225
239
 
226
- $stderr.reopen(File.null)
227
- $stdout.reopen(File.null)
240
+ $stderr.reopen(IO::NULL)
241
+ $stdout.reopen(IO::NULL)
228
242
  boolean = system(command)
229
243
  }
230
244
  ensure
@@ -0,0 +1,8 @@
1
+ #include <stdio.h>
2
+
3
+ <%= headers %>
4
+
5
+ int main(){
6
+ printf("%d\n", <%= constant %>);
7
+ return 0;
8
+ }
@@ -3,24 +3,24 @@ 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.3.1'
6
+ spec.version = '0.5.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 = 'test/test_mkmf_lite.rb'
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('test-unit', '>= 2.4.0')
17
+ spec.add_dependency('ptools', '~> 1.4')
18
+ spec.add_development_dependency('rspec', '~> 3.9')
19
19
 
20
20
  spec.metadata = {
21
21
  'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
22
22
  'bug_tracker_uri' => 'https://github.com/djberg96/mkmf-lite/issues',
23
- 'changelog_uri' => 'https://github.com/djberg96/mkmf-lite/blob/master/CHANGES',
23
+ 'changelog_uri' => 'https://github.com/djberg96/mkmf-lite/blob/master/CHANGES.rdoc',
24
24
  'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
25
25
  'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
26
26
  'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki'
@@ -0,0 +1,137 @@
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
+ let(:constant) { 'EOF' }
17
+
18
+ describe "constants" do
19
+ example "version information" do
20
+ expect(described_class::MKMF_LITE_VERSION).to eq('0.5.0')
21
+ expect(described_class::MKMF_LITE_VERSION).to be_frozen
22
+ end
23
+ end
24
+
25
+ describe "have_header" do
26
+ example "have_header basic functionality" do
27
+ expect(subject).to respond_to(:have_header)
28
+ end
29
+
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
+ end
34
+
35
+ example "have_header accepts an array of directories as a second argument" do
36
+ expect{ subject.have_header('stdio.h', '/usr/local/include') }.not_to raise_error
37
+ expect{ subject.have_header('stdio.h', '/usr/local/include', '/usr/include') }.not_to raise_error
38
+ end
39
+ end
40
+
41
+ context "have_func" do
42
+ example "have_func basic functionality" do
43
+ expect(subject).to respond_to(:have_func)
44
+ end
45
+
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
+ end
50
+
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
+ end
55
+
56
+ example "have_func requires at least one argument" do
57
+ expect{ subject.have_func }.to raise_error(ArgumentError)
58
+ end
59
+
60
+ example "have_func accepts a maximum of two arguments" do
61
+ expect{ subject.have_func('printf', 'stdio.h', 'bogus') }.to raise_error(ArgumentError)
62
+ end
63
+ end
64
+
65
+ context "have_struct_member" do
66
+ example "have_struct_member basic functionality" do
67
+ expect(subject).to respond_to(:have_struct_member)
68
+ end
69
+
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)
74
+ end
75
+
76
+ example "have_struct_member requires at least two arguments" do
77
+ expect{ subject.have_struct_member() }.to raise_error(ArgumentError)
78
+ expect{ subject.have_struct_member('struct passwd') }.to raise_error(ArgumentError)
79
+ end
80
+
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)
83
+ end
84
+ end
85
+
86
+ context "check_valueof" do
87
+ example "check_valueof basic functionality" do
88
+ expect(subject).to respond_to(:check_valueof)
89
+ expect{ subject.check_sizeof(constant) }.not_to raise_error
90
+ end
91
+
92
+ example "check_valueof requires at least one argument" do
93
+ expect{ subject.check_valueof }.to raise_error(ArgumentError)
94
+ end
95
+
96
+ example "check_valueof accepts a maximum of two arguments" do
97
+ expect{ subject.check_valueof(constant, 'stdio.h', 1) }.to raise_error(ArgumentError)
98
+ end
99
+
100
+ example "check_valueof works with one or two arguments" do
101
+ expect{ subject.check_valueof(constant) }.not_to raise_error
102
+ expect{ subject.check_valueof(constant, 'stdio.h') }.not_to raise_error
103
+ end
104
+
105
+ example "check_valueof returns an integer value" do
106
+ value = subject.check_valueof(constant)
107
+ expect(value).to be_kind_of(Integer)
108
+ expect(value).to eq(-1)
109
+ end
110
+ end
111
+
112
+ context "check_sizeof" do
113
+ example "check_sizeof basic functionality" do
114
+ expect(subject).to respond_to(:check_sizeof)
115
+ expect{ subject.check_sizeof(st_type, st_header) }.not_to raise_error
116
+ end
117
+
118
+ example "check_sizeof requires at least one argument" do
119
+ expect{ subject.check_sizeof }.to raise_error(ArgumentError)
120
+ end
121
+
122
+ example "check_sizeof accepts a maximum of two arguments" do
123
+ expect{ subject.check_sizeof('div_t', 'stdlib.h', 1) }.to raise_error(ArgumentError)
124
+ end
125
+
126
+ example "check_sizeof works with one or two arguments" do
127
+ expect{ subject.check_sizeof('div_t') }.not_to raise_error
128
+ expect{ subject.check_sizeof('div_t', 'stdlib.h') }.not_to raise_error
129
+ end
130
+
131
+ example "check_sizeof returns an integer value" do
132
+ size = subject.check_sizeof(st_type, st_header)
133
+ expect(size).to be_kind_of(Integer)
134
+ expect(size).to be > 0
135
+ end
136
+ end
137
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmf-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -35,36 +35,36 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2019-12-11 00:00:00.000000000 Z
38
+ date: 2020-12-06 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: '0'
46
+ version: '1.4'
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: '0'
53
+ version: '1.4'
54
54
  - !ruby/object:Gem::Dependency
55
- name: test-unit
55
+ name: rspec
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 2.4.0
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: 2.4.0
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,
@@ -80,6 +80,8 @@ extra_rdoc_files:
80
80
  - README.rdoc
81
81
  files:
82
82
  - CHANGES.rdoc
83
+ - Gemfile
84
+ - LICENSE
83
85
  - MANIFEST.rdoc
84
86
  - README.rdoc
85
87
  - Rakefile
@@ -87,23 +89,24 @@ files:
87
89
  - lib/mkmf-lite.rb
88
90
  - lib/mkmf/lite.rb
89
91
  - lib/mkmf/templates/check_sizeof.erb
92
+ - lib/mkmf/templates/check_valueof.erb
90
93
  - lib/mkmf/templates/have_func.erb
91
94
  - lib/mkmf/templates/have_func_pointer.erb
92
95
  - lib/mkmf/templates/have_header.erb
93
96
  - lib/mkmf/templates/have_struct_member.erb
94
97
  - mkmf-lite.gemspec
95
- - test/test_mkmf_lite.rb
98
+ - spec/mkmf_lite_spec.rb
96
99
  homepage: http://github.com/djberg96/mkmf-lite
97
100
  licenses:
98
101
  - Apache-2.0
99
102
  metadata:
100
103
  homepage_uri: https://github.com/djberg96/mkmf-lite
101
104
  bug_tracker_uri: https://github.com/djberg96/mkmf-lite/issues
102
- changelog_uri: https://github.com/djberg96/mkmf-lite/blob/master/CHANGES
105
+ changelog_uri: https://github.com/djberg96/mkmf-lite/blob/master/CHANGES.rdoc
103
106
  documentation_uri: https://github.com/djberg96/mkmf-lite/wiki
104
107
  source_code_uri: https://github.com/djberg96/mkmf-lite
105
108
  wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
106
- post_install_message:
109
+ post_install_message:
107
110
  rdoc_options: []
108
111
  require_paths:
109
112
  - lib
@@ -118,10 +121,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
121
  - !ruby/object:Gem::Version
119
122
  version: '0'
120
123
  requirements: []
121
- rubyforge_project:
122
- rubygems_version: 2.7.6.2
123
- signing_key:
124
+ rubygems_version: 3.1.4
125
+ signing_key:
124
126
  specification_version: 4
125
127
  summary: A lighter version of mkmf designed for use as a library
126
128
  test_files:
127
- - test/test_mkmf_lite.rb
129
+ - spec/mkmf_lite_spec.rb
metadata.gz.sig CHANGED
Binary file
@@ -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.1', 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