heel 3.1.2 → 3.1.3

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: 3399d8178f772d4ee49f04043572be6d9f70d2fd
4
- data.tar.gz: f34d5119b094801f39bd47f00791b415e97555a1
3
+ metadata.gz: 8de35e1a0be02782a8ae61c13b387b0248671a75
4
+ data.tar.gz: 42aa82f5bd32867dc4fd06f20345be8d0955fe24
5
5
  SHA512:
6
- metadata.gz: 919208df9a5929ad044a896529055c9e15f1af077c50dcd20c805f10145c15f8f964adf16742cc954c435ca5eb3206b8f5e8cba3efe64c578f93ded918250d70
7
- data.tar.gz: d1cb4ed0a1de12646c370eaa8629ed9a5d27619dd17a0ebd6b3996f23294f3a54016a1cf9a57c8e03945b446cb5eb873f5c0ee4386cc8222236bcf7e445d8099
6
+ metadata.gz: d3ebbc2d3fc0964c8eaa9898a0ce445dc11c7bc9bedf481075ba13db6afd6f85369237dd1512771f898bbdc7798618d3e9cb5954b6bb2a1ab0cf5331e14e5f6d
7
+ data.tar.gz: a6692022c04dad0a61ffd5e83e31a7317ab0a53f1770822d668da48499c341f61f2f24ebd8b0fe57095749d93365a16675a30faefcf018e9870941cd95560a1c
@@ -37,6 +37,7 @@ easiest way to contribute.
37
37
 
38
38
  * [Jeremy Hinegardner][https://github.com/copiousfreetime]
39
39
  * [Chris Wanstrath][http://github.com/defunkt]
40
+ * [Justin Hill][http://github.com/justindhill]
40
41
 
41
42
  [GitHub Account]: https://github.com/signup/free "GitHub Signup"
42
43
  [GitHub Issues]: https://github.com/copiousfreetime/heel/issues "Heel Issues"
data/HISTORY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 3.1.3 - 2013-11-26
4
+ * URL encode the links to files [#14](https://github.com/copiousfreetime/heel/issues/14)
5
+ * Fix pid file cleanup on ruby 2.0 [#15](https://github.com/copiousfreetime/heel/issues/15)
6
+
3
7
  ## Version 3.1.2 - 2013-10-16
4
8
  * Fix usage of Mime::Types [#12](https://github.com/copiousfreetime/heel/issues/12) [#13](https://github.com/copiousfreetime/heel/issues/13)
5
9
 
@@ -4,7 +4,7 @@
4
4
  #++
5
5
 
6
6
  module Heel
7
- VERSION = '3.1.2'
7
+ VERSION = '3.1.3'
8
8
  end
9
9
 
10
10
  require 'heel/configuration'
@@ -66,7 +66,7 @@ module Heel
66
66
  entry_data = OpenStruct.new
67
67
 
68
68
  entry_data.name = entry == ".." ? "Parent Directory" : entry
69
- entry_data.link = entry
69
+ entry_data.link = ERB::Util.url_encode(entry)
70
70
  entry_data.size = num_to_bytes(stat.size)
71
71
  entry_data.last_modified = stat.mtime.strftime("%Y-%m-%d %H:%M:%S")
72
72
 
@@ -237,21 +237,31 @@ module Heel
237
237
  return stack.to_app
238
238
  end
239
239
 
240
+ # If we are daemonizing the fork and wait for the child to launch the server
241
+ # If we are not daemonizing, throw the Rack::Server in a background thread
240
242
  def start_server
241
- server_thread = Thread.new do
242
- if options.daemonize then
243
- if cpid = fork then
244
- Process.waitpid( cpid )
245
- else
246
- server = Rack::Server.new( server_options )
247
- server.start
248
- end
249
- else
250
- server = Rack::Server.new( server_options )
251
- server.start
252
- end
243
+ if options.daemonize then
244
+ start_background_server
245
+ return nil
246
+ else
247
+ return start_foreground_server
253
248
  end
254
- return server_thread
249
+ end
250
+
251
+ def start_background_server
252
+ if cpid = fork then
253
+ Process.waitpid( cpid )
254
+ else
255
+ server = Rack::Server.new( server_options )
256
+ server.start
257
+ end
258
+ end
259
+
260
+ def start_foreground_server
261
+ Thread.new {
262
+ server = Rack::Server.new( server_options )
263
+ server.start
264
+ }
255
265
  end
256
266
 
257
267
  def server_options
@@ -279,7 +289,7 @@ module Heel
279
289
  if options.launch_browser then
280
290
  launch_browser.join
281
291
  end
282
- server_thread.join
292
+ server_thread.join if server_thread
283
293
  end
284
294
  end
285
295
  end
@@ -12,7 +12,7 @@ namespace :develop do
12
12
  # gemspec.
13
13
  task :default do
14
14
  require 'rubygems/dependency_installer'
15
- installer = Gem::DependencyInstaller.new
15
+ installer = ::Gem::DependencyInstaller.new
16
16
 
17
17
  This.set_coverage_gem
18
18
 
@@ -235,7 +235,7 @@ CLOBBER << FileList["**/*.rbc"]
235
235
 
236
236
  # The standard gem packaging task, everyone has it.
237
237
  require 'rubygems/package_task'
238
- Gem::PackageTask.new( This.platform_gemspec ) do
238
+ ::Gem::PackageTask.new( This.platform_gemspec ) do
239
239
  # nothing
240
240
  end
241
241
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heel
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-16 00:00:00.000000000 Z
11
+ date: 2013-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  version: '0'
199
199
  requirements: []
200
200
  rubyforge_project:
201
- rubygems_version: 2.1.5
201
+ rubygems_version: 2.1.11
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Heel is a small static web server for use when you need a quick web server