warbler 2.0.0.pre3 → 2.0.0.rc1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d31d6ea8e9517b3bec30f6ecc1d57e07abca5cc
4
- data.tar.gz: b169c88d2f189e344e4b97202527425ef8c224a1
3
+ metadata.gz: b2801a442163c3d1ada84111848c7d9871e9939e
4
+ data.tar.gz: ae5fbcb30cb8086e3d730bddeed52bad02ea8c56
5
5
  SHA512:
6
- metadata.gz: f078ebde72c8dfd391f5febca7a148380c4ec96e264a7b29a1d816684e4f393bf843fa19d7faf1c3e11d88713eb90e63867796cc7ab377861d7c86707f47e332
7
- data.tar.gz: cf5cb23cca94d825f33d4f0760e61a8e6a4a4ace8c2ad667f2738a50989c081301e38521c34d69e5961fb3ed085f4168630545eeaa0cc9b6dc36372cb80c5188
6
+ metadata.gz: 676d710d120a35a2464cc2a506a6dfa5c53c2fd90e9439064ea0f19753497ae0161a4b12a986376404e10c9c63511d71d67f535846219ffdc3d92ba52327f8a7
7
+ data.tar.gz: c47699f10bcb5de09b4f09625f20697449f6677704852c249fbc715a2b2d11d9c7deae708e49521f1ed74432e9846bb238b4896309564254417bd716e99dce5c
data/ext/WarMain.java CHANGED
@@ -39,17 +39,21 @@ import java.util.Set;
39
39
  * creates a URL classloader holding the jar, and loads and invokes the
40
40
  * <tt>main</tt> method of the main class mentioned in the properties.
41
41
  *
42
- * An example webserver.properties follows for Winstone. The <tt>args</tt>
42
+ * An example webserver.properties follows for Jetty. The <tt>args</tt>
43
43
  * property indicates the names and ordering of other properties to be used
44
44
  * as command-line arguments. The special tokens <tt>{{warfile}}</tt> and
45
45
  * <tt>{{webroot}}</tt> are substituted with the location of the .war file
46
46
  * being run and the temporary work directory, respectively.
47
47
  * <pre>
48
- * mainclass = winstone.Launcher
49
- * args = args0,args1,args2
50
- * args0 = --warfile={{warfile}}
51
- * args1 = --webroot={{webroot}}
52
- * args2 = --directoryListings=false
48
+ * mainclass = org.eclipse.jetty.runner.Runner
49
+ * args = args0,args1,args2,args3,args4
50
+ * props = jetty.home
51
+ * args0 = --port
52
+ * args1 = {{port}}
53
+ * args2 = --config
54
+ * args3 = {{config}}
55
+ * args4 = {{warfile}}
56
+ * jetty.home = {{webroot}}
53
57
  * </pre>
54
58
  *
55
59
  * System properties can also be set via webserver.properties. For example,
@@ -143,6 +147,7 @@ public class WarMain extends JarMain {
143
147
 
144
148
  String port = getSystemProperty("warbler.port", getENV("PORT"));
145
149
  port = port == null ? "8080" : port;
150
+ String host = getSystemProperty("warbler.host", "0.0.0.0");
146
151
  String webserverConfig = getSystemProperty("warbler.webserver_config", getENV("WARBLER_WEBSERVER_CONFIG"));
147
152
  String embeddedWebserverConfig = new URI("jar", entryPath(WEBSERVER_CONFIG), null).toURL().toString();
148
153
  webserverConfig = webserverConfig == null ? embeddedWebserverConfig : webserverConfig;
@@ -150,6 +155,7 @@ public class WarMain extends JarMain {
150
155
  String val = (String) entry.getValue();
151
156
  val = val.replace("{{warfile}}", archive).
152
157
  replace("{{port}}", port).
158
+ replace("{{host}}", host).
153
159
  replace("{{config}}", webserverConfig).
154
160
  replace("{{webroot}}", webroot.getAbsolutePath());
155
161
  entry.setValue(val);
@@ -180,17 +186,6 @@ public class WarMain extends JarMain {
180
186
  String[] newArgs = launchWebServerArguments(props);
181
187
  debug("invoking webserver with: " + Arrays.deepToString(newArgs));
182
188
  main.invoke(null, new Object[] { newArgs });
183
-
184
- // the following code is specific to winstone. but a whole winstone module like the jetty module seemed
185
- // excessive. if running under jetty (or anything other than wintstone) this will effectively do nothing.
186
- Set<Thread> threads = Thread.getAllStackTraces().keySet();
187
- for (Thread thread : threads) {
188
- String name = thread.getName();
189
- if (name.startsWith("LauncherControlThread")) {
190
- debug("joining thread: " + name);
191
- thread.join();
192
- }
193
- }
194
189
  }
195
190
 
196
191
  private String[] launchWebServerArguments(Properties props) {
@@ -167,8 +167,6 @@ module Warbler
167
167
  attr_accessor :webxml
168
168
 
169
169
  # Embedded webserver to use. Currently supported webservers are:
170
- # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
171
- # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
172
170
  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
173
171
  attr_accessor :webserver
174
172
 
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "2.0.0.pre3"
9
+ VERSION = "2.0.0.rc1"
10
10
  end
@@ -86,33 +86,6 @@ module Warbler
86
86
  end
87
87
  end
88
88
 
89
- class WinstoneServer < WebServer
90
- def initialize
91
- @artifact = Artifact.new(ENV["MAVEN_REPO"] || "http://repo2.maven.org/maven2",
92
- "net.sourceforge.winstone", "winstone-lite",
93
- ENV["WEBSERVER_VERSION"] || "0.9.10")
94
- end
95
-
96
- def add(jar)
97
- super
98
- jar.files["WEB-INF/webserver.properties"] = StringIO.new(<<-PROPS)
99
- mainclass = winstone.Launcher
100
- args = args0,args1,args2
101
- args0 = --warfile={{warfile}}
102
- args1 = --webroot={{webroot}}
103
- args2 = --directoryListings=false
104
- PROPS
105
- end
106
- end
107
-
108
- class JenkinsWinstoneServer < WinstoneServer
109
- def initialize
110
- @artifact = Artifact.new("http://repo.jenkins-ci.org/public",
111
- "org.jenkins-ci", "winstone",
112
- ENV["WEBSERVER_VERSION"] || "0.9.10-jenkins-43")
113
- end
114
- end
115
-
116
89
  class JettyServer < WebServer
117
90
  def initialize
118
91
  @artifact = Artifact.new(ENV["MAVEN_REPO"] || "http://repo2.maven.org/maven2",
@@ -132,21 +105,21 @@ CONFIG
132
105
 
133
106
  jar.files["WEB-INF/webserver.properties"] = StringIO.new(<<-PROPS)
134
107
  mainclass = org.eclipse.jetty.runner.Runner
135
- args = args0,args1,args2,args3,args4
108
+ args = args0,args1,args2,args3,args4,args5,args6
136
109
  props = jetty.home
137
- args0 = --port
138
- args1 = {{port}}
139
- args2 = --config
140
- args3 = {{config}}
141
- args4 = {{warfile}}
110
+ args0 = --host
111
+ args1 = {{host}}
112
+ args2 = --port
113
+ args3 = {{port}}
114
+ args4 = --config
115
+ args5 = {{config}}
116
+ args6 = {{warfile}}
142
117
  jetty.home = {{webroot}}
143
118
  PROPS
144
119
  end
145
120
  end
146
121
 
147
122
  WEB_SERVERS = Hash.new { |hash,_| hash['jetty'] }
148
- WEB_SERVERS['winstone'] = WinstoneServer.new
149
- WEB_SERVERS['jenkins-ci.winstone'] = JenkinsWinstoneServer.new
150
123
  WEB_SERVERS['jetty'] = JettyServer.new
151
124
 
152
125
  end
data/lib/warbler_jar.jar CHANGED
Binary file
@@ -21,8 +21,8 @@ describe Warbler::WebServer::Artifact do
21
21
  end
22
22
 
23
23
  let(:sample_artifact) do
24
- Warbler::WebServer::Artifact.new("http://repo.jenkins-ci.org/public",
25
- "org.jenkins-ci", "winstone", "0.9.10-jenkins-43"
24
+ Warbler::WebServer::Artifact.new(
25
+ "http://repo2.maven.org/maven2", "org.eclipse.jetty", "jetty-runner", "9.2.9.v20150224"
26
26
  )
27
27
  end
28
28
 
data/warble.rb CHANGED
@@ -143,8 +143,6 @@ Warbler::Config.new do |config|
143
143
 
144
144
  # Embedded webserver to use with the 'executable' feature. Currently supported
145
145
  # webservers are:
146
- # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
147
- # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
148
146
  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
149
147
  # config.webserver = 'jetty'
150
148
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre3
4
+ version: 2.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sieger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-31 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement