warbler 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 218126abf1ff5e8886c7d9d83efe2a59e2be9dd2
4
- data.tar.gz: 2e21c4ae9e9f89c80cbdf49b756954f6c1196f28
3
+ metadata.gz: adcf60dd9c5beca381437bfffd9daeb02ec4f6fb
4
+ data.tar.gz: d83655891a2cf7374b5a2ba9a78ce42c0c97553f
5
5
  SHA512:
6
- metadata.gz: af36e2a2b51ca6992acdb4878fb954d4e28b4d6881a5f22e50b86cba6cd68f748b9f37a63e3b2ae690238687910cd2ae31059671150f65e7e36880002eb22bba
7
- data.tar.gz: f73c4d6797f23a5e3780c921485b6302057d7673d2e7404efa23f00ba439cbbb504227f45abb441a74e243605405f95e34bfec1a2af81a4108f952203e0d587f
6
+ metadata.gz: 072c00735322852bcd2dbabdd9d49c5d0c7730be4900799011d480a99e02ece106d1b77f288d68bee868d2f6aba162d6c6c5beeaf0c3dfa82165e0870dde76da
7
+ data.tar.gz: 8f7e1cd06ffc11a0d337aee62a3c6474e97189ec1bc14277e16fd8e196470ae3316f5d8395b8ef38f07119ae1f2ee60d75cf194c1c7a2b857c45a0460cb09791
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  branches:
4
4
  only:
5
5
  - master
6
+ - 2.x-dev
6
7
  env:
7
8
  - JRUBY_OPTS="--1.8 --server -Xcext.enabled=false -Xcompile.invokedynamic=false"
8
9
  - JRUBY_OPTS="--1.9 --server -Xcext.enabled=false -Xcompile.invokedynamic=false"
data/History.txt CHANGED
@@ -1,6 +1,10 @@
1
1
  == Master
2
2
 
3
+ - Added the ability to set custom port for Jetty launcher with
4
+ warbler.port or PORT env var
5
+
3
6
  == 1.4.6
7
+ - #318: polish *scripts/rails* - require_relative should no longer be used
4
8
  - #315: Removed custom Jetty launcher in favor of jetty-runner
5
9
  - #316: Sprockets manifest name change
6
10
  - #313: Update Jetty to 9.2.10
data/README.rdoc CHANGED
@@ -7,6 +7,8 @@ all of your application files for deployment to a Java environment.
7
7
  Warbler provides a sane set of out-of-the box defaults that should allow most
8
8
  Ruby applications to assemble and Just Work.
9
9
 
10
+ Version 1.4.x of Warbler supports versions of JRuby up to 1.7.x. The {2.x-dev branch}[https://github.com/jruby/warbler/tree/2.x-dev] contains work related to JRuby 9k.
11
+
10
12
  == Getting Started
11
13
 
12
14
  1. Install the gem: <tt>gem install warbler</tt>.
data/ext/WarMain.java CHANGED
@@ -59,7 +59,7 @@ import java.util.Set;
59
59
  * </pre>
60
60
  */
61
61
  public class WarMain extends JarMain {
62
-
62
+
63
63
  static final String MAIN = "/" + WarMain.class.getName().replace('.', '/') + ".class";
64
64
  static final String WEBSERVER_PROPERTIES = "/WEB-INF/webserver.properties";
65
65
  static final String WEBSERVER_JAR = "/WEB-INF/webserver.jar";
@@ -78,7 +78,7 @@ public class WarMain extends JarMain {
78
78
  */
79
79
  private final String executable;
80
80
  private final String[] executableArgv;
81
-
81
+
82
82
  private File webroot;
83
83
 
84
84
  WarMain(final String[] args) {
@@ -102,12 +102,12 @@ public class WarMain extends JarMain {
102
102
  // The rails executable doesn't play well with ScriptingContainer, so we've packaged the
103
103
  // same script that would have been generated by `rake rails:update:bin`
104
104
  execArg = "./META-INF/rails.rb";
105
- }
105
+ }
106
106
 
107
107
  executable = execArg;
108
108
  }
109
109
  }
110
-
110
+
111
111
  private URL extractWebserver() throws Exception {
112
112
  this.webroot = File.createTempFile("warbler", "webroot");
113
113
  this.webroot.delete();
@@ -139,9 +139,13 @@ public class WarMain extends JarMain {
139
139
  if ( is != null ) props.load(is);
140
140
  } catch (Exception e) { }
141
141
 
142
+ String port = System.getProperty("warbler.port", System.getenv("PORT"));
143
+ port = port == null ? "8080" : port;
142
144
  for (Map.Entry entry : props.entrySet()) {
143
145
  String val = (String) entry.getValue();
144
- val = val.replace("{{warfile}}", archive).replace("{{webroot}}", webroot.getAbsolutePath());
146
+ val = val.replace("{{warfile}}", archive).
147
+ replace("{{port}}", port).
148
+ replace("{{webroot}}", webroot.getAbsolutePath());
145
149
  entry.setValue(val);
146
150
  }
147
151
 
@@ -198,15 +202,15 @@ public class WarMain extends JarMain {
198
202
  return newArgs;
199
203
  }
200
204
 
201
- // JarMain overrides to make WarMain "launchable"
205
+ // JarMain overrides to make WarMain "launchable"
202
206
  // e.g. java -jar rails.war -S rake db:migrate
203
-
207
+
204
208
  @Override
205
209
  protected String getExtractEntryPath(final JarEntry entry) {
206
210
  final String name = entry.getName();
207
211
  final String start = "WEB-INF";
208
212
  if ( name.startsWith(start) ) {
209
- // WEB-INF/app/controllers/application_controller.rb ->
213
+ // WEB-INF/app/controllers/application_controller.rb ->
210
214
  // app/controllers/application_controller.rb
211
215
  return name.substring(start.length());
212
216
  }
@@ -216,14 +220,14 @@ public class WarMain extends JarMain {
216
220
  }
217
221
  return "/" + name;
218
222
  }
219
-
223
+
220
224
  @Override
221
225
  protected URL extractEntry(final JarEntry entry, final String path) throws Exception {
222
226
  // always extract but only return class-path entry URLs :
223
227
  final URL entryURL = super.extractEntry(entry, path);
224
228
  return path.endsWith(".jar") ? entryURL : null;
225
229
  }
226
-
230
+
227
231
  @Override
228
232
  protected int launchJRuby(final URL[] jars) throws Exception {
229
233
  final Object scriptingContainer = newScriptingContainer(jars);
@@ -234,31 +238,31 @@ public class WarMain extends JarMain {
234
238
 
235
239
  final Object provider = invokeMethod(scriptingContainer, "getProvider");
236
240
  final Object rubyInstanceConfig = invokeMethod(provider, "getRubyInstanceConfig");
237
-
241
+
238
242
  invokeMethod(rubyInstanceConfig, "setUpdateNativeENVEnabled", new Class[] { Boolean.TYPE }, false);
239
-
243
+
240
244
  final String executablePath = locateExecutable(scriptingContainer);
241
245
  if ( executablePath == null ) {
242
246
  throw new IllegalStateException("failed to locate gem executable: '" + executable + "'");
243
247
  }
244
248
  invokeMethod(scriptingContainer, "setScriptFilename", executablePath);
245
-
249
+
246
250
  invokeMethod(rubyInstanceConfig, "processArguments", (Object) arguments);
247
-
251
+
248
252
  Object runtime = invokeMethod(scriptingContainer, "getRuntime");
249
253
  Object executableInput =
250
254
  new SequenceInputStream(new ByteArrayInputStream(executableScriptEnvPrefix().getBytes()),
251
255
  (InputStream) invokeMethod(rubyInstanceConfig, "getScriptSource"));
252
-
256
+
253
257
  debug("invoking " + executablePath + " with: " + Arrays.toString(executableArgv));
254
-
255
- Object outcome = invokeMethod(runtime, "runFromMain",
256
- new Class[] { InputStream.class, String.class },
257
- executableInput, executablePath
258
+
259
+ Object outcome = invokeMethod(runtime, "runFromMain",
260
+ new Class[] { InputStream.class, String.class },
261
+ executableInput, executablePath
258
262
  );
259
263
  return ( outcome instanceof Number ) ? ( (Number) outcome ).intValue() : 0;
260
264
  }
261
-
265
+
262
266
  protected String locateExecutable(final Object scriptingContainer) throws Exception {
263
267
  if ( executable == null ) {
264
268
  throw new IllegalStateException("no executable");
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "1.4.6"
9
+ VERSION = "1.4.7"
10
10
  end
@@ -124,9 +124,11 @@ PROPS
124
124
  super
125
125
  jar.files["WEB-INF/webserver.properties"] = StringIO.new(<<-PROPS)
126
126
  mainclass = org.eclipse.jetty.runner.Runner
127
- args = args0
127
+ args = args0,args1,args2
128
128
  props = jetty.home
129
- args0 = {{warfile}}
129
+ args0 = --port
130
+ args1 = {{port}}
131
+ args2 = {{warfile}}
130
132
  jetty.home = {{webroot}}
131
133
  PROPS
132
134
  end
data/lib/warbler_jar.jar CHANGED
Binary file
metadata CHANGED
@@ -1,145 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sieger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.6
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
- - - ">="
22
+ - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: 0.9.6
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jruby-jars
29
- requirement: !ruby/object:Gem::Requirement
29
+ version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.6
34
- - - "<"
34
+ - - <
35
35
  - !ruby/object:Gem::Version
36
36
  version: '2.0'
37
- type: :runtime
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
37
+ requirement: !ruby/object:Gem::Requirement
40
38
  requirements:
41
- - - ">="
39
+ - - '>='
42
40
  - !ruby/object:Gem::Version
43
41
  version: 1.5.6
44
- - - "<"
42
+ - - <
45
43
  - !ruby/object:Gem::Version
46
44
  version: '2.0'
45
+ prerelease: false
46
+ type: :runtime
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jruby-rack
49
- requirement: !ruby/object:Gem::Requirement
49
+ version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.1.1
54
- - - "<"
54
+ - - <
55
55
  - !ruby/object:Gem::Version
56
56
  version: '1.3'
57
- type: :runtime
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: !ruby/object:Gem::Requirement
60
58
  requirements:
61
- - - ">="
59
+ - - '>='
62
60
  - !ruby/object:Gem::Version
63
61
  version: 1.1.1
64
- - - "<"
62
+ - - <
65
63
  - !ruby/object:Gem::Version
66
64
  version: '1.3'
65
+ prerelease: false
66
+ type: :runtime
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rubyzip
69
- requirement: !ruby/object:Gem::Requirement
69
+ version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
71
+ - - '>='
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0.9'
74
- - - "<"
74
+ - - <
75
75
  - !ruby/object:Gem::Version
76
76
  version: '1.2'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
77
+ requirement: !ruby/object:Gem::Requirement
80
78
  requirements:
81
- - - ">="
79
+ - - '>='
82
80
  - !ruby/object:Gem::Version
83
81
  version: '0.9'
84
- - - "<"
82
+ - - <
85
83
  - !ruby/object:Gem::Version
86
84
  version: '1.2'
85
+ prerelease: false
86
+ type: :runtime
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: jbundler
89
- requirement: !ruby/object:Gem::Requirement
89
+ version_requirements: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - "~>"
91
+ - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.5.5
94
- type: :development
95
- prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
94
+ requirement: !ruby/object:Gem::Requirement
97
95
  requirements:
98
- - - "~>"
96
+ - - ~>
99
97
  - !ruby/object:Gem::Version
100
98
  version: 0.5.5
99
+ prerelease: false
100
+ type: :development
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: ruby-maven
103
- requirement: !ruby/object:Gem::Requirement
103
+ version_requirements: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - "~>"
105
+ - - ~>
106
106
  - !ruby/object:Gem::Version
107
107
  version: 3.1.1.0
108
- type: :development
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
108
+ requirement: !ruby/object:Gem::Requirement
111
109
  requirements:
112
- - - "~>"
110
+ - - ~>
113
111
  - !ruby/object:Gem::Version
114
112
  version: 3.1.1.0
113
+ prerelease: false
114
+ type: :development
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: rspec
117
- requirement: !ruby/object:Gem::Requirement
117
+ version_requirements: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - "~>"
119
+ - - ~>
120
120
  - !ruby/object:Gem::Version
121
121
  version: '2.10'
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
122
+ requirement: !ruby/object:Gem::Requirement
125
123
  requirements:
126
- - - "~>"
124
+ - - ~>
127
125
  - !ruby/object:Gem::Version
128
126
  version: '2.10'
127
+ prerelease: false
128
+ type: :development
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rdoc
131
- requirement: !ruby/object:Gem::Requirement
131
+ version_requirements: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - ">="
133
+ - - '>='
134
134
  - !ruby/object:Gem::Version
135
135
  version: 2.4.2
136
- type: :development
137
- prerelease: false
138
- version_requirements: !ruby/object:Gem::Requirement
136
+ requirement: !ruby/object:Gem::Requirement
139
137
  requirements:
140
- - - ">="
138
+ - - '>='
141
139
  - !ruby/object:Gem::Version
142
140
  version: 2.4.2
141
+ prerelease: false
142
+ type: :development
143
143
  description: |-
144
144
  Warbler is a gem to make a Java jar or war file out of any Ruby,
145
145
  Rails, or Rack application. Warbler provides a minimal, flexible, Ruby-like way to
@@ -150,8 +150,8 @@ executables:
150
150
  extensions: []
151
151
  extra_rdoc_files: []
152
152
  files:
153
- - ".gitignore"
154
- - ".travis.yml"
153
+ - .gitignore
154
+ - .travis.yml
155
155
  - Gemfile
156
156
  - History.txt
157
157
  - LICENSE.txt
@@ -370,29 +370,29 @@ homepage: https://github.com/jruby/warbler
370
370
  licenses:
371
371
  - MIT
372
372
  metadata: {}
373
- post_install_message:
373
+ post_install_message:
374
374
  rdoc_options:
375
- - "--main"
375
+ - --main
376
376
  - README.rdoc
377
- - "-H"
378
- - "-f"
377
+ - -H
378
+ - -f
379
379
  - darkfish
380
380
  require_paths:
381
381
  - lib
382
382
  required_ruby_version: !ruby/object:Gem::Requirement
383
383
  requirements:
384
- - - ">="
384
+ - - '>='
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0'
387
387
  required_rubygems_version: !ruby/object:Gem::Requirement
388
388
  requirements:
389
- - - ">="
389
+ - - '>='
390
390
  - !ruby/object:Gem::Version
391
391
  version: '0'
392
392
  requirements: []
393
- rubyforge_project:
393
+ rubyforge_project:
394
394
  rubygems_version: 2.4.5
395
- signing_key:
395
+ signing_key:
396
396
  specification_version: 4
397
397
  summary: Warbler chirpily constructs .war files of your Rails applications.
398
398
  test_files: