del 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/del.rb +1 -2
- data/lib/del/configuration.rb +21 -0
- data/lib/del/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5312956fd3f0a2e7e8fd5474bdf9aceb33dea75f355a69eae61facfff3f8880a
|
4
|
+
data.tar.gz: 54996ca1e88446102cf9ec7d8138b87e1a6319cf10a396f0f81808007d17b600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcb55f80d804d83bf27cd9282ab463ce5f77c5a722fabf7e6ee10c031734aeff9bcba29a156c7960ed8c0474e3e38f5f5cc91d8bdea56c5e5e36eaa3c8bfde20
|
7
|
+
data.tar.gz: c3e813b272f20cd3b3ce93061ab62ca7b89efecb883830d13f33360c2116c191f746e30453d80f206f3d29f7438854285f5ac867c20683d670e185096ed2853f
|
data/lib/del.rb
CHANGED
@@ -28,9 +28,8 @@ module Del
|
|
28
28
|
config.router.register(/.*/) do |message|
|
29
29
|
logger.debug(message.to_s)
|
30
30
|
end
|
31
|
+
config.load(startup_file)
|
31
32
|
end
|
32
|
-
load startup_file if startup_file && File.exist?(startup_file)
|
33
|
-
|
34
33
|
del = Robot.new(configuration: configuration)
|
35
34
|
del.get_funky!(start_server: start_server)
|
36
35
|
end
|
data/lib/del/configuration.rb
CHANGED
@@ -28,5 +28,26 @@ module Del
|
|
28
28
|
@socket_file = SOCKET_FILE
|
29
29
|
@users = Repository.new
|
30
30
|
end
|
31
|
+
|
32
|
+
def load(file)
|
33
|
+
return if file.nil?
|
34
|
+
return Kernel.load(file) if File.exist?(file)
|
35
|
+
|
36
|
+
eval(remote_fetch(file), binding)
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def remote_fetch(url)
|
42
|
+
require 'uri'
|
43
|
+
require 'net/http'
|
44
|
+
|
45
|
+
uri = URI.parse(url)
|
46
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
47
|
+
http.use_ssl = uri.is_a?(URI::HTTPS)
|
48
|
+
response = http.request(Net::HTTP::Get.new(uri.request_uri))
|
49
|
+
Del.logger.info("Loading...\n#{response.body}")
|
50
|
+
response.body
|
51
|
+
end
|
31
52
|
end
|
32
53
|
end
|
data/lib/del/version.rb
CHANGED