rawr bundling does not include extracted gem

59 views
Skip to first unread message

toovy

unread,
Mar 3, 2011, 8:57:40 AM3/3/11
to rawr-lib
Hi,

I'm - as many ppl here - just starting with rawr and currently I'm
using it in combination with monkeybars.

I've mainly followed instructions in the book "Using JRuby" but
unfortunately the book just runs the app from netbeans - and from
there my app also works.

I want to use the gem "Celerity" in my app, so I've extracted it using
>jruby -S gem unpack and added it to the ruby/lib dir. The jar package
created by >jruby -S rake rawr:jar does not run out of the box, as the
jar does not contain any files in the ruby folder (I guess the
compiled ruby files from celerity should go there).

As I did not find the celerity files in the generated jar I searched
for them in the lib directory. But there is only the java folder
containing all java libs. Adding the extracted celerity gem here makes
the jar work fine.

For me it does not really matter where celerity is placed, but I would
have expected that rawr:jar does include the ruby libs
automatically... Am I missing an rawr option or might I have some
wrong configuration? I've basically not changed anything on any build
file...

Environment:
- win7 x64
- jruby 1.5.1 bundled with netbeans
- rawr 1.4.5

Any help would be appreciated :). Thanks a lot.

Best Regards,
toovy

James Britt

unread,
Mar 3, 2011, 11:08:51 AM3/3/11
to rawr...@googlegroups.com
toovy wrote:
> Hi,
>
> I'm - as many ppl here - just starting with rawr and currently I'm
> using it in combination with monkeybars.

Welcome!

>
> I've mainly followed instructions in the book "Using JRuby" but
> unfortunately the book just runs the app from netbeans - and from
> there my app also works.

Explaining how to create and run a Monkeybars app from Netbeans is
useful, but if the book does not go on to explain how to distribute and
run that same app *outside* of Netbeans then it's a serious omission.

It's been a long time since I've run Monkeybars from Netbeans; I've been
doing pretty much everything from the command line and vim. (When I
need to use Netbeans for any complex UI stuff I use it to design the UI
then go call it from the command line.) Just works better for me.


>
> I want to use the gem "Celerity" in my app, so I've extracted it using
>> jruby -S gem unpack and added it to the ruby/lib dir. The jar package
> created by >jruby -S rake rawr:jar does not run out of the box, as the
> jar does not contain any files in the ruby folder (I guess the
> compiled ruby files from celerity should go there).


Does your build_confiuration.rb file indicate that files should be
pulled in from `ruby/lib` ?

E.g.

c.source_dirs = %w{src lib/ruby }

>
> As I did not find the celerity files in the generated jar I searched
> for them in the lib directory. But there is only the java folder
> containing all java libs. Adding the extracted celerity gem here makes
> the jar work fine.
>
> For me it does not really matter where celerity is placed, but I would
> have expected that rawr:jar does include the ruby libs
> automatically...

Only if you tell it where to look. By default it looks in src/.

The build_configuration.rb file should have comments indicating the
default values.

For example, one of my recent apps has this:


# A list of directories where source files reside
# default value: %w{src }

c.source_dirs = %w{src lib/ruby }


I had to explicitly define `c.source_dirs` to include `lib/ruby`.

James

--

jamesbritt.com - Playing with Better Toys
neurogami.com - Smart application development
azhackers.com - Feed your head. Hack your world.

toovy

unread,
Mar 4, 2011, 6:16:06 PM3/4/11
to rawr-lib
Hi James,

thx, adding the lib/ruby dir did the trick. Nevertheless I would have
expected that monkeybars - because it is adding all java libs - also
adds the ruby libs automatically. Good to know how it works.

Thx a lot!

Best regards,
toovy

James Britt

unread,
Mar 5, 2011, 1:26:41 AM3/5/11
to rawr...@googlegroups.com
toovy wrote:
> Hi James,
>
> thx, adding the lib/ruby dir did the trick. Nevertheless I would have
> expected that monkeybars - because it is adding all java libs - also
> adds the ruby libs automatically. Good to know how it works.


Ah, but every default monkeybars app has at least two jar files that
have to be included: jruby-complete.jar, and monkeybars-*.jar.

Their default location is therefore included by default.

And there's the default inclusion of ruby files under src/

There's no reason to think every app would need or have ruby libs other
than the application source, so it isn't included by default.

>
> Thx a lot!

My pleasure.

Reply all
Reply to author
Forward
0 new messages