jruby-launcher 1.0.11-java → 1.0.12-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/argparser.cpp CHANGED
@@ -351,6 +351,9 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
351
351
  }
352
352
 
353
353
  void ArgParser::prepareOptions() {
354
+ list<string> userOptions(javaOptions);
355
+ javaOptions.clear();
356
+
354
357
  string option = OPT_JDK_HOME;
355
358
  option += jdkhome;
356
359
  javaOptions.push_back(option);
@@ -398,7 +401,7 @@ void ArgParser::prepareOptions() {
398
401
  #endif
399
402
  javaOptions.push_back(option);
400
403
 
401
- setupMaxHeapAndStack();
404
+ setupMaxHeapAndStack(userOptions);
402
405
 
403
406
  constructBootClassPath();
404
407
  constructClassPath();
@@ -429,13 +432,14 @@ void ArgParser::prepareOptions() {
429
432
  javaOptions.push_back(option);
430
433
  }
431
434
 
435
+ javaOptions.insert(javaOptions.end(), userOptions.begin(), userOptions.end());
432
436
  }
433
437
 
434
- void ArgParser::setupMaxHeapAndStack() {
438
+ void ArgParser::setupMaxHeapAndStack(list<string> userOptions) {
435
439
  // Hard-coded 500m, 2048k is for consistency with jruby shell script.
436
440
  string heapSize("500m"), stackSize("2048k");
437
441
  bool maxHeap = false, maxStack = false;
438
- for (list<string>::iterator it = javaOptions.begin(); it != javaOptions.end(); it++) {
442
+ for (list<string>::iterator it = userOptions.begin(); it != userOptions.end(); it++) {
439
443
  if (!maxHeap && strncmp("-Xmx", it->c_str(), 4) == 0) {
440
444
  heapSize = it->substr(4, it->size() - 4);
441
445
  maxHeap = true;
data/argparser.h CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2009-2010 JRuby Team (www.jruby.org).
2
+ * Copyright 2009-2012 JRuby Team (www.jruby.org).
3
3
  */
4
4
 
5
5
 
@@ -41,7 +41,7 @@ protected:
41
41
 
42
42
  bool initPlatformDir();
43
43
  void prepareOptions();
44
- void setupMaxHeapAndStack();
44
+ void setupMaxHeapAndStack(std::list<std::string> userOptions);
45
45
  void addEnvVarToOptions(std::list<std::string> & optionsList, const char * envvar);
46
46
  void constructClassPath();
47
47
  void constructBootClassPath();
@@ -1,3 +1,3 @@
1
1
  module JRubyLauncher
2
- VERSION = "1.0.11"
2
+ VERSION = "1.0.12"
3
3
  end
@@ -210,6 +210,13 @@ describe "JRuby native launcher" do
210
210
  end
211
211
  end
212
212
 
213
+ it "should place user-supplied options after default options" do
214
+ args = jruby_launcher_args("-J-Djruby.home=/tmp")
215
+ home_args = args.select {|x| x =~ /^-Djruby\.home/ }
216
+ home_args.length.should == 2
217
+ home_args.last.should == "-Djruby.home=/tmp"
218
+ end
219
+
213
220
  it "should print the version" do
214
221
  jruby_launcher("-Xversion 2>&1").should =~ /Launcher Version #{JRubyLauncher::VERSION}/
215
222
  end
data/version.h CHANGED
@@ -6,6 +6,6 @@
6
6
  #ifndef _VERSION_H_
7
7
  #define _VERSION_H_
8
8
 
9
- #define JRUBY_LAUNCHER_VERSION "1.0.11"
9
+ #define JRUBY_LAUNCHER_VERSION "1.0.12"
10
10
 
11
11
  #endif // ! _VERSION_H_
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jruby-launcher
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.11
5
+ version: 1.0.12
6
6
  platform: java
7
7
  authors:
8
8
  - Nick Sieger
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2012-01-09 00:00:00 Z
14
+ date: 2012-01-10 00:00:00 Z
15
15
  dependencies: []
16
16
 
17
17
  description: Builds and installs a native launcher for JRuby on your system