Packaging pure ruby files when using extconf.rb

ruby

    Next

  • 1. Ruby CVS Commit Mailinglist
    Hi, There's no mailing list where CVS commits are automatically posted, right? As a developer to stay up-to-date, I'd like to have such a list. We could create a XXXX@XXXXX.COM list, and then someone has to modify the CVS on ruby-lang.org to send commit messages to this list. Comments? Regards, Michael
  • 2. Is there a way to get the name of symbol passed to method?
    Is there a way to get the name of the symbol passed to a method? e.g. def geterdone(array) # funkify array- but I want to know name of original symbol, not array, and prefix each element with it newarray=array.select(...){...} end oldarray=[val1, val2, ...] newarray=geterdone(oldarray) # newarray is now ["oldarray:val1", "oldarray:val2", ...] Thanks, Nick
  • 3. get TkCanvas from an item?
    If I have a Tk item like a TkcRectangle that has been created on a TkCanvas, is there a way to ask the TkcRectangle for the TkCanvas that it is on? For example, can I do something similar to this? root = TkRoot.new {title 'Diagram'} canvas = TkCanvas.new(root) item = TkcRectangle.new(canvas, x, y, x + width, y + height) the_canvas = item.canvas # not a real method or the_canvas = item.parent # not a real method
  • 4. [doc patch] error in ruby/re.c documentation
    Index: re.c =================================================================== RCS file: /src/ruby/re.c,v retrieving revision 1.114.2.10 diff -u -r1.114.2.10 re.c --- re.c 19 Oct 2004 10:25:20 -0000 1.114.2.10 +++ re.c 4 Dec 2004 20:22:00 -0000 @@ -1523,8 +1523,8 @@ * * a = "HELLO" * case a - * when /^a-z*$/; print "Lower case\n" - * when /^A-Z*$/; print "Upper case\n" + * when /^[a-z]*$/; print "Lower case\n" + * when /^[A-Z]*$/; print "Upper case\n" * else; print "Mixed case\n" * end *

Packaging pure ruby files when using extconf.rb

Postby Paul William » Sat, 26 Jul 2003 16:27:47 GMT

Hi,

I am writing a C extension but I want to include some classes written in
pure ruby. How can I package the pure ruby files so that it is install
when the user runs 
ruby extconf.rb && make && make install

Thanks

Paul



Re: Packaging pure ruby files when using extconf.rb

Postby Mauricio Ferndez » Sat, 26 Jul 2003 17:36:23 GMT



You can use Minero Aoki's install.rb

* put extconf.rb + sources in ext/extname/
* create a MANIFEST file in ext/extname, containing the names of all files
  in that dir
* put the .rb files in lib/

Add README, TODO, LICENSE, etc in the top dir (and install.rb of course :)
and you have a nice 'standard' package.

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Win95 is not a virus; a virus does something.
	-- unknown source


Re: Packaging pure ruby files when using extconf.rb

Postby maillist@bestworldweb.homelinux.com » Sat, 26 Jul 2003 17:48:13 GMT


How would I do that?

Thanks very much for your help

Paul



Re: Packaging pure ruby files when using extconf.rb

Postby maillist@bestworldweb.homelinux.com » Sat, 26 Jul 2003 17:48:40 GMT





Where do I get install.rb?



Re: Packaging pure ruby files when using extconf.rb

Postby ts » Sat, 26 Jul 2003 17:51:49 GMT

>>>>> "m" == maillist@bestworldweb homelinux com < XXXX@XXXXX.COM > writes:

m> How would I do that?

svg% ls -R
.:
extconf.rb  lib/  test.c  test.rb*

./lib:
b.rb*
svg% 

svg% ruby extconf.rb 
creating Makefile
svg% 

svg% make
gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I.   -c test.c
gcc -shared  -L"/usr/local/lib" -o mytest.so test.o  -ldl -lcrypt -lm  -lc
svg% 

svg# make install
mytest.so -> /usr/local/lib/ruby/site_ruby/1.8/i686-linux/mytest.so
chmod 0755 /usr/local/lib/ruby/site_ruby/1.8/i686-linux/mytest.so
./lib/b.rb -> /usr/local/lib/ruby/site_ruby/1.8/b.rb
chmod 0644 /usr/local/lib/ruby/site_ruby/1.8/b.rb
svg# 



Guy Decoux


Re: Packaging pure ruby files when using extconf.rb

Postby maillist@bestworldweb.homelinux.com » Sat, 26 Jul 2003 17:56:21 GMT

Guy, Thanks VERY much for all your help and examples.

Best regards

Paul



Re: Packaging pure ruby files when using extconf.rb

Postby Mauricio Ferndez » Sat, 26 Jul 2003 18:22:23 GMT



 http://www.**--****.com/ 


-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Try to remove the color-problem by restarting your computer several times.
	-- Microsoft-Internet Explorer README.TXT


Re: Packaging pure ruby files when using extconf.rb

Postby maillist@bestworldweb.homelinux.com » Sat, 26 Jul 2003 18:28:29 GMT





Thanks very much for your kind help.

Best Regards

Paul



Similar Threads:

1.Using mkmf.rb / extconf.rb and autoconf/automake together

2.Using extconf.rb for executables?

Hi!

I recently had an efficency problem with a small tool to be used with
a Ruby program. To improve efficency I did re-write the tool in C.
That immediately brought up the question if one can use exconf.rb not
only to create libraries but also for executables.

I didn't find any hint concerning that question. Is it possilble?
How? Wouldn't it be nice if it *were* possible? Is there an
alternative? I know that autoconf & Co. exist but they require tools
that are not necessarily available on machines that have Ruby. The
solution should not require more than Ruby, C and make (or nmake).

I presently use a Makefile but Makefiles are not the answer to
portability issues.

Josef 'Jupp' Schugt
-- 
                        .-------.
message > 100 kB?   /   |       |
sender = spammer?  /    | R.I.P.|
text   = spam?    /  ___|       |___

3.Installing .h files from extconf.rb?

Hey, anyone have an elegant way they use to make extconf (with the
possible addition of install.rb) install C headers?  I need to have
one installed, since I'm working on two modules, and one uses the
other, and needs to access the data structures.

thanks,

-- 
Ryan Pavlik < XXXX@XXXXX.COM >

"And let's not forget the smell!" - 8BT

4.[Ruby Forum] Ruby extconf.rb / autoconf (in?)compatibility

5.ruby 1.8.0 preview4 (Bug in ext/openssl/extconf.rb)

On Fri, Jul 25, 2003 at 02:22:52PM +0000, Mike wrote:
> A one-line patch for 'extconf.rb' follows.
> 
> 105c105
> < if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n  int x() { FOO(1,2); }
> ")
> ---
> > if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n")

That's backwards, yes?  Didn't you add the call to FOO rather than removing it?

-Mark

6. Ruby extconf.rb / autoconf (in?)compatibility

7. mysql-ruby installation - extconf.rb:33: uninitialized constant CPP (NameError)

8. Ruby extconf.rb and autoconf (in?)compatibility



Return to ruby

 

Who is online

Users browsing this forum: No registered users and 21 guest