README.txt in RubyInline-3.4.0 vs README.txt in RubyInline-3.5.0
- old
+ new
@@ -30,35 +30,35 @@
** SYNOPSYS:
require "inline"
class MyTest
- inline_c "
- long factorial(int max) {
- int i=max, result=1;
- while (i >= 2) { result *= i--; }
- return result;
- }"
+ inline do |builder|
+ builder.c "
+ long factorial(int max) {
+ int i=max, result=1;
+ while (i >= 2) { result *= i--; }
+ return result;
+ }"
end
t = MyTest.new()
factorial_5 = t.factorial(5)
** SYNOPSYS (C++):
- $INLINE_FLAGS = " -x c++ "
- $INLINE_LIBS = " -lstdc++ "
- require "inline"
+ require 'inline'
class MyTest
- inline_c "
- #include <iostream>
- static
- VALUE
- hello(int i) {
- while (i-- > 0) {
- std::cout << \"hello\" << std::endl;
- }
- }"
+ inline(:C) do |builder|
+ builder.include '<iostream>'
+ builder.add_compile_flags '-x c++', '-lstdc++'
+ builder.c '
+ void hello(int i) {
+ while (i-- > 0) {
+ std::cout << "hello" << std::endl;
+ }
+ }'
+ end
end
t = MyTest.new()
t.hello(3)
** SYNOPSYS (packaging):
@@ -93,10 +93,10 @@
4) Run new code with 'time' and large dataset. Repeat 2-3 if unsatisfied.
5) Run final code with 'time' and compare to the first run.
** REQUIREMENTS:
-+ Ruby - 1.6.7 & 1.8.2 has been used on FreeBSD 4.6+ and MacOSX.
++ Ruby - 1.8.2 has been used on FreeBSD 4.6+ and MacOSX.
+ POSIX compliant system (ie pretty much any UNIX, or Cygwin on MS platforms).
+ A C/C++ compiler (the same one that compiled your ruby interpreter).
+ test::unit for running tests ( http://testunit.talbott.ws/ ).
+ rubygems & rake if you'd like - these are used by inline_package.