friends 0.39 → 0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +17 -2
- data/README.md +93 -95
- data/bin/friends +13 -4
- data/friends.gemspec +15 -10
- data/lib/friends/commands/edit.rb +1 -4
- data/lib/friends/commands/list.rb +4 -23
- data/lib/friends/event.rb +2 -0
- data/lib/friends/graph.rb +6 -5
- data/lib/friends/introvert.rb +65 -98
- data/lib/friends/version.rb +1 -1
- data/test/commands/graph_spec.rb +94 -94
- data/test/commands/list/activities_spec.rb +0 -21
- data/test/commands/list/favorite/friends_spec.rb +0 -48
- data/test/commands/list/favorite/locations_spec.rb +0 -53
- data/test/commands/list/notes_spec.rb +0 -21
- data/test/paging_spec.rb +34 -0
- metadata +21 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '085e7f4ef953b8204cd17bf0476a5b6a2ca7a500cd701a580ead6af0082ef7c6'
|
4
|
+
data.tar.gz: c2d6edf62f52c4499cad6df6376d97ddffe5bc4199e5136542b90479c34d4309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8d3c11759d07777bbb95662350326431f4a8a8038af0fd6c94905d07968222e9b433b9963ff169b81d5c3d54b588863b5abf497cb4e4c3f5e657170ef76ff2
|
7
|
+
data.tar.gz: 18901f6852709d0f32ce3a4ef69b31dcc23b1877376ef3b7e5900cb9c07591f10af4ec74186c5075f2139a339376dc47c079c182cb49a24cb230bf6fdd7967f7
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,17 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
14
14
|
|
15
15
|
👆 Donate with these buttons! 👆
|
16
16
|
|
17
|
+
## [v0.40](https://github.com/JacobEvelyn/friends/tree/v0.40) (2018-09-22)
|
18
|
+
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.39...v0.40)
|
19
|
+
|
20
|
+
**Implemented enhancements:**
|
21
|
+
|
22
|
+
- Page all output, and remove --limit options [\#156](https://github.com/JacobEvelyn/friends/issues/156)
|
23
|
+
|
24
|
+
**Merged pull requests:**
|
25
|
+
|
26
|
+
- Page all output, and remove --limit options [\#205](https://github.com/JacobEvelyn/friends/pull/205) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
27
|
+
|
17
28
|
## [v0.39](https://github.com/JacobEvelyn/friends/tree/v0.39) (2018-08-02)
|
18
29
|
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.38...v0.39)
|
19
30
|
|
@@ -38,7 +49,7 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
38
49
|
- Give name-matching priority to full-text matches [\#203](https://github.com/JacobEvelyn/friends/pull/203) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
39
50
|
- Prevent the addition of blank events, names, and locations [\#200](https://github.com/JacobEvelyn/friends/pull/200) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
40
51
|
- Fix Rubocop errors [\#196](https://github.com/JacobEvelyn/friends/pull/196) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
41
|
-
- Update rake requirement to ~\> 12.3 [\#194](https://github.com/JacobEvelyn/friends/pull/194) ([dependabot[bot]](https://github.com/
|
52
|
+
- Update rake requirement to ~\> 12.3 [\#194](https://github.com/JacobEvelyn/friends/pull/194) ([dependabot[bot]](https://github.com/marketplace/dependabot))
|
42
53
|
|
43
54
|
## [v0.37](https://github.com/JacobEvelyn/friends/tree/v0.37) (2018-02-24)
|
44
55
|
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.36...v0.37)
|
@@ -470,6 +481,10 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
470
481
|
- Error: undefined method `n\_activities' for nil:NilClass [\#44](https://github.com/JacobEvelyn/friends/issues/44)
|
471
482
|
- Documentation link doesn't work [\#43](https://github.com/JacobEvelyn/friends/issues/43)
|
472
483
|
|
484
|
+
**Closed issues:**
|
485
|
+
|
486
|
+
- Edit friend information from command line [\#47](https://github.com/JacobEvelyn/friends/issues/47)
|
487
|
+
|
473
488
|
**Merged pull requests:**
|
474
489
|
|
475
490
|
- Fix `suggest` command for low number of friends [\#48](https://github.com/JacobEvelyn/friends/pull/48) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
@@ -575,4 +590,4 @@ making a small donation (🙏) to show you appreciate its continued development.
|
|
575
590
|
## [v0.0.1](https://github.com/JacobEvelyn/friends/tree/v0.0.1) (2014-12-11)
|
576
591
|
|
577
592
|
|
578
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
593
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/friends.svg)](https://badge.fury.io/rb/friends)
|
2
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/JacobEvelyn/friends.svg)](https://gemnasium.com/github.com/JacobEvelyn/friends)
|
3
2
|
[![Coverage Status](https://coveralls.io/repos/github/JacobEvelyn/friends/badge.svg)](https://coveralls.io/github/JacobEvelyn/friends)
|
4
3
|
[![Build Status](https://travis-ci.org/JacobEvelyn/friends.svg?branch=master)](https://travis-ci.org/JacobEvelyn/friends)
|
5
4
|
[![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=JacobEvelyn/friends&bust=1)](http://clayallsopp.github.io/readme-score?url=JacobEvelyn/friends)
|
@@ -31,48 +30,49 @@ lots of help), and give feedback!**
|
|
31
30
|
|
32
31
|
## Table of Contents
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
33
|
+
- [Overview](#overview)
|
34
|
+
- [Installation](#installation)
|
35
|
+
- [A note on output](#a-note-on-output)
|
36
|
+
- [Usage](#usage)
|
37
|
+
- [Core concepts](#core-concepts)
|
38
|
+
- [Global flags](#global-flags)
|
39
|
+
- [Syncing across multiple machines](#syncing-across-multiple-machines)
|
40
|
+
- [Setting reminders](#setting-reminders)
|
41
|
+
- [Command reference](#command-reference)
|
42
|
+
- `add`
|
43
|
+
- [`add activity`](#add-activity)
|
44
|
+
- [`add note`](#add-note)
|
45
|
+
- [`add friend`](#add-friend)
|
46
|
+
- [`add tag`](#add-tag)
|
47
|
+
- [`add location`](#add-location)
|
48
|
+
- [`add nickname`](#add-nickname)
|
49
|
+
- [`clean`](#clean)
|
50
|
+
- [`graph`](#graph)
|
51
|
+
- [`help`](#help)
|
52
|
+
- `list`
|
53
|
+
- [`list activities`](#list-activities)
|
54
|
+
- [`list notes`](#list-notes)
|
55
|
+
- `list favorite`
|
56
|
+
- [`list favorite friends`](#list-favorite-friends)
|
57
|
+
- [`list favorite locations`](#list-favorite-locations)
|
58
|
+
- [`list friends`](#list-friends)
|
59
|
+
- [`list tags`](#list-tags)
|
60
|
+
- [`list locations`](#list-locations)
|
61
|
+
- [Advanced searching](#advanced-searching)
|
62
|
+
- `remove`
|
63
|
+
- [`remove tag`](#remove-tag)
|
64
|
+
- [`remove nickname`](#remove-nickname)
|
65
|
+
- `rename`
|
66
|
+
- [`rename friend`](#rename-friend)
|
67
|
+
- [`rename location`](#rename-location)
|
68
|
+
- [`set location`](#set-location)
|
69
|
+
- [`stats`](#stats)
|
70
|
+
- [`suggest`](#suggest)
|
71
|
+
- [`update`](#update)
|
72
|
+
- [Other documentation](#other-documentation)
|
73
|
+
- [Contributing (it's encouraged!)](#contributing-its-encouraged)
|
74
|
+
- [Code of Conduct](#code-of-conduct)
|
75
|
+
- [License](#license)
|
76
76
|
|
77
77
|
---
|
78
78
|
|
@@ -83,22 +83,24 @@ people you care about.
|
|
83
83
|
|
84
84
|
`friends` gives you:
|
85
85
|
|
86
|
-
|
86
|
+
- More organization around staying in touch with friends and
|
87
87
|
family.
|
88
|
-
|
88
|
+
- A way to track the ebbs and flows of your relationships over
|
89
89
|
time.
|
90
|
-
|
90
|
+
- Suggestions for who to call or hang out with when you have free
|
91
91
|
time, whether it's fifteen minutes or an entire weekend.
|
92
|
-
|
92
|
+
- A low-cost way to record and remember big moments in your life.
|
93
93
|
|
94
94
|
Its philosophy emphasizes:
|
95
95
|
|
96
|
-
|
97
|
-
|
96
|
+
- **Simplicity**—it should be quick and easy to use.
|
97
|
+
- **Transparency**—all data is stored in a human-readable Markdown file. No
|
98
98
|
proprietary formats here! And in addition to being open-source, `friends` is
|
99
|
-
very much open to new ideas.
|
100
|
-
|
101
|
-
|
99
|
+
very much open to new ideas. Please
|
100
|
+
[contribute](https://github.com/JacobEvelyn/friends#contributing-its-encouraged)!
|
101
|
+
- **Intelligence**—specify dates with English phrases like "yesterday." Specify
|
102
|
+
friends with their first names, even when you're friends with many *Joanne*s.
|
103
|
+
`friends` will figure it out.
|
102
104
|
|
103
105
|
## Installation
|
104
106
|
|
@@ -108,58 +110,80 @@ $ gem install friends
|
|
108
110
|
|
109
111
|
Easy, huh?
|
110
112
|
|
113
|
+
## A note on output
|
114
|
+
|
115
|
+
To make its output easier to view and work with, `friends` "pages" its output.
|
116
|
+
This means that when it has a lot to print it will let you scroll up or down
|
117
|
+
in your terminal to view all of it.
|
118
|
+
|
119
|
+
By default, `friends` tries to use the `less -RFX` command for paging, which should
|
120
|
+
be available on most systems, and if that is not available falls back to simply
|
121
|
+
printing the output. However, you can set a different pager by setting the `FRIENDS_PAGER`
|
122
|
+
environment variable. If you have `less`
|
123
|
+
[version 530](http://www.greenwoodsoftware.com/less/news.530.html) or later
|
124
|
+
[we recommend using](https://unix.stackexchange.com/a/432254/181957#comment784324_432254)
|
125
|
+
this instead:
|
126
|
+
|
127
|
+
```bash
|
128
|
+
FRIENDS_PAGER="less -RF"
|
129
|
+
```
|
130
|
+
|
111
131
|
## Usage
|
112
132
|
|
113
133
|
### Core concepts
|
114
134
|
|
115
135
|
`friends` is structured around several different types of things:
|
116
136
|
|
117
|
-
|
137
|
+
- **Activities**: The things you do. Each activity has a date associated with
|
118
138
|
it. Activities may optionally contain any number of _friends_, _locations_,
|
119
139
|
and _tags_.
|
120
|
-
|
140
|
+
- **Friends**: The people you do _activities_ with. Each friend has a name and,
|
121
141
|
optionally, one or several nicknames. (Examples: `John`, `Grace Hopper`)
|
122
|
-
|
142
|
+
- **Locations**: The places in which _activities_ happen. (Examples: `Paris`,
|
123
143
|
`Marie's Diner`)
|
124
|
-
|
144
|
+
- **Tags**: A way to categorize your _activities_ with tags of your
|
125
145
|
choosing. Tags may contain colons and hyphens inside them. (Examples: `@exercise:running`, `@school`, `@science:indoors:agronomy-with-hydroponics`)
|
126
|
-
|
146
|
+
- **Notes**: Any additional information you want to record about a _friend_
|
127
147
|
or _location_. (Example: `John and Jane got engaged.`)
|
128
148
|
|
129
149
|
The `friends.md` Markdown file that stores all of your data contains:
|
130
150
|
|
131
|
-
|
151
|
+
- an alphabetical list of all locations:
|
132
152
|
|
133
153
|
```markdown
|
134
154
|
### Locations:
|
155
|
+
|
135
156
|
- Atlantis
|
136
157
|
- Marie's Diner
|
137
158
|
- Paris
|
138
159
|
```
|
139
160
|
|
140
|
-
|
161
|
+
- an alphabetical list of all friends and their nicknames and locations:
|
141
162
|
|
142
163
|
```markdown
|
143
164
|
### Friends:
|
165
|
+
|
144
166
|
- George Washington Carver
|
145
167
|
- Grace Hopper (a.k.a. The Admiral a.k.a. Amazing Grace) [Paris]
|
146
168
|
- Marie Curie [Atlantis]
|
147
169
|
```
|
148
170
|
|
149
|
-
|
171
|
+
- an ordered list of all activities:
|
150
172
|
|
151
173
|
```markdown
|
152
174
|
### Activities:
|
175
|
+
|
153
176
|
- 2018-11-01: **Grace Hopper** and I went to _Marie's Diner_. George had to cancel at the last minute.
|
154
177
|
- 2018-01-04: Got lunch with **Grace Hopper** and **George Washington Carver**.
|
155
178
|
- 2017-12-31: Celebrated the new year in _Paris_ with **Marie Curie**.
|
156
179
|
- 2017-11-15: Talked to **George Washington Carver** on the phone for an hour.
|
157
180
|
```
|
158
181
|
|
159
|
-
|
182
|
+
- and an ordered list of all notes:
|
160
183
|
|
161
184
|
```markdown
|
162
185
|
### Notes:
|
186
|
+
|
163
187
|
- 2018-06-15: **Grace Hopper** found out she's getting a big Naval Academy building named after her. @navy
|
164
188
|
- 2017-06-06: **Marie Curie** just got accepted into a PhD program in _Paris_. @school
|
165
189
|
```
|
@@ -175,16 +199,16 @@ specified before the name of the command, like: `friends [flags] [command]`.
|
|
175
199
|
|
176
200
|
These flags are:
|
177
201
|
|
178
|
-
|
179
|
-
|
180
|
-
|
202
|
+
- `--colorless`: Disable output colorization and other effects.
|
203
|
+
- `--debug`: Debug error messages with a full backtrace.
|
204
|
+
- `--filename`: Set the location of the friends file to use (default: `./friends.md`).
|
181
205
|
|
182
206
|
```bash
|
183
207
|
$ friends --filename ./test/tmp/friends.md clean
|
184
208
|
File cleaned: "./test/tmp/friends.md"
|
185
209
|
```
|
186
210
|
|
187
|
-
|
211
|
+
- `--quiet`: Quiet output messages.
|
188
212
|
|
189
213
|
```bash
|
190
214
|
$ friends --quiet add activity Went rollerskating with George.
|
@@ -193,7 +217,7 @@ $ # No output!
|
|
193
217
|
|
194
218
|
In addition, these flags may be used without any command:
|
195
219
|
|
196
|
-
|
220
|
+
- `--help`: Show the help menu. This is equivalent to `friends help`.
|
197
221
|
Help menus are available for all levels of commands:
|
198
222
|
|
199
223
|
```bash
|
@@ -208,7 +232,7 @@ $ friends list --help
|
|
208
232
|
$ friends list activities --help
|
209
233
|
```
|
210
234
|
|
211
|
-
|
235
|
+
- `--version`: Show the `friends` program version.
|
212
236
|
|
213
237
|
### Syncing across multiple machines
|
214
238
|
|
@@ -583,15 +607,7 @@ $ friends list activities
|
|
583
607
|
2017-11-15: Talked to George Washington Carver on the phone for an hour.
|
584
608
|
```
|
585
609
|
|
586
|
-
You can
|
587
|
-
|
588
|
-
```bash
|
589
|
-
$ friends list activities --limit 2
|
590
|
-
2018-01-04: Got lunch with Grace Hopper and George Washington Carver. @food
|
591
|
-
2017-12-31: Celebrated the new year with Marie Curie in New York City. @partying:ball-drop
|
592
|
-
```
|
593
|
-
|
594
|
-
Or only list the activities you did with a certain friend:
|
610
|
+
You can list the activities you did with a certain friend:
|
595
611
|
|
596
612
|
```bash
|
597
613
|
$ friends list activities --with George
|
@@ -599,7 +615,7 @@ $ friends list activities --with George
|
|
599
615
|
2017-11-15: Talked to George Washington Carver on the phone for an hour.
|
600
616
|
```
|
601
617
|
|
602
|
-
Or only
|
618
|
+
Or only activities done with a group of friends:
|
603
619
|
|
604
620
|
```bash
|
605
621
|
$ friends list activities --with George --with Grace
|
@@ -670,15 +686,6 @@ Your favorite friends:
|
|
670
686
|
3. Marie Curie (0)
|
671
687
|
```
|
672
688
|
|
673
|
-
You can specify a number of favorites to show:
|
674
|
-
|
675
|
-
```bash
|
676
|
-
$ friends list favorite friends --limit 2
|
677
|
-
Your favorite friends:
|
678
|
-
1. George Washington Carver (2 activities)
|
679
|
-
2. Grace Hopper (1)
|
680
|
-
```
|
681
|
-
|
682
689
|
#### `list favorite locations`
|
683
690
|
|
684
691
|
Lists your "favorite" locations (by total number of activities):
|
@@ -691,15 +698,6 @@ Your favorite locations:
|
|
691
698
|
3. London (0)
|
692
699
|
```
|
693
700
|
|
694
|
-
You can specify a number of favorites to show:
|
695
|
-
|
696
|
-
```bash
|
697
|
-
$ friends list favorite locations --limit 2
|
698
|
-
Your favorite locations:
|
699
|
-
1. Atlantis (2 activities)
|
700
|
-
2. Paris (1)
|
701
|
-
```
|
702
|
-
|
703
701
|
#### `list friends`
|
704
702
|
|
705
703
|
Lists all of your friends in alphabetical order:
|
data/bin/friends
CHANGED
@@ -76,6 +76,7 @@ pre do |global_options, cmd|
|
|
76
76
|
# If the --colorless flag is passed, don't do any fancy painting.
|
77
77
|
Paint.mode = 0 if global_options[:colorless]
|
78
78
|
|
79
|
+
@quiet_mode = global_options[:quiet]
|
79
80
|
@debug_mode = global_options[:debug]
|
80
81
|
|
81
82
|
# If we're updating the friends program we don't need to read the friends file
|
@@ -84,10 +85,7 @@ pre do |global_options, cmd|
|
|
84
85
|
# @introvert until the command block when the system call has exited
|
85
86
|
# successfully.
|
86
87
|
unless [:update, :edit].include? cmd.name
|
87
|
-
@introvert = Friends::Introvert.new(
|
88
|
-
filename: global_options[:filename],
|
89
|
-
quiet: global_options[:quiet]
|
90
|
-
)
|
88
|
+
@introvert = Friends::Introvert.new(filename: global_options[:filename])
|
91
89
|
end
|
92
90
|
|
93
91
|
true # Continue executing the command.
|
@@ -96,6 +94,17 @@ end
|
|
96
94
|
post do
|
97
95
|
# After each command, clean the file if we have modifications to make.
|
98
96
|
@introvert.clean(clean_command: @clean_command) if @dirty
|
97
|
+
|
98
|
+
if @introvert && !@quiet_mode
|
99
|
+
begin
|
100
|
+
IO.popen(ENV["FRIENDS_PAGER"] || "less -RFX", "w") { |pipe| pipe.puts @introvert.output }
|
101
|
+
rescue Errno::ENOENT
|
102
|
+
# If the pager is not installed, just print the output.
|
103
|
+
puts @introvert.output
|
104
|
+
rescue Errno::EPIPE # rubocop:disable Lint/HandleExceptions
|
105
|
+
# Occurs when quitting the pager.
|
106
|
+
end
|
107
|
+
end
|
99
108
|
end
|
100
109
|
|
101
110
|
# If an error is raised, print the message to STDERR and exit the program.
|
data/friends.gemspec
CHANGED
@@ -5,28 +5,33 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require "friends/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
|
15
|
-
spec.homepage
|
16
|
-
spec.license
|
8
|
+
spec.name = "friends"
|
9
|
+
spec.version = Friends::VERSION
|
10
|
+
spec.authors = ["Jacob Evelyn"]
|
11
|
+
spec.email = ["jacobevelyn@gmail.com"]
|
12
|
+
spec.summary = "Spend time with the people you care about."
|
13
|
+
spec.description = "Spend time with the people you care about. "\
|
14
|
+
"Introvert-tested. Extrovert-approved."
|
15
|
+
spec.homepage = "https://github.com/JacobEvelyn/friends"
|
16
|
+
spec.license = "MIT"
|
17
|
+
spec.post_install_message = "friends is a volunteer project. If you find it useful, please "\
|
18
|
+
"consider making a small donation:\n\t"\
|
19
|
+
"https://github.com/JacobEvelyn/friends#contributing-its-encouraged"
|
17
20
|
|
18
21
|
spec.files = `git ls-files -z`.split("\x0")
|
19
22
|
spec.executables = ["friends"]
|
20
23
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
24
|
spec.require_paths = ["lib"]
|
22
25
|
|
23
|
-
# We need Ruby 2.
|
26
|
+
# We need Ruby 2.1's default-less keyword arguments and default UTF-8
|
27
|
+
# encoding.
|
24
28
|
spec.required_ruby_version = ">= 2.1"
|
25
29
|
|
26
30
|
spec.add_dependency "chronic", "~> 0.10"
|
27
31
|
spec.add_dependency "gli", "~> 2.14"
|
28
32
|
spec.add_dependency "paint", "~> 2.0"
|
29
33
|
spec.add_dependency "semverse", "~> 2.0"
|
34
|
+
spec.add_dependency "tty-pager", "~> 0.11"
|
30
35
|
|
31
36
|
spec.add_development_dependency "bundler", "~> 1.6"
|
32
37
|
spec.add_development_dependency "coveralls", "~> 0.8"
|