friends 0.27 → 0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f518378eebb4f86c3a576648152ed462ed01618b
4
- data.tar.gz: 76c7d599c00fd30eb91034c07f699b9f9b23986e
3
+ metadata.gz: 31ada45e644c5d8473d57a70508d64f360dd3541
4
+ data.tar.gz: dc6d98844de09d8bfd8110dbe1fd0b2b468a6711
5
5
  SHA512:
6
- metadata.gz: c46eadf9adfbf48498f84eed1fe6dd7b7edc7563ad7ec66250465719a5653ebe44553d8639edda26abe14e5afa8d383e2784852a884f61bdb8f4b70bb99b3893
7
- data.tar.gz: 522058cf6e6b06d9d9fa8fffe24c7d7aeda87fe448a3349bfffe8627b637bfec96fb2ba70526c0fb4c6d37c61ce83a17cc9de4702555d8eb3a4319d89c55fade
6
+ metadata.gz: fd6409785d7d579a2ba0106757572970a28b5e23eb52c2e7c1dd227fbeeed92f7107c75f8780c3d6f397332b3ce41d23d0af3394f812d993e17147724814ed87
7
+ data.tar.gz: 3a9d5fa932b44adc0a27d4d73044d5eefb060cd6a363e4934d19d0274668d171eaab2f08914732bbcbd9da467ab1b31d65a3e82ac551e532191dc8e832f5ca4b
@@ -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
@@ -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, _|
@@ -47,23 +47,26 @@ module Friends
47
47
 
48
48
  # @return [String] the file serialization text for the friend
49
49
  def serialize
50
- "#{SERIALIZATION_PREFIX}#{self}"
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
- @nicknames.map { |n| "#{NICKNAME_PREFIX}#{n}" }.join(" ") +
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
- location_str = " [#{@location_name}]" unless @location_name.nil?
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Friends
4
- VERSION = "0.27"
4
+ VERSION = "0.28"
5
5
  end
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.27'
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-22 00:00:00.000000000 Z
11
+ date: 2016-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic