mindwords 0.8.0 → 0.8.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/lib/mindwords.rb +47 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7201b9f1950ecacaf5bac313bf8dd0c7485efe308829fa8bc73d5fa442cca5e
|
4
|
+
data.tar.gz: e61b0229f2c75c11c71f68ba6c0139bd6f5ed8110a78c66da5d66aa6144e84c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5db0ccb709a730e47bdf753aa82956cce15d662f6fa35a8921b6580ecf2624b64b1187b4ce5eaaf5cb63e1e3b437a114097ed85b6945e8a8877451a5706ac4e0
|
7
|
+
data.tar.gz: 64826bf627e098697d504116ea6cadd7b93daee1314ebb98506af685d4b600e6e5b990200d8c380ee49d9b1b59b44565aec6feba631b310dcee0db1afec11824
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mindwords.rb
CHANGED
@@ -78,10 +78,54 @@ class MindWords
|
|
78
78
|
s, type = RXFReader.read raws
|
79
79
|
|
80
80
|
@filepath = raws if type == :file or type == :dfs
|
81
|
-
|
82
|
-
|
81
|
+
rawlines = (s.strip.gsub(/(^\n|\r)/,'') + "\n").lines.uniq
|
82
|
+
rawlines.shift if rawlines.first =~ /<\?mindwords\?>/
|
83
83
|
|
84
|
-
|
84
|
+
# remove mindwords lines which don't have a hashtag
|
85
|
+
lines = rawlines.reject do |line|
|
86
|
+
|
87
|
+
found = line[/^\w+[^#]+$/]
|
88
|
+
|
89
|
+
if found then
|
90
|
+
puts ('no hashtag found on this line -> ' + line).warn
|
91
|
+
end
|
92
|
+
|
93
|
+
found
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
#--- handle indented text, indicated there are *groups* of words
|
98
|
+
|
99
|
+
s2 = lines.join.gsub(/\n\s*$/,'')
|
100
|
+
puts s2 if @debug
|
101
|
+
a = s2.strip.split(/(?=^\w+)/)
|
102
|
+
a2 = a.inject([]) do |r,x|
|
103
|
+
|
104
|
+
if x =~ /\n\s+/ then
|
105
|
+
|
106
|
+
a4 = x.lines[1..-1].map do |line|
|
107
|
+
|
108
|
+
puts 'x.lines[0]: ' + x.lines[0].inspect if @debug
|
109
|
+
hashtag = if x.lines[0][/ /] then
|
110
|
+
x.lines[0].gsub(/\b\w/) {|x| x.upcase}.gsub(/ /,'')
|
111
|
+
else
|
112
|
+
x.lines[0]
|
113
|
+
end
|
114
|
+
|
115
|
+
"%s #%s" % [line.strip, hashtag]
|
116
|
+
end
|
117
|
+
|
118
|
+
r.concat a4
|
119
|
+
|
120
|
+
else
|
121
|
+
r << x
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
#-- end of indented text handler
|
127
|
+
|
128
|
+
@lines = a2.inject([]) do |r,line|
|
85
129
|
|
86
130
|
# the following does 2 things:
|
87
131
|
# 1. splits words separated by a bar (|) onto their own line
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mindwords
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
eUqhPOSrxIRLebVebvo/SHN6+ed3Q1tXowsbLGCT9QwqbaZ5MZ7zks92mIWeJvsA
|
36
36
|
JdpabIXfcOANNKd0ha4NO+Yu
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-04-08 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: polyrex
|
metadata.gz.sig
CHANGED
Binary file
|