friends 0.27 → 0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +2 -1
- data/bin/friends +7 -0
- data/lib/friends/friend.rb +11 -8
- data/lib/friends/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31ada45e644c5d8473d57a70508d64f360dd3541
|
4
|
+
data.tar.gz: dc6d98844de09d8bfd8110dbe1fd0b2b468a6711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd6409785d7d579a2ba0106757572970a28b5e23eb52c2e7c1dd227fbeeed92f7107c75f8780c3d6f397332b3ce41d23d0af3394f812d993e17147724814ed87
|
7
|
+
data.tar.gz: 3a9d5fa932b44adc0a27d4d73044d5eefb060cd6a363e4934d19d0274668d171eaab2f08914732bbcbd9da467ab1b31d65a3e82ac551e532191dc8e832f5ca4b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.28](https://github.com/JacobEvelyn/friends/tree/v0.28) (2016-06-25)
|
4
|
+
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.27...v0.28)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Output `list friends` in color [\#125](https://github.com/JacobEvelyn/friends/issues/125)
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- Colorize `list friends` and add --colorless flag [\#151](https://github.com/JacobEvelyn/friends/pull/151) ([JacobEvelyn](https://github.com/JacobEvelyn))
|
13
|
+
|
3
14
|
## [v0.27](https://github.com/JacobEvelyn/friends/tree/v0.27) (2016-06-22)
|
4
15
|
[Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.26...v0.27)
|
5
16
|
|
data/README.md
CHANGED
@@ -142,8 +142,9 @@ specified before the name of the command, like: `friends [flags] [command]`.
|
|
142
142
|
|
143
143
|
These flags are:
|
144
144
|
|
145
|
+
- `--colorless`: Disable output colorization and other effects.
|
145
146
|
- `--debug`: Debug error messages with a full backtrace.
|
146
|
-
- `--filename`: Set the location of the friends file to use (default: ./friends.md)
|
147
|
+
- `--filename`: Set the location of the friends file to use (default: ./friends.md).
|
147
148
|
|
148
149
|
```bash
|
149
150
|
$ friends --filename ./test/tmp/friends.md clean
|
data/bin/friends
CHANGED
@@ -52,6 +52,10 @@ switch [:debug],
|
|
52
52
|
negatable: false,
|
53
53
|
desc: "Debug error messages with a full backtrace"
|
54
54
|
|
55
|
+
switch [:colorless],
|
56
|
+
negatable: false,
|
57
|
+
desc: "Disable output colorization and other effects"
|
58
|
+
|
55
59
|
desc "Updates the `friends` program"
|
56
60
|
command :update do |update|
|
57
61
|
update.action do
|
@@ -434,6 +438,9 @@ end
|
|
434
438
|
|
435
439
|
# Before each command, clean up all arguments and create the global Introvert.
|
436
440
|
pre do |global_options, cmd, options|
|
441
|
+
# If the --colorless flag is passed, don't do any fancy painting.
|
442
|
+
Paint.mode = 0 if global_options[:colorless]
|
443
|
+
|
437
444
|
@debug_mode = global_options[:debug]
|
438
445
|
|
439
446
|
final_options = global_options.merge!(options).select do |key, _|
|
data/lib/friends/friend.rb
CHANGED
@@ -47,23 +47,26 @@ module Friends
|
|
47
47
|
|
48
48
|
# @return [String] the file serialization text for the friend
|
49
49
|
def serialize
|
50
|
-
|
50
|
+
# Remove terminal effects for serialization.
|
51
|
+
Paint.unpaint("#{SERIALIZATION_PREFIX}#{self}")
|
51
52
|
end
|
52
53
|
|
53
54
|
# @return [String] a string representing the friend's name and nicknames
|
54
55
|
def to_s
|
55
56
|
unless @nicknames.empty?
|
56
|
-
nickname_str =
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
nickname_str = " (" +
|
58
|
+
@nicknames.map do |nickname|
|
59
|
+
"#{NICKNAME_PREFIX}#{Paint[nickname, :bold, :magenta]}"
|
60
|
+
end.join(" ") + ")"
|
60
61
|
end
|
61
62
|
|
62
|
-
|
63
|
+
unless @location_name.nil?
|
64
|
+
location_str = " [#{Paint[@location_name, :bold, :yellow]}]"
|
65
|
+
end
|
63
66
|
|
64
|
-
tag_str = " #{@tags.join(' ')}" unless @tags.empty?
|
67
|
+
tag_str = " #{Paint[@tags.join(' '), :bold, :cyan]}" unless @tags.empty?
|
65
68
|
|
66
|
-
"#{@name}#{nickname_str}#{location_str}#{tag_str}"
|
69
|
+
"#{Paint[@name, :bold]}#{nickname_str}#{location_str}#{tag_str}"
|
67
70
|
end
|
68
71
|
|
69
72
|
# Adds a tag, ignoring duplicates.
|
data/lib/friends/version.rb
CHANGED
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.28'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evelyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|