bitgirder-platform 0.1.16 → 0.1.19

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/bin/install-mysql CHANGED
@@ -100,7 +100,8 @@ class App < BitGirderClass
100
100
  if @wipe_install_dir
101
101
  do_wipe_install
102
102
  else
103
- raise "#@install_to already exists"
103
+ Dir.glob( "#@install_to/*" ).empty? or
104
+ raise "#@install_to already exists"
104
105
  end
105
106
  end
106
107
  end
data/bin/tomcat7 CHANGED
@@ -128,7 +128,8 @@ class Install < Command
128
128
  if @wipe_install
129
129
  fu().rm_rf( @install_to )
130
130
  else
131
- raise "Install dir #@install_to exists (--wipe-install?)"
131
+ Dir.glob( "#@install_to/*" ).empty? or
132
+ raise "Install dir #@install_to exists (--wipe-install?)"
132
133
  end
133
134
  end
134
135
 
@@ -437,7 +438,7 @@ class Daemon < RuntimeCommand
437
438
  code( "Awaiting connection on ports: #{ports}" )
438
439
 
439
440
  ports.each do |p|
440
- WaitCondition.wait_backoff( seed: 1, max_tries: 4 ) do
441
+ WaitCondition.wait_backoff( seed: 1, max_tries: 6 ) do
441
442
  res = can_connect?( p )
442
443
  code( "Got conn on :#{p}: #{res}" )
443
444
  res
@@ -506,7 +507,12 @@ class Daemon < RuntimeCommand
506
507
 
507
508
  unless await_proc_exit( pid = get_current_pid )
508
509
  code( "Server appears to still be running; sending KILL to #{pid}" )
509
- Process.kill( "KILL", pid )
510
+
511
+ # Quietly squash ESRCH since it may be that tomcat exits
512
+ # concurrently with our kill
513
+ begin
514
+ Process.kill( "KILL", pid )
515
+ rescue Errno::ESRCH; end
510
516
  end
511
517
 
512
518
  fu().rm( pid_file )
data/lib/bitgirder/io.rb CHANGED
@@ -68,6 +68,33 @@ end
68
68
 
69
69
  module_function :strict_decode64
70
70
 
71
+ def digest_file( opts )
72
+
73
+ dig_cls, file = has_keys( opts, :digest_type, :file )
74
+ buf_sz = opts[ :buffer_size ] || 50 * ( 1 << 10 )
75
+
76
+ # Set this now so we can fail before reading file if need be
77
+ out_func = case ot = opts[ :output_type ]
78
+ when nil, :binary then lambda { |dig| dig }
79
+ when :base64 then lambda { |dig| strict_encode64( dig ) }
80
+ else raise "Unhandled output type: #{ot}"
81
+ end
82
+
83
+ dig = dig_cls.new
84
+
85
+ File.open( file ) do |io|
86
+
87
+ buf = ""
88
+ while buf = io.read( buf_sz, buf )
89
+ dig.update( buf )
90
+ end
91
+ end
92
+
93
+ out_func.call( dig.digest )
94
+ end
95
+
96
+ module_function :digest_file
97
+
71
98
  # Returns i as a little-endian 2's complement byte array; Algorithm is from
72
99
  # http://stackoverflow.com/questions/5284369/ruby-return-byte-array-containing-twos-complement-representation-of-bignum-fi
73
100
  # (with some cosmetic differences, including the return val's endianness).
@@ -372,7 +399,7 @@ def can_connect?( *argv )
372
399
  begin
373
400
  TCPSocket::new( host, port ).close
374
401
  true
375
- rescue Errno::ECONNREFUSED
402
+ rescue Errno::ECONNREFUSED, Errno::ECONNRESET
376
403
  false
377
404
  end
378
405
  end
data/lib/doc-gen18.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # Autogenerated docs on 2012-12-31 12:25:13 -0800
2
+ # Autogenerated docs on 2013-02-03 05:52:36 -0800
3
3
  #
4
4
 
5
5
  # This code is only included for rdoc purposes and would not normally get
data/lib/doc-gen20.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # Autogenerated docs on 2012-12-31 12:25:13 -0800
2
+ # Autogenerated docs on 2013-02-03 05:52:36 -0800
3
3
  #
4
4
 
5
5
  # This code is only included for rdoc purposes and would not normally get
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitgirder-platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-31 00:00:00.000000000 Z
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Contains core classes and interfaces for building event logger implementations.
15
15
  Also includes helper classes for incorporating assertions about event logging into