JRuby

-x flag not supported

Details

  • Number of attachments :
    1

Description

From Ruby man page:

     -x[directory]  Tells Ruby that the script is embedded in a message.
                    Leading garbage will be discarded until the first that
                    starts with ``#!'' and contains the string, ``ruby''.  Any
                    meaningful switches on that line will applied.  The end of
                    script must be specified with either EOF, ^D (control-D),
                    ^Z (control-Z), or reserved word __END__.  If the direc-
                    tory name is specified, Ruby will switch to that directory
                    before executing script.

Activity

Hide
Charles Oliver Nutter added a comment -

Punting issues from 1.1 RC2 to 1.1 final.

Show
Charles Oliver Nutter added a comment - Punting issues from 1.1 RC2 to 1.1 final.
Hide
Thomas E Enebo added a comment -

Uncommon option...

Show
Thomas E Enebo added a comment - Uncommon option...
Hide
Michael Johann added a comment -

I'm working on this. Please feel free, to not fix it.

Show
Michael Johann added a comment - I'm working on this. Please feel free, to not fix it.
Hide
Michael Johann added a comment -

I implemented the specified behavior.
I also added some rubyspec (http://rubyspec.org/issues/show/192) test the correct behavior.

Perhaps you can apply the patch.

Show
Michael Johann added a comment - I implemented the specified behavior. I also added some rubyspec (http://rubyspec.org/issues/show/192) test the correct behavior. Perhaps you can apply the patch.
Hide
Vladimir Sizikov added a comment -

Michael, thanks for the patch and the specs, much appreciated!

I'll take care of the specs first and then will get back to your patch. Unfortunately, your patch doesn't apply cleanly to the jruby master branch. Would it be possible for your to bring it up-to-date? And, while you at it, I'd suggest not to include in the patch all the formatting tweaks. These reformatting leads to huge patch and makes it hard to apply it cleanly, not to mention that it's just hard to review, since important changes are mixed among formatting changes.

Thanks!

Show
Vladimir Sizikov added a comment - Michael, thanks for the patch and the specs, much appreciated! I'll take care of the specs first and then will get back to your patch. Unfortunately, your patch doesn't apply cleanly to the jruby master branch. Would it be possible for your to bring it up-to-date? And, while you at it, I'd suggest not to include in the patch all the formatting tweaks. These reformatting leads to huge patch and makes it hard to apply it cleanly, not to mention that it's just hard to review, since important changes are mixed among formatting changes. Thanks!
Hide
Michael Johann added a comment -

I stashed my changes, updated the branch and merged into the correct formatting again.
Hopefully now everything is right.
It' a bit more complicated than I expected , but I'm willing to learn and hopefully someday I can apply patches without doing it more than once.

Show
Michael Johann added a comment - I stashed my changes, updated the branch and merged into the correct formatting again. Hopefully now everything is right. It' a bit more complicated than I expected , but I'm willing to learn and hopefully someday I can apply patches without doing it more than once.
Hide
Hiro Asari added a comment -
  • There is a whole bunch of setters and getters in RubyInstanceConfig.java. Are they really necessary?
  • I think the use of wild card in imports is discouraged.
  • The command line test appears to expect a file 'tmp/testDoc.foo', but I don't think there is such a file.
Show
Hiro Asari added a comment -
  • There is a whole bunch of setters and getters in RubyInstanceConfig.java. Are they really necessary?
  • I think the use of wild card in imports is discouraged.
  • The command line test appears to expect a file 'tmp/testDoc.foo', but I don't think there is such a file.
Hide
Hiro Asari added a comment -

Assuming that the setters and getters in RubyInstanceConfig.java are not necessary, here's a patch that should apply cleanly to the current HEAD, based on Michael's patch.

To test, do something like

mkdir -p tmp
cat > tmp/test.txt
lorem ipsum
#! /usr/bin/env jruby
p 0
^D
jruby -xtmp test.txt # or 'jruby -x tmp/test.txt'
Show
Hiro Asari added a comment - Assuming that the setters and getters in RubyInstanceConfig.java are not necessary, here's a patch that should apply cleanly to the current HEAD, based on Michael's patch. To test, do something like
mkdir -p tmp
cat > tmp/test.txt
lorem ipsum
#! /usr/bin/env jruby
p 0
^D
jruby -xtmp test.txt # or 'jruby -x tmp/test.txt'
Hide
Hiro Asari added a comment -

I tweaked the patch a little bit, and pushed the fix (which is basically Michael's work) in 6465ba9.

Thank you, Michael!

I can't resolve tickets yet, so someone else will.

Show
Hiro Asari added a comment - I tweaked the patch a little bit, and pushed the fix (which is basically Michael's work) in 6465ba9. Thank you, Michael! I can't resolve tickets yet, so someone else will.
Hide
Vladimir Sizikov added a comment -

Resolving in 1.5.

There is also some RubySpecs pending for this, but I can't yet push them since they require some extra changes on mspec part. Will double-check with Brian Ford.

Show
Vladimir Sizikov added a comment - Resolving in 1.5. There is also some RubySpecs pending for this, but I can't yet push them since they require some extra changes on mspec part. Will double-check with Brian Ford.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: