cloudbridge 0.9.4 → 0.9.5

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.
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require 'cloud_mongrel'
3
-
4
2
  if ENV['CLOUD_HOSTS']
5
3
  cloud_hosts = ENV['CLOUD_HOSTS'].split(',')
6
4
  else
@@ -28,8 +26,15 @@ ARGV.each_with_index {|arg, idx|
28
26
  }
29
27
  remove.reverse_each {|idx| ARGV.delete_at(idx) }
30
28
 
31
- ENV['CLOUD_HOSTS'] = (cloud_hosts.length() > 0 && cloud_hosts.join(',')) || nil
32
- ENV['CLOUD_KEYS'] = (cloud_keys.length() > 0 && cloud_keys.join(',')) || nil
29
+ ENV['BRIDGE_HOSTS'] = (cloud_hosts.length() > 0 && cloud_hosts.join(',')) || nil
30
+ ENV['BRIDGE_KEYS'] = (cloud_keys.length() > 0 && cloud_keys.join(',')) || nil
31
+
32
+ # Replace the 'real' mongrel with the overloaded one
33
+ require 'bridge_mongrel'
34
+ module Mongrel
35
+ RealHttpServer = HttpServer
36
+ HttpServer = BridgeHttpServer
37
+ end
33
38
 
34
39
  # just load the native mongrel version and let it do its thing with our overloaded mongrel class.
35
40
  load 'mongrel_rails'
@@ -15,9 +15,7 @@ rescue LoadError
15
15
  end
16
16
 
17
17
  module Mongrel
18
- class HttpServer
19
- alias_method(:native_initialize, :initialize)
20
-
18
+ class BridgeHttpServer < HttpServer
21
19
  # Modified to take 2 arguments at the end which are a list of hosts to listen for and a list of host-keys
22
20
  # to send to the server to authenticate authority over those domains.
23
21
  def initialize(*args)
@@ -29,16 +27,16 @@ module Mongrel
29
27
  listen_hosts, listen_host_keys = listen_host_keys, listen_hosts
30
28
  end
31
29
  # last but not least, get them from the environment or provide sensible defaults.
32
- listen_hosts ||= (ENV['CLOUD_HOSTS'] && ENV['CLOUD_HOSTS'].split(',')) || ["*"]
33
- listen_keys ||= (ENV['CLOUD_KEYS'] && ENV['CLOUD_KEYS'].split(',')) || []
34
-
30
+ listen_hosts ||= (ENV['BRIDGE_HOSTS'] && ENV['BRIDGE_HOSTS'].split(',')) || ["*"]
31
+ listen_host_keys ||= (ENV['BRIDGE_KEYS'] && ENV['BRIDGE_KEYS'].split(',')) || []
32
+
35
33
  host, port = args[0], args[1]
36
34
  args[0], args[1] = '0.0.0.0', 0 # make mongrel listen on a random port, we're going to close it after.
37
- native_initialize(*args)
35
+ super(*args)
38
36
  @host = host
39
37
  @port = port
40
38
  @socket.close
41
- @socket = CloudBridge::Server.new(@host, @port, listen_hosts, listen_keys)
39
+ @socket = CloudBridge::Server.new(@host, @port, listen_hosts, listen_host_keys)
42
40
  end
43
41
  end
44
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudbridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graham Batty
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies: []
15
15
 
16
16
  description: CloudBridge is a self-healing minimal-configuration bridge between front-end and backend web servers. This library provides the tools needed to take advantage of it in ruby.
17
- email: graham@rubyoncloud.com
17
+ email: info@stormbrew.ca
18
18
  executables:
19
19
  - cloud_mongrel_rails
20
20
  - cloud_generate_key
@@ -25,12 +25,12 @@ extra_rdoc_files: []
25
25
  files:
26
26
  - bin/cloud_mongrel_rails
27
27
  - lib/cloudbridge.rb
28
- - lib/cloud_mongrel.rb
28
+ - lib/bridge_mongrel.rb
29
29
  - lib/cloudserver.rb
30
30
  - test/test_cloud_mongrel.rb
31
31
  - test/test_cloudserver.rb
32
32
  has_rdoc: true
33
- homepage: http://rubyoncloud.com/cloudmachine
33
+ homepage: http://stormbrew.ca/projects/cloudbridge
34
34
  post_install_message:
35
35
  rdoc_options:
36
36
  - --inline-source