Skip to content

Commit 9611a90

Browse files
committed
Updated README to show how to perform equivalent of 'jruby -S cmd' with jrubyexec. Added one more exclusion to GemUtils.
1 parent 504675d commit 9611a90

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,34 @@ in the ```jrubyexec``` closure will cause a failure
133133
As with `JRubyExec`, `args`, `setArgs` and `main` are illegal within the `jrubyexec` closure.
134134
All other methods should work.
135135

136+
### Running a Ruby PATH command
137+
138+
Because `JRubyExec` checks for the existence of the script, it might look at first whether running Ruby commands from
139+
`PATH` could be difficult. However, this is totally possible by utilising `jrubyArgs`. Here is an example of running
140+
`rake` as task.
141+
142+
```groovy
143+
task rake( type :JRubyExec ) {
144+
jrubyArgs '-S', 'rake'
145+
script '/path/to/Rakefile'
146+
scriptArgs 'target1', 'target2'
147+
}
148+
```
149+
150+
or even
151+
152+
```groovy
153+
ext {
154+
rake = { String target ->
155+
jrubyexec {
156+
jrubyArgs '-S', 'rake'
157+
script '/path/to/Rakefile'
158+
scriptArgs target
159+
}
160+
}
161+
}
162+
```
163+
136164
## JRubyPrepareGems - A task for unpacking GEMs
137165

138166
Unpacking occurs using the default `jruby` version as set by `jruby.execVersion`.

src/main/groovy/com/github/jrubygradle/GemUtils.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class GemUtils {
150150
if(!fullGem) {
151151
exclude 'cache/**'
152152
exclude 'gems/*/test/**'
153+
exclude 'gems/*/tests/**'
153154
exclude 'build_info'
154155
}
155156
}

0 commit comments

Comments
 (0)