drb_fileclient-reader 0.1.5 → 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: de6a3b50827e3fe464e1b2ad65754ca33b8300a7dca175f8c766fe9e27862161
4
- data.tar.gz: b2b685201d4151fb198af7cb8232dfc616fd992f48eebaeee9c6cd350111bf3a
3
+ metadata.gz: c9410a7898afe8a74312baf93ec46b2820856f6fe9440835e4c77d203fad4bce
4
+ data.tar.gz: 8203ae4e5c60e2eb48c8d3d743f5bb08c7837ce0255aa48a8e080b520e7aa8aa
5
5
  SHA512:
6
- metadata.gz: 0370e96c8d9a9f7209150e2ecb734f071cab935a4c17904f22d8627e4d21571a00ae41613989ed959415421ffcea3f2af19e1d66544a8f023a9b2647be0107a5
7
- data.tar.gz: 4f75275a2856d1589249a1d7fadd8ea41746a2eb49f25938cd23210d97a3f11ef67be4cff98679aa58f7ce5effa1c6e4f51fe6ba48d3a8364487ec273c56eb05
6
+ metadata.gz: 9dc14a72dd41c645f0c905ecb64cddb1b5548a3dcbd833de8530707b6864f851a450d2eca780312ea0f118be5cf501835711a8d4d2b40b94093b76341c528bfe
7
+ data.tar.gz: 430fc33bdab44ba1244bd13468f6e3d4b0e303f8e27b8eed2c4bf00ff28bd8cce9c0df38bd284a94e1452140e62843c7184d876b2e254440edc32e8875d02385
checksums.yaml.gz.sig CHANGED
Binary file
@@ -2,86 +2,8 @@
2
2
 
3
3
  # file: drb_fileclient-reader.rb
4
4
 
5
- require 'drb'
6
- require 'c32'
7
5
 
6
+ # testing, please ignore this version
8
7
 
9
8
  class DRbFileClientReader
10
- using ColouredText
11
-
12
- def initialize(location=nil, host: nil, port: '61010', debug: false)
13
-
14
- @debug = debug
15
- @@file ||= nil
16
-
17
- if location then
18
-
19
- host = location[/(?<=^dfs:\/\/)[^\/:]+/]
20
- port = location[/(?<=^dfs:\/\/)[^:]+:(\d+)/,1] || '61010'
21
- @@directory ||= location[/(?<=^dfs:\/\/)[^\/]+\/(.*)/,1]
22
- else
23
- @@directory ||= nil
24
- end
25
-
26
- DRb.start_service
27
-
28
- end
29
-
30
- def exists?(filename=@@filename)
31
-
32
- return File.exists? filename unless @@directory or filename =~ /^dfs:\/\//
33
-
34
- if filename =~ /^dfs:\/\// then
35
-
36
- file, filename2 = parse_path(filename)
37
- @@file ||= file
38
-
39
- else
40
-
41
- filename2 = File.join(@@directory, filename)
42
- end
43
-
44
- @@file.exists?(filename2)
45
-
46
- end
47
-
48
- alias exist? exists?
49
-
50
- def read(filename=@@filename)
51
-
52
- return File.read(filename) unless @@directory or filename =~ /^dfs:\/\//
53
-
54
- if filename =~ /^dfs:\/\// then
55
- file, path = parse_path(filename)
56
- @@file ||= file
57
- else
58
- path = File.join(@@directory, filename)
59
- end
60
-
61
- @@file.read path
62
- end
63
-
64
- protected
65
-
66
- def parse_path(filename)
67
-
68
- host = filename[/(?<=^dfs:\/\/)[^\/:]+/]
69
- @host = host if host
70
-
71
- port = filename[/(?<=^dfs:\/\/)[^:]+:(\d+)/,1] || '61010'
72
-
73
- file_server = DRbObject.new nil, "druby://#{host || @host}:#{port}"
74
- [file_server, filename[/(?<=^dfs:\/\/)[^\/]+\/(.*)/,1], ("dfs://%s:%s" % [host, port])]
75
-
76
- end
77
-
78
- end
79
-
80
- class DfsFile
81
-
82
- @client = DRbFileClientReader.new
83
-
84
- def self.exists?(filename) @client.exists?(filename) end
85
- def self.read(filename) @client.read(filename) end
86
-
87
9
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drb_fileclient-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  im+YlEcJfPax42Av6oEBmm6oUqxICcrKX8DdDuNFC44LAC66kmOdMTNiVdeS82BG
36
36
  CGf+32hX61V/Gw6Jiazh7a6L
37
37
  -----END CERTIFICATE-----
38
- date: 2022-08-18 00:00:00.000000000 Z
38
+ date: 2023-01-18 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: c32
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.3.7
86
+ rubygems_version: 3.4.4
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: A DRb file reader client to access the DRb_fileserver service.
metadata.gz.sig CHANGED
Binary file