sheepsafe 0.2.8 → 0.3.0

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/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.3.0
2
+
3
+ - Always recycle proxy on network changes, and wait a few seconds more
4
+ when bringing the proxy up so that the network change is in effect
5
+
1
6
  === 0.2.8
2
7
 
3
8
  - example.com changed again, search for /RFC 2606/ in body instead
@@ -40,12 +40,13 @@ module Sheepsafe
40
40
  return
41
41
  end
42
42
 
43
+ # Always recycle the proxy server on network changes
44
+ bring_socks_proxy 'down'
43
45
  if network_up?
44
46
  if network_changed?
45
47
  if switch_to_trusted?
46
48
  notify_ok "Switching to #{@config.trusted_location} location"
47
49
  system "scselect #{@config.trusted_location}"
48
- bring_socks_proxy 'down'
49
50
  elsif switch_to_untrusted?
50
51
  notified = false
51
52
  loop do
@@ -63,8 +64,7 @@ module Sheepsafe
63
64
  @config.last_network = @network
64
65
  @config.write
65
66
  elsif !@network.trustworthy?
66
- # recycle the proxy server on network changes
67
- bring_socks_proxy 'restart'
67
+ bring_socks_proxy 'up'
68
68
  end
69
69
  else
70
70
  log("AirPort is off")
@@ -102,7 +102,7 @@ module Sheepsafe
102
102
  Process.kill("TERM", pid)
103
103
  exit 0
104
104
  end
105
- sleep 2 # wait a bit before starting proxy
105
+ sleep 5 # wait a bit before starting proxy
106
106
  exit_count = 0
107
107
  ssh_command = "ssh #{@config.ssh_args}"
108
108
  loop do
data/lib/sheepsafe.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Sheepsafe
2
- VERSION = "0.2.8"
2
+ VERSION = "0.3.0"
3
3
  end
4
4
 
5
5
  require 'sheepsafe/config'
data/sheepsafe.gemspec CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sheepsafe'
5
- s.version = '0.2.8'
6
- s.date = '2011-03-22'
5
+ s.version = '0.3.0'
6
+ s.date = '2011-04-14'
7
7
 
8
8
  s.rubyforge_project = %q{caldersphere}
9
9
 
@@ -58,7 +58,8 @@ describe Sheepsafe::Controller do
58
58
 
59
59
  it "recycles the proxy server process when on the untrusted network" do
60
60
  network.stub :trustworthy? => false
61
- controller.should_receive(:bring_socks_proxy).with('restart')
61
+ controller.should_receive(:bring_socks_proxy).with('down')
62
+ controller.should_receive(:bring_socks_proxy).with('up')
62
63
  controller.run
63
64
  end
64
65
  end
@@ -97,6 +98,7 @@ describe Sheepsafe::Controller do
97
98
  controller.should_receive(:switch_to_untrusted?).and_return true
98
99
  controller.should_receive(:open).and_return("596")
99
100
  controller.should_receive(:system).with("scselect untrusted_location")
101
+ controller.should_receive(:bring_socks_proxy).with('down')
100
102
  controller.should_receive(:bring_socks_proxy).with('up')
101
103
  controller.run
102
104
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheepsafe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 8
10
- version: 0.2.8
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nick Sieger
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-22 00:00:00 -05:00
18
+ date: 2011-04-14 00:00:00 -05:00
19
19
  default_executable: sheepsafe
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency