utilrb 1.3.3 → 1.4.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.
- data/History.txt +17 -0
- data/Manifest.txt +11 -0
- data/README.txt +9 -5
- data/Rakefile +30 -50
- data/ext/extconf.rb +14 -1
- data/ext/value_set.cc +43 -1
- data/lib/utilrb/array/to_s.rb +1 -0
- data/lib/utilrb/common.rb +3 -2
- data/lib/utilrb/configsearch/configuration_finder.rb +78 -0
- data/lib/utilrb/configsearch.rb +2 -0
- data/lib/utilrb/hash/recursive_merge.rb +26 -0
- data/lib/utilrb/hash/to_s.rb +1 -0
- data/lib/utilrb/kernel/load_dsl_file.rb +187 -0
- data/lib/utilrb/kernel/options.rb +10 -1
- data/lib/utilrb/kernel/with_module.rb +53 -0
- data/lib/utilrb/logger/hierarchy.rb +21 -5
- data/lib/utilrb/logger/io.rb +25 -0
- data/lib/utilrb/marshal/load_with_missing_constants.rb +63 -0
- data/lib/utilrb/module/ancestor_p.rb +12 -18
- data/lib/utilrb/module/cached_enum.rb +15 -0
- data/lib/utilrb/module/const_defined_here_p.rb +11 -0
- data/lib/utilrb/module/define_or_reuse.rb +15 -22
- data/lib/utilrb/module/include.rb +12 -0
- data/lib/utilrb/module/inherited_enumerable.rb +15 -0
- data/lib/utilrb/object/scoped_eval.rb +17 -0
- data/lib/utilrb/object/singleton_class.rb +3 -44
- data/lib/utilrb/pkgconfig.rb +311 -27
- data/lib/utilrb/symbol/to_str.rb +5 -0
- data/lib/utilrb/value_set.rb +12 -0
- data/test/data/test_pkgconfig_empty.pc +10 -0
- data/test/test_kernel.rb +158 -0
- data/test/test_module.rb +11 -10
- data/test/test_object.rb +0 -28
- data/test/test_pkgconfig.rb +35 -1
- metadata +88 -44
data/test/test_pkgconfig.rb
CHANGED
@@ -20,7 +20,7 @@ class TC_PkgConfig < Test::Unit::TestCase
|
|
20
20
|
def test_load
|
21
21
|
pkg = PkgConfig.new('test_pkgconfig')
|
22
22
|
assert_equal('test_pkgconfig', pkg.name)
|
23
|
-
assert_equal(
|
23
|
+
assert_equal([4, 2], pkg.version)
|
24
24
|
|
25
25
|
assert_equal('a_prefix', pkg.prefix)
|
26
26
|
assert_equal(%w{-Ia_prefix/include -O3}.to_set, pkg.cflags.split.to_set)
|
@@ -45,4 +45,38 @@ class TC_PkgConfig < Test::Unit::TestCase
|
|
45
45
|
assert_equal('', pkg.libs_only_l)
|
46
46
|
assert_equal([], pkg.library_dirs)
|
47
47
|
end
|
48
|
+
|
49
|
+
def test_comparison_with_cpkgconfig
|
50
|
+
PkgConfig.each_package do |name|
|
51
|
+
pkg = begin PkgConfig.new(name)
|
52
|
+
rescue PkgConfig::NotFound
|
53
|
+
`pkg-config --cflags #{name}`
|
54
|
+
if $? == 0
|
55
|
+
raise
|
56
|
+
else
|
57
|
+
puts "can be loaded by neither the ruby nor the C versions"
|
58
|
+
next
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
failed = false
|
63
|
+
PkgConfig::ACTIONS.each do |action_name|
|
64
|
+
method_name = action_name.gsub(/-/, '_')
|
65
|
+
|
66
|
+
pure_ruby = pkg.send(method_name)
|
67
|
+
cpkgconfig = pkg.send("pkgconfig_#{method_name}")
|
68
|
+
if Shellwords.shellsplit(pure_ruby).to_set != Shellwords.shellsplit(cpkgconfig).to_set
|
69
|
+
failed = true
|
70
|
+
puts "#{name} #{action_name}"
|
71
|
+
puts " pure ruby: #{pure_ruby}"
|
72
|
+
puts " cpkgconfig: #{cpkgconfig}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
if failed
|
76
|
+
puts "contents:"
|
77
|
+
puts pkg.file.join("\n")
|
78
|
+
assert(false, "result from pkg-config and the PkgConfig class differ")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
48
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utilrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 7
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 1.4.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Sylvain Joyeux
|
@@ -9,54 +15,77 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
13
|
-
default_executable:
|
18
|
+
date: 2011-08-03 00:00:00 Z
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: facets
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 31
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 4
|
32
|
+
- 0
|
23
33
|
version: 2.4.0
|
24
|
-
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: rake
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
42
|
- - ">="
|
32
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
33
47
|
version: "0"
|
34
|
-
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
35
50
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
51
|
+
name: flexmock
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 51
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
- 8
|
62
|
+
- 6
|
63
|
+
version: 0.8.6
|
37
64
|
type: :development
|
38
|
-
|
39
|
-
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: hoe
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
40
71
|
requirements:
|
41
72
|
- - ">="
|
42
73
|
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
74
|
+
hash: 47
|
75
|
+
segments:
|
76
|
+
- 2
|
77
|
+
- 8
|
78
|
+
- 0
|
79
|
+
version: 2.8.0
|
80
|
+
type: :development
|
81
|
+
version_requirements: *id004
|
45
82
|
description: |-
|
46
|
-
|
47
|
-
Utilrb is yet another Ruby toolkit, in the spirit of facets. It includes all
|
48
|
-
the standard class extensions I use in my own projects like Genom.rb.
|
83
|
+
This work is licensed under the BSD license. See License.txt for details
|
49
84
|
|
50
|
-
==
|
51
|
-
The only dependency Utilrb has is flexmock if you want to run tests. It is
|
52
|
-
available as a gem, so you can run
|
53
|
-
|
54
|
-
gem install flexmock
|
85
|
+
== What is Utilrb ?
|
55
86
|
|
56
|
-
|
57
|
-
|
58
|
-
functionalities will be disabled if it is not present. Trying to require
|
59
|
-
a file in which there is a C-only feature will yield a warning on STDOUT.
|
87
|
+
Utilrb is yet another Ruby toolkit, in the spirit of facets. It includes all
|
88
|
+
the standard class extensions I use in other projects.
|
60
89
|
email:
|
61
90
|
- sylvain.joyeux@m4x.org
|
62
91
|
executables: []
|
@@ -88,6 +117,8 @@ files:
|
|
88
117
|
- lib/utilrb/array/to_s.rb
|
89
118
|
- lib/utilrb/column_formatter.rb
|
90
119
|
- lib/utilrb/common.rb
|
120
|
+
- lib/utilrb/configsearch.rb
|
121
|
+
- lib/utilrb/configsearch/configuration_finder.rb
|
91
122
|
- lib/utilrb/dir.rb
|
92
123
|
- lib/utilrb/dir/empty.rb
|
93
124
|
- lib/utilrb/enumerable.rb
|
@@ -101,23 +132,29 @@ files:
|
|
101
132
|
- lib/utilrb/gc.rb
|
102
133
|
- lib/utilrb/gc/force.rb
|
103
134
|
- lib/utilrb/hash.rb
|
135
|
+
- lib/utilrb/hash/recursive_merge.rb
|
104
136
|
- lib/utilrb/hash/slice.rb
|
105
137
|
- lib/utilrb/hash/to_s.rb
|
106
138
|
- lib/utilrb/hash/to_sym_keys.rb
|
107
139
|
- lib/utilrb/kernel.rb
|
108
140
|
- lib/utilrb/kernel/arity.rb
|
141
|
+
- lib/utilrb/kernel/load_dsl_file.rb
|
109
142
|
- lib/utilrb/kernel/options.rb
|
110
143
|
- lib/utilrb/kernel/poll.rb
|
111
144
|
- lib/utilrb/kernel/require.rb
|
112
145
|
- lib/utilrb/kernel/swap.rb
|
146
|
+
- lib/utilrb/kernel/with_module.rb
|
113
147
|
- lib/utilrb/logger.rb
|
114
148
|
- lib/utilrb/logger/forward.rb
|
115
149
|
- lib/utilrb/logger/hierarchy.rb
|
150
|
+
- lib/utilrb/logger/io.rb
|
151
|
+
- lib/utilrb/marshal/load_with_missing_constants.rb
|
116
152
|
- lib/utilrb/module.rb
|
117
153
|
- lib/utilrb/module/ancestor_p.rb
|
118
154
|
- lib/utilrb/module/attr_enumerable.rb
|
119
155
|
- lib/utilrb/module/attr_predicate.rb
|
120
156
|
- lib/utilrb/module/cached_enum.rb
|
157
|
+
- lib/utilrb/module/const_defined_here_p.rb
|
121
158
|
- lib/utilrb/module/define_method.rb
|
122
159
|
- lib/utilrb/module/define_or_reuse.rb
|
123
160
|
- lib/utilrb/module/include.rb
|
@@ -125,6 +162,7 @@ files:
|
|
125
162
|
- lib/utilrb/object.rb
|
126
163
|
- lib/utilrb/object/address.rb
|
127
164
|
- lib/utilrb/object/attribute.rb
|
165
|
+
- lib/utilrb/object/scoped_eval.rb
|
128
166
|
- lib/utilrb/object/singleton_class.rb
|
129
167
|
- lib/utilrb/objectstats.rb
|
130
168
|
- lib/utilrb/pkgconfig.rb
|
@@ -132,6 +170,7 @@ files:
|
|
132
170
|
- lib/utilrb/set/to_s.rb
|
133
171
|
- lib/utilrb/socket/tcp_server.rb
|
134
172
|
- lib/utilrb/socket/tcp_socket.rb
|
173
|
+
- lib/utilrb/symbol/to_str.rb
|
135
174
|
- lib/utilrb/time.rb
|
136
175
|
- lib/utilrb/time/to_hms.rb
|
137
176
|
- lib/utilrb/unbound_method.rb
|
@@ -140,6 +179,7 @@ files:
|
|
140
179
|
- lib/utilrb/weakref.rb
|
141
180
|
- patches/gc_live_objects.patch
|
142
181
|
- test/data/test_pkgconfig.pc
|
182
|
+
- test/data/test_pkgconfig_empty.pc
|
143
183
|
- test/test_array.rb
|
144
184
|
- test/test_config.rb
|
145
185
|
- test/test_dir.rb
|
@@ -158,7 +198,6 @@ files:
|
|
158
198
|
- test/test_time.rb
|
159
199
|
- test/test_unbound_method.rb
|
160
200
|
- test/test_weakref.rb
|
161
|
-
has_rdoc: true
|
162
201
|
homepage: http://utilrb.rubyforge.org
|
163
202
|
licenses: []
|
164
203
|
|
@@ -168,42 +207,47 @@ rdoc_options:
|
|
168
207
|
- README.txt
|
169
208
|
require_paths:
|
170
209
|
- lib
|
171
|
-
- ext
|
172
210
|
required_ruby_version: !ruby/object:Gem::Requirement
|
211
|
+
none: false
|
173
212
|
requirements:
|
174
213
|
- - ">="
|
175
214
|
- !ruby/object:Gem::Version
|
215
|
+
hash: 3
|
216
|
+
segments:
|
217
|
+
- 0
|
176
218
|
version: "0"
|
177
|
-
version:
|
178
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
|
+
none: false
|
179
221
|
requirements:
|
180
222
|
- - ">="
|
181
223
|
- !ruby/object:Gem::Version
|
224
|
+
hash: 3
|
225
|
+
segments:
|
226
|
+
- 0
|
182
227
|
version: "0"
|
183
|
-
version:
|
184
228
|
requirements: []
|
185
229
|
|
186
230
|
rubyforge_project: utilrb
|
187
|
-
rubygems_version: 1.
|
231
|
+
rubygems_version: 1.7.2
|
188
232
|
signing_key:
|
189
233
|
specification_version: 3
|
190
234
|
summary: Yet another Ruby toolkit
|
191
235
|
test_files:
|
236
|
+
- test/test_unbound_method.rb
|
237
|
+
- test/test_hash.rb
|
238
|
+
- test/test_misc.rb
|
239
|
+
- test/test_exception.rb
|
240
|
+
- test/test_kernel.rb
|
241
|
+
- test/test_gc.rb
|
242
|
+
- test/test_proc.rb
|
192
243
|
- test/test_time.rb
|
193
|
-
- test/
|
244
|
+
- test/test_pkgconfig.rb
|
194
245
|
- test/test_weakref.rb
|
195
246
|
- test/test_object.rb
|
196
|
-
- test/test_kernel.rb
|
197
|
-
- test/test_pkgconfig.rb
|
198
247
|
- test/test_enumerable.rb
|
199
|
-
- test/test_proc.rb
|
200
|
-
- test/test_module.rb
|
201
|
-
- test/test_hash.rb
|
202
|
-
- test/test_exception.rb
|
203
248
|
- test/test_config.rb
|
204
|
-
- test/test_gc.rb
|
205
|
-
- test/test_misc.rb
|
206
|
-
- test/test_unbound_method.rb
|
207
|
-
- test/test_objectstats.rb
|
208
249
|
- test/test_dir.rb
|
209
250
|
- test/test_array.rb
|
251
|
+
- test/test_module.rb
|
252
|
+
- test/test_objectstats.rb
|
253
|
+
- test/test_set.rb
|