deputy 0.1.35 → 0.1.36
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/deputy.gemspec +1 -1
- data/lib/deputy.rb +7 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.36
|
data/deputy.gemspec
CHANGED
data/lib/deputy.rb
CHANGED
@@ -125,7 +125,9 @@ module Deputy
|
|
125
125
|
url = "#{sheriff_url}#{path}"
|
126
126
|
url = url.sub(%r{//(.*?):(.*?)@}, '//')
|
127
127
|
auth = [$1, $2].compact
|
128
|
-
options
|
128
|
+
options[:http_basic_authentication] = auth if auth.size == 2
|
129
|
+
options[:remote_host] = hostname
|
130
|
+
|
129
131
|
Timeout.timeout(config['timeout']||10) do
|
130
132
|
open(url, options).read
|
131
133
|
end
|
@@ -146,6 +148,10 @@ module Deputy
|
|
146
148
|
raise "No deputy.yml found in /etc or #{home}"
|
147
149
|
end
|
148
150
|
|
151
|
+
def self.hostname
|
152
|
+
File.read('/etc/hostname') rescue "hostname_unknown"
|
153
|
+
end
|
154
|
+
|
149
155
|
# stolen from klarlack -- http://github.com/schoefmax/klarlack
|
150
156
|
# to get an reliable timeout that wont fail on other platforms
|
151
157
|
# or if sytem_timer is missing
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deputy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 83
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 36
|
10
|
+
version: 0.1.36
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|