friends 0.42 → 0.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +14 -7
- data/CHANGELOG.md +22 -2
- data/README.md +1 -1
- data/friends.gemspec +0 -1
- data/lib/friends/friend.rb +5 -5
- data/lib/friends/tag_regex.rb +1 -1
- data/lib/friends/version.rb +1 -1
- data/test/add_event_helper.rb +53 -0
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 779330dcc4a5fb8acc1ab8f7454045d9d69d0967
|
4
|
+
data.tar.gz: '04199e1544035835057259d1a4640609d4fa15d4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f32cb8224ae8eefbf19696f940109ade23f6092eb4c180907f30b4e0c4cb84ed047989235d5dcab54759be909bf25ac8e14527142dd1ae2a3b3f0da898c721ac
|
7
|
+
data.tar.gz: 760b017d4d42f127091227d592b4c3d044b5f2570e0156d0cd94789e7dce02cd128bb9c45628001537ead08374604667aa7738852106f2cd15e4dcd7549e1f8a
|
data/.travis.yml
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.1.0
|
4
|
-
- 2.2.0
|
5
|
-
- 2.3.0
|
6
|
-
- 2.4.0
|
7
|
-
|
3
|
+
- 2.1.0
|
4
|
+
- 2.2.0
|
5
|
+
- 2.3.0
|
6
|
+
- 2.4.0 # 2.5.0 is tested below
|
7
|
+
branches:
|
8
|
+
only:
|
9
|
+
- master
|
8
10
|
script:
|
9
|
-
- bundle exec rake test
|
10
|
-
|
11
|
+
- bundle exec rake test
|
12
|
+
matrix:
|
13
|
+
include:
|
14
|
+
- rvm: 2.5.0
|
15
|
+
script:
|
16
|
+
- bundle exec rake test
|
17
|
+
- gem install rubocop && rubocop
|
11
18
|
notifications:
|
12
19
|
email: false
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,26 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
14
14
|
|
15
15
|
👆 Donate with these buttons! 👆
|
16
16
|
|
17
|
+
## [v0.43](https://github.com/JacobEvelyn/friends/tree/v0.43) (2018-11-25)
|
18
|
+
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.42...v0.43)
|
19
|
+
|
20
|
+
**Implemented enhancements:**
|
21
|
+
|
22
|
+
- Improve matches for friends with only first names [\#215](https://github.com/JacobEvelyn/friends/issues/215)
|
23
|
+
- Better match friends with middle names [\#213](https://github.com/JacobEvelyn/friends/issues/213)
|
24
|
+
|
25
|
+
**Closed issues:**
|
26
|
+
|
27
|
+
- When specifying a file that does not exist, prompt to create it instead of aborting [\#214](https://github.com/JacobEvelyn/friends/issues/214)
|
28
|
+
- Dependabot can't evaluate your Ruby dependency files [\#211](https://github.com/JacobEvelyn/friends/issues/211)
|
29
|
+
- Sqlite as a backing datastore [\#210](https://github.com/JacobEvelyn/friends/issues/210)
|
30
|
+
- Generate Searchable Static Site [\#209](https://github.com/JacobEvelyn/friends/issues/209)
|
31
|
+
|
32
|
+
**Merged pull requests:**
|
33
|
+
|
34
|
+
- Improve friend name matching for various edge cases [\#216](https://github.com/JacobEvelyn/friends/pull/216) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
35
|
+
- Fix contributing guide link [\#212](https://github.com/JacobEvelyn/friends/pull/212) ([Nitemice](https://github.com/Nitemice))
|
36
|
+
|
17
37
|
## [v0.42](https://github.com/JacobEvelyn/friends/tree/v0.42) (2018-09-22)
|
18
38
|
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.41...v0.42)
|
19
39
|
|
@@ -67,7 +87,7 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
67
87
|
- Give name-matching priority to full-text matches [\#203](https://github.com/JacobEvelyn/friends/pull/203) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
68
88
|
- Prevent the addition of blank events, names, and locations [\#200](https://github.com/JacobEvelyn/friends/pull/200) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
69
89
|
- Fix Rubocop errors [\#196](https://github.com/JacobEvelyn/friends/pull/196) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
70
|
-
- Update rake requirement to ~\> 12.3 [\#194](https://github.com/JacobEvelyn/friends/pull/194) ([dependabot[bot]](https://github.com/
|
90
|
+
- Update rake requirement to ~\> 12.3 [\#194](https://github.com/JacobEvelyn/friends/pull/194) ([dependabot[bot]](https://github.com/apps/dependabot))
|
71
91
|
|
72
92
|
## [v0.37](https://github.com/JacobEvelyn/friends/tree/v0.37) (2018-02-24)
|
73
93
|
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.36...v0.37)
|
@@ -608,4 +628,4 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
608
628
|
## [v0.0.1](https://github.com/JacobEvelyn/friends/tree/v0.0.1) (2014-12-11)
|
609
629
|
|
610
630
|
|
611
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
631
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/README.md
CHANGED
@@ -932,7 +932,7 @@ If you have an idea,
|
|
932
932
|
[make a GitHub issue](https://github.com/JacobEvelyn/friends/issues/new)!
|
933
933
|
Suggestions are very very welcome, and usually are implemented very
|
934
934
|
quickly. And if you'd like to do the implementing yourself, see the
|
935
|
-
[contributing guide](https://github.com/JacobEvelyn/friends/blob/master/CONTRIBUTING.md).
|
935
|
+
[contributing guide](https://github.com/JacobEvelyn/friends/blob/master/.github/CONTRIBUTING.md).
|
936
936
|
|
937
937
|
A big big thanks to all of this project's lovely
|
938
938
|
[contributors](https://github.com/JacobEvelyn/friends/graphs/contributors):
|
data/friends.gemspec
CHANGED
@@ -38,6 +38,5 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_development_dependency "minitest", "~> 5.5"
|
39
39
|
spec.add_development_dependency "minitest-proveit", "~> 1.0"
|
40
40
|
spec.add_development_dependency "rake", "~> 12.3"
|
41
|
-
spec.add_development_dependency "rubocop", "~> 0.49"
|
42
41
|
spec.add_development_dependency "simplecov", "~> 0.14"
|
43
42
|
end
|
data/lib/friends/friend.rb
CHANGED
@@ -131,7 +131,7 @@ module Friends
|
|
131
131
|
# We check nicknames before first names because nicknames may contain
|
132
132
|
# first names, as in "Amazing Grace" being a nickname for Grace Hopper.
|
133
133
|
[
|
134
|
-
chunks,
|
134
|
+
chunks, # Match a full name with the highest priority.
|
135
135
|
*@nicknames.map { |n| [n] },
|
136
136
|
|
137
137
|
# Match a first name followed by a last name initial, period, and then
|
@@ -139,16 +139,16 @@ module Friends
|
|
139
139
|
# the "Jake E." part of something like "Jake E. and I went skiing." This
|
140
140
|
# allows us to correctly count the period as part of the name when it's
|
141
141
|
# in the middle of a sentence.
|
142
|
-
[chunks.first, "#{chunks.last[0]}\.(?=#{splitter}(?-i)[a-z])"],
|
142
|
+
([chunks.first, "#{chunks.last[0]}\.(?=#{splitter}(?-i)[a-z])"] if chunks.size > 1),
|
143
143
|
|
144
144
|
# If the above doesn't match, we check for just the first name and then
|
145
145
|
# a last name initial. This matches the "Jake E" part of something like
|
146
146
|
# "I went skiing with Jake E." This allows us to correctly exclude the
|
147
147
|
# period from the name when it's at the end of a sentence.
|
148
|
-
[chunks.first, chunks.last[0]],
|
148
|
+
([chunks.first, chunks.last[0]] if chunks.size > 1),
|
149
149
|
|
150
|
-
|
151
|
-
].map do |words|
|
150
|
+
*(1..chunks.size - 1).map { |i| chunks.take(i) }.reverse
|
151
|
+
].compact.map do |words|
|
152
152
|
Friends::RegexBuilder.regex(words.join(splitter))
|
153
153
|
end
|
154
154
|
end
|
data/lib/friends/tag_regex.rb
CHANGED
data/lib/friends/version.rb
CHANGED
data/test/add_event_helper.rb
CHANGED
@@ -258,6 +258,59 @@ FILE
|
|
258
258
|
end
|
259
259
|
end
|
260
260
|
|
261
|
+
describe "when a friend's first and middle name matches two other friends' first names" do
|
262
|
+
let(:description) { "Met Martin Luther." }
|
263
|
+
|
264
|
+
# Make sure "Martin Jones" and "Luther Jones" are closer friends than
|
265
|
+
# "Martin Luther King" so we know our test result isn't due to chance.
|
266
|
+
let(:content) do
|
267
|
+
<<-FILE
|
268
|
+
### Activities:
|
269
|
+
- 2018-01-01: Singing with **Martin Jones**.
|
270
|
+
- 2018-01-01: Dancing with **Luther Jones**.
|
271
|
+
|
272
|
+
### Notes:
|
273
|
+
|
274
|
+
### Friends:
|
275
|
+
- Luther Jones
|
276
|
+
- Martin Jones
|
277
|
+
- Martin Luther King
|
278
|
+
|
279
|
+
### Locations:
|
280
|
+
FILE
|
281
|
+
end
|
282
|
+
|
283
|
+
it { line_added "- #{date}: Met **Martin Luther King**." }
|
284
|
+
if test_stdout
|
285
|
+
it { stdout_only "#{capitalized_event} added: \"#{date}: Met Martin Luther King.\"" }
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
describe "when a friend has a first name only" do
|
290
|
+
# We want to explicitly check that the first-name last-initial behavior
|
291
|
+
# doesn't kick in here and match "Alejandra A" when the friend has no
|
292
|
+
# last name.
|
293
|
+
let(:description) { "Met Alejandra a few times." }
|
294
|
+
|
295
|
+
let(:content) do
|
296
|
+
<<-FILE
|
297
|
+
### Activities:
|
298
|
+
|
299
|
+
### Notes:
|
300
|
+
|
301
|
+
### Friends:
|
302
|
+
- Alejandra
|
303
|
+
|
304
|
+
### Locations:
|
305
|
+
FILE
|
306
|
+
end
|
307
|
+
|
308
|
+
it { line_added "- #{date}: Met **Alejandra** a few times." }
|
309
|
+
if test_stdout
|
310
|
+
it { stdout_only "#{capitalized_event} added: \"#{date}: Met Alejandra a few times.\"" }
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
261
314
|
describe "when description has a friend's name with leading asterisks" do
|
262
315
|
let(:description) { "Lunch with **Grace Hopper." }
|
263
316
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.43'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evelyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '12.3'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rubocop
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0.49'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0.49'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: simplecov
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -279,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
265
|
version: '0'
|
280
266
|
requirements: []
|
281
267
|
rubyforge_project:
|
282
|
-
rubygems_version: 2.
|
268
|
+
rubygems_version: 2.6.8
|
283
269
|
signing_key:
|
284
270
|
specification_version: 4
|
285
271
|
summary: Spend time with the people you care about.
|