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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1d424d22511f5e830ffd22d30879b00504a50d7b4c438af50f8c50c2ee9b99b
4
- data.tar.gz: 8695e5832c809dc24544275af5a08206f484bb64de5211adfe502288de86a01b
3
+ metadata.gz: d7d729d754ce11e1287274206933888c1248ef3e07ae55d32c708aec95616875
4
+ data.tar.gz: 0eef50c6630c834f7bfce5a735ee83ae34731ed5bb9643509932deceb8cf4a8c
5
5
  SHA512:
6
- metadata.gz: c9eef9ea3726d6baf271c61ce4bb8d35eb0e7c9806dc99bcdbcf8d7f9eb4e360ace1f37c940b3a4a1a833428a25fd5ffbf390d456a4a0cbfba728b6f0d51217f
7
- data.tar.gz: 143eb156a42d52aa225d81f28ab854e2cc91f37e87f30644073234db2d746b9d468be12bc5abffacedddd81e2ee0033499b5a338f55001a437acec888db5d918
6
+ metadata.gz: 9ccd9f68e0e9c54294772c6f1d1dea53d5d9c6dd0369f066d9c4640aaa67f6dc881888b4d355db5b288ffd3dc56d9ff3ffed42d38e04b208fab310304b6d2b60
7
+ data.tar.gz: 84a489441dcb208b1ea21f4ff78802ae6beeb19833ec90ad2e8605a7910254df8424ccba2e797d6a9926577fdda941db02c6f001ca285b0ff74772de1eec3bc6
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Dory
2
- VERSION = '1.0.0'
3
- DATE = '2018-08-17'
2
+ VERSION = '1.0.1'
3
+ DATE = '2018-08-22'
4
4
  end
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.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-17 00:00:00.000000000 Z
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