@@ -30,8 +30,9 @@ class JRubyExec extends JavaExec {
30
30
}
31
31
32
32
proj. tasks. withType(JRubyExec ) { t ->
33
- if (t. jrubyConfigurationName != proj. configurations. jrubyExec) {
34
- proj. dependencies. add(t. jrubyConfigurationName," org.jruby:jruby-complete:${ t.jrubyVersion} " )
33
+ if (t. jrubyConfigurationName != proj. configurations. jrubyExec) {
34
+ proj. dependencies. add(t. jrubyConfigurationName,
35
+ " org.jruby:jruby-complete:${ t.jrubyVersion} " )
35
36
}
36
37
}
37
38
}
@@ -78,16 +79,18 @@ class JRubyExec extends JavaExec {
78
79
script= fName
79
80
break
80
81
case String :
81
- script= new File (fName)
82
+ script = new File (fName)
82
83
break
83
84
default :
84
- script= new File (fName. toString())
85
+ script = new File (fName. toString())
85
86
}
86
87
}
87
88
88
89
/* * Returns a list of script arguments
89
90
*/
90
- List<String > scriptArgs () {CollectionUtils . stringize(this . scriptArgs)}
91
+ List<String > scriptArgs () {
92
+ CollectionUtils . stringize(this . scriptArgs)
93
+ }
91
94
92
95
/* * Set arguments for script
93
96
*
@@ -99,7 +102,9 @@ class JRubyExec extends JavaExec {
99
102
100
103
/* * Returns a list of jruby arguments
101
104
*/
102
- List<String > jrubyArgs () {CollectionUtils . stringize(this . jrubyArgs)}
105
+ List<String > jrubyArgs () {
106
+ CollectionUtils . stringize(this . jrubyArgs)
107
+ }
103
108
104
109
/* * Set arguments for jruby
105
110
*
@@ -117,7 +122,7 @@ class JRubyExec extends JavaExec {
117
122
* @param version String in the form '1.7.13'
118
123
*/
119
124
void setJrubyVersion (final String version ) {
120
- if (version == project. jruby. execVersion) {
125
+ if (version == project. jruby. execVersion) {
121
126
jrubyConfigurationName = JRUBYEXEC_CONFIG
122
127
} else {
123
128
final String cfgName= ' jrubyExec$$' + name
@@ -129,17 +134,22 @@ class JRubyExec extends JavaExec {
129
134
130
135
@Override
131
136
void exec () {
132
- if (configuration == null && jrubyConfigurationName == JRUBYEXEC_CONFIG ) {
137
+ if (configuration == null && jrubyConfigurationName == JRUBYEXEC_CONFIG ) {
133
138
configuration = JRUBYEXEC_CONFIG
134
139
}
135
140
136
141
GemUtils.OverwriteAction overwrite = project. gradle. startParameter. refreshDependencies ? GemUtils.OverwriteAction . OVERWRITE : GemUtils.OverwriteAction . SKIP
137
142
def jrubyCompletePath = project. configurations. getByName(jrubyConfigurationName)
138
143
File gemDir = tmpGemDir()
144
+ File path = new File ([project. buildDir,
145
+ ' tmp' ,
146
+ configuration,
147
+ ' bin' ]. join(File . separator))
139
148
gemDir. mkdirs()
140
- environment ' GEM_HOME' : gemDir
149
+ environment ' GEM_HOME' : gemDir,
150
+ ' PATH' : path. absolutePath + File . pathSeparatorChar + environment. PATH
141
151
142
- if (configuration != null ) {
152
+ if (configuration != null ) {
143
153
GemUtils . extractGems(
144
154
project,
145
155
jrubyCompletePath,
@@ -174,7 +184,7 @@ class JRubyExec extends JavaExec {
174
184
175
185
@Override
176
186
JavaExec setMain (final String mainClassName ) {
177
- if (mainClassName == ' org.jruby.Main' ) {
187
+ if (mainClassName == ' org.jruby.Main' ) {
178
188
super . setMain(mainClassName)
179
189
} else {
180
190
throw notAllowed(" Setting main class for jruby to ${ mainClassName} is not a valid operation" )
@@ -208,7 +218,7 @@ class JRubyExec extends JavaExec {
208
218
209
219
private File tmpGemDir () {
210
220
String ext = FileUtils . toSafeFileName(jrubyConfigurationName)
211
- if (configuration && configuration!= jrubyConfigurationName) {
221
+ if (configuration && configuration != jrubyConfigurationName) {
212
222
ext= ext + " -${ FileUtils.toSafeFileName(configuration)} "
213
223
}
214
224
new File ( project. buildDir, " tmp/${ ext} " ). absoluteFile
0 commit comments