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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 024f07feba4250f9db8437499aaca3c73165a0bfd0fd0070bad06403d449e5d5
4
- data.tar.gz: 552c12d30d02dcb600f8fc57ba0c3bb641a6d8efbcbd9c07392971617c691a11
3
+ metadata.gz: 5312956fd3f0a2e7e8fd5474bdf9aceb33dea75f355a69eae61facfff3f8880a
4
+ data.tar.gz: 54996ca1e88446102cf9ec7d8138b87e1a6319cf10a396f0f81808007d17b600
5
5
  SHA512:
6
- metadata.gz: d586894d66f2363b89c068d4a5e8077b395cd7123a83c75d4ec51f3834781fbb40bf106bbf5ddb027d8b04e7f260f79318098561c025f9c3cb7778af9a27c246
7
- data.tar.gz: 76715d5f0f098b5d9df7369cc442eec8ad568e86f48eae4ca9bbbd8084907ac5b68e00b40e6e103428676e6694ae016de94cd57095a58d43eaebedf6502f5212
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Del
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: del
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo