activeoutline 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/activeoutline.rb +30 -10
- metadata +2 -2
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4c71e812b7643c45a917e68ffc678fb4b2f62de
|
4
|
+
data.tar.gz: 645ac70e8f804928df692c0f523016917b08be03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d86a0b7f9d2476ea459f8199b51aa700c21aa97422349536f783bf3095485439839e385b7bd7a6417b71718f9607acc605b5918bc7e47dffd933d6e5f7307b9
|
7
|
+
data.tar.gz: 868444b88117e4630e5efda3469f5381bbdbc662c1dfa3af31e4d4911bb6a051fd6d124a75ae9ffddb54f8294763b9cdccb36271801bcccf982f55bcd407f1d8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/activeoutline.rb
CHANGED
@@ -12,9 +12,9 @@ class ActiveOutline
|
|
12
12
|
|
13
13
|
class LinkReader
|
14
14
|
|
15
|
-
def initialize(filepath, debug: false)
|
15
|
+
def initialize(filepath, debug: false, default_url: nil)
|
16
16
|
|
17
|
-
@filepath, @debug = filepath, debug
|
17
|
+
@filepath, @debug, @default_url = filepath, debug, default_url
|
18
18
|
read filepath
|
19
19
|
|
20
20
|
end
|
@@ -39,10 +39,31 @@ class ActiveOutline
|
|
39
39
|
s, _ = RXFHelper.read(filepath)
|
40
40
|
puts 's ' + s.inspect if @debug
|
41
41
|
|
42
|
-
|
42
|
+
s2 = if @default_url then
|
43
|
+
|
44
|
+
# set a default url for entries which don't have one
|
45
|
+
s.lines.map do |x|
|
46
|
+
x =~ /:\/\// ? x : x.chomp + ' ' + @default_url \
|
47
|
+
+ URI.encode(x.strip) + "\n"
|
48
|
+
end.join
|
49
|
+
|
50
|
+
else
|
51
|
+
s
|
52
|
+
end
|
53
|
+
|
54
|
+
if @debug then
|
55
|
+
puts 's2: ' + s2.inspect
|
56
|
+
puts 's: ' + s.inspect
|
57
|
+
end
|
58
|
+
|
59
|
+
if s2 != s and RXFHelper.writeable?(filepath) then
|
60
|
+
RXFHelper.write filepath, s2
|
61
|
+
end
|
62
|
+
|
63
|
+
@links = PolyrexLinks.new.import(s2)
|
43
64
|
@ftx = FileTreeXML.new(s.lines.map {|x| x[/^ *\S+/]}.join("\n"),
|
44
65
|
debug: @debug)
|
45
|
-
end
|
66
|
+
end
|
46
67
|
|
47
68
|
def reload()
|
48
69
|
read @filepath
|
@@ -52,19 +73,18 @@ class ActiveOutline
|
|
52
73
|
end
|
53
74
|
|
54
75
|
def initialize(filepath='outline.txt', host: 'localhost',
|
55
|
-
port: '60700', debug: false)
|
56
|
-
|
57
|
-
@host, @port = host, port
|
76
|
+
port: '60700', debug: false, default_url: nil)
|
58
77
|
|
59
|
-
@
|
78
|
+
@filepath, @host, @port, @debug = filepath, host, port, debug
|
79
|
+
@default_url = default_url
|
60
80
|
|
61
81
|
end
|
62
82
|
|
63
83
|
def start()
|
64
84
|
|
65
|
-
|
85
|
+
lr = LinkReader.new(@filepath, debug: @debug, default_url: @default_url)
|
86
|
+
DRb.start_service "druby://#{@host}:#{@port}", lr
|
66
87
|
DRb.thread.join
|
67
88
|
|
68
89
|
end
|
69
90
|
end
|
70
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeoutline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
date: 2018-03-17 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: filetree_xml
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
t
|
1
|
+
"�tͯ�j��Ⱥe�o�ݔ��톍�}8���=���$���`4j��_y]�{��`,��r��'���Ej����fk�V�~=�.����ʮ��>��<M���4�������r½�Ojy�/W�?q\��oW)�&�IUi���ma���������|�{�Bns~̍�x�d/�X0V�=Ǚ3�6ɑ���`q�t.��!~ŷ�`c�Ӛ�e<߅8�v�-z�g(7���_°|���IX�+��͋� 6
|