jettywrapper 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/jettywrapper.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  # Jettywrapper is a Singleton class, so you can only create one jetty instance at a time.
2
- #require 'logger'
3
2
  require 'loggable'
4
3
  require 'singleton'
5
4
  require 'fileutils'
@@ -17,7 +16,6 @@ class Jettywrapper
17
16
  include Singleton
18
17
  include Loggable
19
18
 
20
- attr_accessor :pid # If Jettywrapper is running, what pid is it running as?
21
19
  attr_accessor :port # What port should jetty start on? Default is 8888
22
20
  attr_accessor :jetty_home # Where is jetty located?
23
21
  attr_accessor :startup_wait # After jetty starts, how long to wait until starting the tests?
@@ -110,15 +108,8 @@ class Jettywrapper
110
108
  def wrap(params)
111
109
  error = false
112
110
  jetty_server = self.configure(params)
113
- # jetty_server = self.instance
114
- # jetty_server.quiet = params[:quiet] || true
115
- # jetty_server.jetty_home = params[:jetty_home]
116
- # jetty_server.solr_home = params[:solr_home]
117
- # jetty_server.port = params[:jetty_port] || 8888
118
- # jetty_server.startup_wait = params[:startup_wait] || 5
119
111
 
120
112
  begin
121
- # puts "starting jetty on #{RUBY_PLATFORM}"
122
113
  jetty_server.start
123
114
  sleep jetty_server.startup_wait
124
115
  yield
@@ -136,7 +127,7 @@ class Jettywrapper
136
127
  # Convenience method for configuring and starting jetty with one command
137
128
  # @param [Hash] params: The configuration to use for starting jetty
138
129
  # @example
139
- # Jettywrapper.start_with_params(:jetty_home => '/path/to/jetty', :jetty_port => '8983')
130
+ # Jettywrapper.start(:jetty_home => '/path/to/jetty', :jetty_port => '8983')
140
131
  def start(params)
141
132
  Jettywrapper.configure(params)
142
133
  Jettywrapper.instance.start
@@ -283,7 +274,7 @@ class Jettywrapper
283
274
  # Jettywrapper.instance.stop
284
275
  # return Jettywrapper.instance
285
276
  def stop
286
- logger.debug "Instance stop method called for pid #{pid}"
277
+ logger.debug "Instance stop method called for pid '#{pid}'"
287
278
  if pid
288
279
  process = ChildProcess.new
289
280
  process.instance_variable_set(:@pid, pid)
@@ -299,7 +290,8 @@ class Jettywrapper
299
290
 
300
291
  # The fully qualified path to the pid_file
301
292
  def pid_path
302
- File.join(pid_dir, pid_file)
293
+ #need to memoize this, becasuse the base path could be relative and the cwd can change in the yield block of wrap
294
+ @path ||= File.join(pid_dir, pid_file)
303
295
  end
304
296
 
305
297
  # The file where the process ID will be written
@@ -1 +1 @@
1
- GEMVERSION = "1.0.3"
1
+ GEMVERSION = "1.0.4"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jettywrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bess Sadler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-10 00:00:00 -06:00
18
+ date: 2011-11-11 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency