8000 Create a getting started. · Issue #21 · rawr/rawr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create a getting started. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danpal opened this issue Nov 16, 2012 · 5 comments
Open

Create a getting started. #21

danpal opened this issue Nov 16, 2012 · 5 comments

Comments

@danpal
Copy link
danpal commented Nov 16, 2012

Rawr is poorly documented. Could you create a simple project that uses rawr and works?

@Neurogami
Copy link
Collaborator

There's not a whole lot to it. I can write up something that explains the config options and rake tasks. Have you looked at http://rawr.rubyforge.org ?

@kritik
Copy link
kritik commented Mar 21, 2013

I checked that page but there is no examples. I would also want to have any documentation here. At least starting point:

  • How to run my code with ruby
  • Where I should put my base-code (file which runs all the application)

And I didn't catch why we need Rakefile. Which tasks should I put there?

@Neurogami
Copy link
Collaborator
8000

I will write up something more detailed. In the meantime:

The purpose of Rawr is to provide Rake tasks that will package up Ruby and JRuby code into an executable file. It does this building an executable jar file containing a special Main.java class that bootstraps the execution of the application. Rawr also provides Rake tasks for further packaging that executable into a more conventional form, such as an exe or app file. All those really do is act as a convenience for invoking the executable jar file, but it makes your program appear as more of a standard desktop program rather than as a Java program.

Your program should be runnable as a standalone program without having to use Rawr.

There are some conventions that work with Rawr; for example, your main source code should be in a sub-folder named src/ and the main file that runs your program should be src/main.rb

When you run rawr install in a project folder it either creates a Rakefile if there is not an existing one, or attempts to modify the existing Rakefile. It adds a line to load in the Rawr library to make some special Rawr rake tasks available. It also creates a file named `build_configuration.rb' that allows you to set some packaging configuration details. Most of the options are commented out because the defaults tend to work well.

One of the nicer things about Rawr was that it would use JRuby to compile Ruby files into Java cass files before packaging them, which worked as a kind of low-grade code obfuscation. However, for reasons still unknown to me, compiled Ruby code that was in a jar file was failing to get loaded when calling require. This is something I need to fix.

@kritik
Copy link
kritik commented Mar 23, 2013

Oh, thanks. Now I have a starting point ;)

@Neurogami
Copy link
Collaborator

Good. In a way, there really isn't a whole lot to Rawr. It puts stuff into an executable jar and can also bundle that up with jruby-complete.jar and other files to make complete standalone desktop (J)Ruby programs. There are also options to wrap all that up into platform-specific installers.

I was looking at the source code for the configuration settings and while some are documented or self-evident, there are a few that had me puzzled. So, some additional docs and examples would be useful.

BTW, there was a new release of Rawr that may have fixed the compilation of Ruby files. It works for some simple test cases but I need to develop some more robust examples to be sure it really is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0