flying-sphinx 0.4.2 → 0.4.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -31,7 +31,10 @@ class FlyingSphinx::Configuration
31
31
  private
32
32
 
33
33
  def set_from_server
34
- json = JSON.parse api.get('/app').body
34
+ response = api.get('/app')
35
+ raise 'Invalid Flying Sphinx credentials' if response.code == 403
36
+
37
+ json = JSON.parse response.body
35
38
 
36
39
  @host = json['server']
37
40
  @port = json['port']
@@ -15,6 +15,7 @@ class FlyingSphinx::Tunnel
15
15
  session.forward.remote(
16
16
  db_port, db_host, @configuration.database_port, '0.0.0.0'
17
17
  )
18
+ session.loop { !remote_exists?(session) }
18
19
 
19
20
  yield session
20
21
  end
@@ -39,4 +40,10 @@ class FlyingSphinx::Tunnel
39
40
  File.expand_path('../../../keys/key', __FILE__)
40
41
  ]}
41
42
  end
43
+
44
+ def remote_exists?(session)
45
+ session.forward.active_remotes.include?(
46
+ [@configuration.database_port, '0.0.0.0']
47
+ )
48
+ end
42
49
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flying-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Allan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-29 00:00:00 +11:00
18
+ date: 2011-02-04 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency