dory 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dory/resolv.rb +7 -0
- data/lib/dory/resolv/linux_resolvconf.rb +27 -0
- data/lib/dory/version.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7d729d754ce11e1287274206933888c1248ef3e07ae55d32c708aec95616875
|
4
|
+
data.tar.gz: 0eef50c6630c834f7bfce5a735ee83ae34731ed5bb9643509932deceb8cf4a8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ccd9f68e0e9c54294772c6f1d1dea53d5d9c6dd0369f066d9c4640aaa67f6dc881888b4d355db5b288ffd3dc56d9ff3ffed42d38e04b208fab310304b6d2b60
|
7
|
+
data.tar.gz: 84a489441dcb208b1ea21f4ff78802ae6beeb19833ec90ad2e8605a7910254df8424ccba2e797d6a9926577fdda941db02c6f001ca285b0ff74772de1eec3bc6
|
data/lib/dory/resolv.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'colorize'
|
2
|
+
require 'pathname'
|
2
3
|
|
3
4
|
module Dory
|
4
5
|
module Resolv
|
5
6
|
def self.get_module
|
6
7
|
return Dory::Resolv::Macos if Os.macos?
|
8
|
+
return Dory::Resolv::LinuxResolvconf if self.resolvconf?
|
7
9
|
Dory::Resolv::Linux
|
8
10
|
end
|
9
11
|
|
@@ -22,5 +24,10 @@ module Dory
|
|
22
24
|
def self.clean
|
23
25
|
self.get_module.clean
|
24
26
|
end
|
27
|
+
|
28
|
+
def self.resolvconf?
|
29
|
+
Pathname.new('/etc/resolv.conf').realpath.to_s ==
|
30
|
+
'/run/resolvconf/resolv.conf'
|
31
|
+
end
|
25
32
|
end
|
26
33
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Dory
|
2
|
+
module Resolv
|
3
|
+
module LinuxResolvconf
|
4
|
+
def self.file_nameserver_line
|
5
|
+
Linux.file_nameserver_line
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.nameserver_contents
|
9
|
+
Linux.nameserver_contents
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.has_our_nameserver?
|
13
|
+
Linux.has_our_nameserver?
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.configure
|
17
|
+
puts 'Requesting sudo to run resolvconf'.green
|
18
|
+
Bash.run_command("echo -e '#{self.nameserver_contents}' | sudo resolvconf -a lo.dory")
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.clean
|
22
|
+
puts 'Requesting sudo to run resolvconf'.green
|
23
|
+
Bash.run_command("sudo resolvconf -d lo.dory")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/dory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- lib/dory/proxy.rb
|
159
159
|
- lib/dory/resolv.rb
|
160
160
|
- lib/dory/resolv/linux.rb
|
161
|
+
- lib/dory/resolv/linux_resolvconf.rb
|
161
162
|
- lib/dory/resolv/macos.rb
|
162
163
|
- lib/dory/shell.rb
|
163
164
|
- lib/dory/systemd.rb
|