activeoutline 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 169ed2516e2bd7778600622d84abf2978c26ca8c
4
+ data.tar.gz: 7c198bb2931f528a4c17ad9ade4cf7c5c227a45e
5
+ SHA512:
6
+ metadata.gz: ea1ab80c3071d36fd7c825ddf646c48833e43efc1036882ce5c39cacb8f9b21a08dc2013b1f806f4134a19c7506513959533a296205ff8ab64d296561ff64806
7
+ data.tar.gz: 90dca6027415ed30a2cc56d4f978771bdfccd8d2fa5304aa71b61a7abde4b51656e4caceb91ac029e2cb8ae12bc209ba6da2eef6a7f7fb4c32ca5e470d52e0bf
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: activeoutline.rb
4
+
5
+ require 'drb'
6
+ require 'filetree_xml'
7
+ require 'polyrex-links'
8
+
9
+
10
+ class ActiveOutline
11
+
12
+
13
+ class LinkReader
14
+
15
+ def initialize(filepath, debug: false)
16
+
17
+ @filepath, @debug = filepath, debug
18
+ read filepath
19
+
20
+ end
21
+
22
+ def ls(path='.')
23
+ @ftx.ls(path).map(&:to_s)
24
+ end
25
+
26
+ def fetch(uri)
27
+
28
+ s, remaining = @links.locate uri
29
+ redirect = s =~ /^\[r\] +/i
30
+ return s if redirect
31
+
32
+ contents, _ = RXFHelper.read(s)
33
+
34
+ return contents
35
+ end
36
+
37
+ def read(filepath)
38
+
39
+ s, _ = RXFHelper.read(filepath)
40
+ puts 's ' + s.inspect if @debug
41
+
42
+ @links = PolyrexLinks.new.import(s)
43
+ @ftx = FileTreeXML.new(s.lines.map {|x| x[/^ *\S+/]}.join("\n"),
44
+ debug: @debug)
45
+ end
46
+
47
+ def reload()
48
+ read @filepath
49
+ end
50
+
51
+
52
+ end
53
+
54
+ def initialize(filepath='outline.txt', host: 'localhost',
55
+ port: '60700', debug: false)
56
+
57
+ @host, @port = host, port
58
+
59
+ @lr = LinkReader.new(filepath, debug: debug)
60
+
61
+ end
62
+
63
+ def start()
64
+
65
+ DRb.start_service "druby://#{@host}:#{@port}", @lr
66
+ DRb.thread.join
67
+
68
+ end
69
+ end
70
+
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeoutline
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
+ YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMzE3MTM0OTI1WhcN
15
+ MTkwMzE3MTM0OTI1WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
+ cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC41Gg8
17
+ ZnUyphhEQhw6APxMdQv9bN6jgnONxu7f3kLiylikYgPEFLL7YUZ0RUb1TThmjxEs
18
+ Rie3FhxvhNqZuRXj+tmTkCClfRmbrNxuo+ZsCyW774ms68jKtXM1i1OAHOlqOCZA
19
+ eSj2Hs/o7K8g65j4V5kN1hPXfSwfmiFYVhyAQ01xTX1ecaFUw7g8T8LhC8PCi9Lq
20
+ P9jzMUxmQA4QngxqdvCh+pRWtL78N+Z+sjJCYZxJNGdTZ/lIx4LfY4fl5LyLI+MM
21
+ 0w2ySYNBXKTYXd35AqQHjgoie8Pig3aKuYHlidtcQYUeQq3K9usINYxTQIsAhOOS
22
+ sh8zTXNNGH0NiqjJAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
+ HQYDVR0OBBYEFItVFJYfxAoxSqbLicCYgdnnhewxMCYGA1UdEQQfMB2BG2dlbW1h
24
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
+ ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBACdB4FLfkqqveRa88fd6
26
+ RJxhdi9CFJNKDJtGX+qQ3XvtzL2i7/eBewrjhx6098z/Mh02Zqs4bAWu0/Gmy6IR
27
+ nTfE552vu7zxTdRWV5lyuO7yQ3SVIfH99tWskAZZTtFlxN1F4dLly4cR0j8wqpNd
28
+ yc0K77JECZR7lqVie9xibrtBvVtfNieYZ0PF8FqKkGSCVHpTlV/RUhb6qry0ar9D
29
+ q6DopA3ni0nU9LONVcdZsDiT7yCvRHrdkQAyHra6p2X2sJ398hFnCJrr3Ex7uFLH
30
+ vgIN//yZem9b8YPOzE6BqckYBqZ5P03W0L34fVQu8JO8ewL4cjLRf7O8BgXOKDL9
31
+ hpc=
32
+ -----END CERTIFICATE-----
33
+ date: 2018-03-17 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: file_tree
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.1'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 0.1.3
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '0.1'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: polyrex-links
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.1.7
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0.1'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.1.7
75
+ description:
76
+ email: james@jamesrobertson.eu
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files: []
80
+ files:
81
+ - lib/activeoutline.rb
82
+ homepage: https://github.com/jrobertson/activeoutline
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.6.13
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: A DRb server which accepts the name of a page or link to be fetched. Uses
106
+ an XML lookup file (PolyrexLinks format).
107
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1 @@
1
+ t��� U�^��Qjk'�"�� kbSGq//MP��ψ��`