msgthr 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/GNUmakefile +4 -3
- data/lib/msgthr.rb +1 -1
- data/lib/msgthr/container.rb +3 -2
- data/msgthr.gemspec +2 -1
- data/test/test_msgthr.rb +30 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f71ba28241da92db06de185e52be789597cdd41f3c138f6ab6e1b75c06450fc
|
4
|
+
data.tar.gz: c5c3d60a79603f1eeee436c6a7a93e505b4ac66ef5ccd7b86678e298e6f751c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 978e8c20322dae07355915e9e12c1fbb450b36a08bae3c76c5d9202fc27393a604c9af1f567ae0a9301ade48593df5fd4d8afdee2107df3f3e3b44363cf66ecc
|
7
|
+
data.tar.gz: 0a74be8f5ccad900ac1181b6db4b9e197c6f6956c7ef1af975883fa7f52c8b029e423c6d359155de889479e255ced3a284559be5da8c9a81bba8e607fbded80a
|
data/GNUmakefile
CHANGED
@@ -4,7 +4,7 @@ all::
|
|
4
4
|
pkg = msgthr
|
5
5
|
RUBY = ruby
|
6
6
|
lib := lib
|
7
|
-
VERSION := 1.2.
|
7
|
+
VERSION := 1.2.2
|
8
8
|
RSYNC_DEST := 80x24.org:/srv/80x24/msgthr/
|
9
9
|
|
10
10
|
RSYNC = rsync
|
@@ -33,7 +33,7 @@ gem: $(pkggem)
|
|
33
33
|
install-gem: $(pkggem)
|
34
34
|
gem install --local $(CURDIR)/$<
|
35
35
|
|
36
|
-
$(pkggem): .manifest
|
36
|
+
$(pkggem): .manifest NEWS
|
37
37
|
VERSION=$(VERSION) gem build $(pkg).gemspec
|
38
38
|
mkdir -p pkg
|
39
39
|
mv $(@F) $@
|
@@ -47,12 +47,13 @@ pkg_extra :=
|
|
47
47
|
package: $(pkggem)
|
48
48
|
|
49
49
|
NEWS: .olddoc.yml
|
50
|
-
$(OLDDOC) prepare
|
50
|
+
$(OLDDOC) prepare || echo 'See https://80x24.org/msgthr/NEWS' >$@
|
51
51
|
LATEST: NEWS
|
52
52
|
|
53
53
|
doc:: .document .olddoc.yml
|
54
54
|
-find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
55
55
|
$(RM) -r doc
|
56
|
+
$(OLDDOC) prepare
|
56
57
|
$(RDOC) -f oldweb
|
57
58
|
|
58
59
|
# this requires GNU coreutils variants
|
data/lib/msgthr.rb
CHANGED
data/lib/msgthr/container.rb
CHANGED
@@ -64,9 +64,10 @@ class Msgthr::Container
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def has_descendent(child) # :nodoc:
|
67
|
-
seen =
|
67
|
+
seen = {}
|
68
68
|
while child
|
69
|
-
return true if self == child ||
|
69
|
+
return true if self == child || seen[child]
|
70
|
+
seen[child] = true
|
70
71
|
child = child.parent
|
71
72
|
end
|
72
73
|
false
|
data/msgthr.gemspec
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
manifest = File.read('.manifest').split(/\n/)
|
6
|
+
manifest << 'NEWS' if File.exist?('NEWS')
|
6
7
|
s.name = %q{msgthr}
|
7
|
-
s.version = ENV['VERSION'] || '1.2.
|
8
|
+
s.version = ENV['VERSION'] || '1.2.2'
|
8
9
|
s.authors = ['msgthr hackers']
|
9
10
|
s.summary = 'container-agnostic, non-recursive message threading'
|
10
11
|
s.description = File.read('README').split(/\n\n/)[1].strip
|
data/test/test_msgthr.rb
CHANGED
@@ -144,4 +144,34 @@ EOF
|
|
144
144
|
assert_equal threads[2][0], '2'
|
145
145
|
end
|
146
146
|
|
147
|
+
def test_no_lost_root
|
148
|
+
ids = [
|
149
|
+
[ 8, [] ],
|
150
|
+
[ 7, [8] ],
|
151
|
+
[ 6, [8, 7] ],
|
152
|
+
[ 3, [6, 7, 8] ],
|
153
|
+
[ 2, [6, 7, 8, 3] ],
|
154
|
+
[ 10, [8, 7, 6] ],
|
155
|
+
[ 9, [6, 3] ],
|
156
|
+
[ 5, [6, 7, 8, 3, 2] ],
|
157
|
+
[ 4, [2, 3] ],
|
158
|
+
[ 1, [2, 3, 4] ],
|
159
|
+
[ 'a', ],
|
160
|
+
[ 'b', ['a'] ],
|
161
|
+
]
|
162
|
+
[ [ :forward, ids, 2 ],
|
163
|
+
[ :backwards, ids.reverse, 3 ],
|
164
|
+
[ :shuffle, ids.shuffle, nil ],
|
165
|
+
].each do |desc,msgs,exp|
|
166
|
+
thr = Msgthr.new
|
167
|
+
msgs.each { |id| thr.add(id[0], id[1], id[0]) }
|
168
|
+
seen0 = nr = 0
|
169
|
+
thr.walk_thread do |level, _, _|
|
170
|
+
seen0 += 1 if level == 0
|
171
|
+
nr += 1
|
172
|
+
end
|
173
|
+
assert_equal nr, msgs.size, 'no lost messages'
|
174
|
+
assert_equal exp, seen0, "single root #{desc}" if exp
|
175
|
+
end
|
176
|
+
end
|
147
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgthr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- msgthr hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Pure Ruby message threading based on the algorithm described by
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- ".olddoc.yml"
|
26
26
|
- COPYING
|
27
27
|
- GNUmakefile
|
28
|
+
- NEWS
|
28
29
|
- README
|
29
30
|
- lib/msgthr.rb
|
30
31
|
- lib/msgthr/container.rb
|
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
version: '0'
|
54
55
|
requirements: []
|
55
56
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.7.
|
57
|
+
rubygems_version: 2.7.6
|
57
58
|
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: container-agnostic, non-recursive message threading
|