cplus2ruby 1.1.0 → 1.1.1
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/cplus2ruby.gemspec +3 -1
- data/lib/cplus2ruby/compiler.rb +19 -14
- metadata +6 -5
data/cplus2ruby.gemspec
CHANGED
@@ -2,10 +2,12 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |s|
|
4
4
|
s.name = "cplus2ruby"
|
5
|
-
s.version = "1.1.
|
5
|
+
s.version = "1.1.1"
|
6
6
|
s.summary = "Gluing C++ and Ruby together in an OO manner"
|
7
7
|
s.files = Dir['**/*']
|
8
8
|
s.add_dependency('facets', '>= 2.3.0')
|
9
|
+
s.requirements << "On Window: gem win32-process"
|
10
|
+
s.requirements << "C++ compiler and make"
|
9
11
|
|
10
12
|
s.author = "Michael Neumann"
|
11
13
|
s.email = "mneumann@ntecs.de"
|
data/lib/cplus2ruby/compiler.rb
CHANGED
@@ -47,23 +47,28 @@ class Cplus2Ruby::Compiler
|
|
47
47
|
make = RUBY_PLATFORM.match('mswin') ? 'nmake' : 'make'
|
48
48
|
|
49
49
|
Dir.chdir(n[:dir]) do
|
50
|
-
|
50
|
+
if File.exist?('Makefile')
|
51
|
+
system("#{make} clean")
|
52
|
+
File.delete('Makefile')
|
53
|
+
end
|
51
54
|
write_files(n[:mod])
|
55
|
+
end
|
52
56
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
pid = fork do
|
58
|
+
Dir.chdir(n[:dir])
|
59
|
+
$configure_args = {"--srcdir" => Dir.pwd}
|
60
|
+
require 'mkmf'
|
61
|
+
$CFLAGS = cflags
|
62
|
+
$LIBS << (" -lstdc++ " + libs)
|
63
|
+
create_makefile(n[:mod])
|
64
|
+
exec "#{make}"
|
65
|
+
end
|
66
|
+
_, status = Process.waitpid2(pid)
|
61
67
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
68
|
+
if RUBY_PLATFORM.match('mswin')
|
69
|
+
raise if status != 0
|
70
|
+
else
|
71
|
+
raise if status.exitstatus != 0
|
67
72
|
end
|
68
73
|
|
69
74
|
return n[:ld]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cplus2ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Neumann
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-03-
|
12
|
+
date: 2008-03-31 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -63,10 +63,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: "0"
|
65
65
|
version:
|
66
|
-
requirements:
|
67
|
-
|
66
|
+
requirements:
|
67
|
+
- "On Window: gem win32-process"
|
68
|
+
- C++ compiler and make
|
68
69
|
rubyforge_project: cplus2ruby
|
69
|
-
rubygems_version: 1.0
|
70
|
+
rubygems_version: 1.1.0
|
70
71
|
signing_key:
|
71
72
|
specification_version: 2
|
72
73
|
summary: Gluing C++ and Ruby together in an OO manner
|