friends 0.25 → 0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 858f0bb2e50b71b1b716d3eaf88e5106231ddd61
4
- data.tar.gz: dd9290e06e2ef48d27647596f54397c85fbfaf17
3
+ metadata.gz: 045b1ac8af5c8004d171bf68792d452509beb67b
4
+ data.tar.gz: 817d9105c51b235a4d317ef4bc7271a55b888739
5
5
  SHA512:
6
- metadata.gz: effd46430149b527101da397820d12000788919f2ba18739e7d4f311f7bcc8c9df442f40c00233ed60c5e768c5e16ffdfc42fc34776c86e786f51def19a33daf
7
- data.tar.gz: 2cd814bb39b04da722a2ede75420f44ab2178282e34be63f6ccab97175d245337323bcb601bcdc665f242d71b019119cecdf314863f64cc758a05da7eb32370b
6
+ metadata.gz: bc9894a009593305940c9b241374d7e7fa8568f83152efdf59522b74fa7caad9af32c2990cc055428856e5f1835ff4b74028ead5dfa7c96f26e5f6a93e9af8c4
7
+ data.tar.gz: 52d6e320aefd0fd4a45373ae20b1aa36c2b96f24367c35d61a13f10d29470c78ada7640460e03565f06084c2f389229f8689eca9519cbe18a26aca9ff391224b
@@ -1,12 +1,20 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.25](https://github.com/JacobEvelyn/friends/tree/v0.25) (2016-05-22)
4
- [Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.24...v0.25)
3
+ ## [v0.26](https://github.com/JacobEvelyn/friends/tree/v0.26) (2016-05-23)
4
+ [Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.25...v0.26)
5
5
 
6
6
  **Fixed bugs:**
7
7
 
8
+ - Adding/filtering friend with tag but no nickname incorrectly counts the tag as part of the name [\#140](https://github.com/JacobEvelyn/friends/issues/140)
8
9
  - Error: stack level too deep [\#136](https://github.com/JacobEvelyn/friends/issues/136)
9
10
 
11
+ **Merged pull requests:**
12
+
13
+ - Fix deserialization for friends with tags and no nicknames [\#141](https://github.com/JacobEvelyn/friends/pull/141) ([JacobEvelyn](https://github.com/JacobEvelyn))
14
+
15
+ ## [v0.25](https://github.com/JacobEvelyn/friends/tree/v0.25) (2016-05-22)
16
+ [Full Changelog](https://github.com/JacobEvelyn/friends/compare/v0.24...v0.25)
17
+
10
18
  **Closed issues:**
11
19
 
12
20
  - Remove tag-migration code for 1.0 release [\#139](https://github.com/JacobEvelyn/friends/issues/139)
data/README.md CHANGED
@@ -5,6 +5,10 @@
5
5
  Spend time with the people you care about. Introvert-tested.
6
6
  Extrovert-approved.
7
7
 
8
+ **NOTE: Participation is encouraged! Make Issues, ask questions, submit Pull
9
+ Requests (even if it's your first time contributing to open-source—you'll get
10
+ lots of help), and give feedback!**
11
+
8
12
  ## Table of Contents
9
13
 
10
14
  - [Overview](#overview)
@@ -17,7 +17,7 @@ module Friends
17
17
  def self.deserialization_regex
18
18
  # Note: this regex must be on one line because whitespace is important
19
19
  # rubocop:disable Metrics/LineLength
20
- /(#{SERIALIZATION_PREFIX})?(?<name>[^\(\[#]*[^\(\[#\s])(\s+\(#{NICKNAME_PREFIX}(?<nickname_str>.+)\))?(\s+\[(?<location_name>[^\]]+)\])?(\s+(?<tags_str>(#{TAG_REGEX}\s*)+))?/
20
+ /(#{SERIALIZATION_PREFIX})?(?<name>[^\(\[@]*[^\(\[@\s])(\s+\(#{NICKNAME_PREFIX}(?<nickname_str>.+)\))?(\s+\[(?<location_name>[^\]]+)\])?(\s+(?<tags_str>(#{TAG_REGEX}\s*)+))?/
21
21
  # rubocop:enable Metrics/LineLength
22
22
  end
23
23
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Friends
4
- VERSION = "0.25"
4
+ VERSION = "0.26"
5
5
  end
@@ -24,6 +24,82 @@ describe Friends::Friend do
24
24
 
25
25
  it { proc { subject }.must_raise Serializable::SerializationError }
26
26
  end
27
+
28
+ describe "when string has one nickname" do
29
+ let(:serialized_str) { "Guybrush Threepwood (a.k.a. Brush)" }
30
+ it { subject.name.must_equal "Guybrush Threepwood" }
31
+ it { subject.instance_variable_get(:@nicknames).must_equal ["Brush"] }
32
+ end
33
+
34
+ describe "when string has multiple nicknames" do
35
+ let(:serialized_str) { "Guybrush Threepwood (a.k.a. Brush a.k.a. Guy)" }
36
+ it { subject.name.must_equal "Guybrush Threepwood" }
37
+ it do
38
+ subject.instance_variable_get(:@nicknames).must_equal ["Brush", "Guy"]
39
+ end
40
+ end
41
+
42
+ describe "when string has a location" do
43
+ let(:serialized_str) { "Guybrush Threepwood [Plunder Island]" }
44
+ it { subject.name.must_equal "Guybrush Threepwood" }
45
+ it { subject.location_name.must_equal "Plunder Island" }
46
+ end
47
+
48
+ describe "when string has one tag" do
49
+ let(:serialized_str) { "Guybrush Threepwood @pirate" }
50
+ it { subject.name.must_equal "Guybrush Threepwood" }
51
+ it { subject.tags.must_equal ["@pirate"] }
52
+ end
53
+
54
+ describe "when string has multiple tags" do
55
+ let(:serialized_str) { "Guybrush Threepwood @pirate @swashbuckler" }
56
+ it { subject.name.must_equal "Guybrush Threepwood" }
57
+ it { subject.tags.must_equal ["@pirate", "@swashbuckler"] }
58
+ end
59
+
60
+ describe "when string has nicknames and tags" do
61
+ let(:serialized_str) do
62
+ "Guybrush Threepwood (a.k.a. Brush a.k.a. Guy) @pirate @swashbuckler"
63
+ end
64
+ it { subject.name.must_equal "Guybrush Threepwood" }
65
+ it do
66
+ subject.instance_variable_get(:@nicknames).must_equal ["Brush", "Guy"]
67
+ end
68
+ it { subject.tags.must_equal ["@pirate", "@swashbuckler"] }
69
+ end
70
+
71
+ describe "when string has nicknames and a location" do
72
+ let(:serialized_str) do
73
+ "Guybrush Threepwood (a.k.a. Brush a.k.a. Guy) [Plunder Island]"
74
+ end
75
+ it { subject.name.must_equal "Guybrush Threepwood" }
76
+ it do
77
+ subject.instance_variable_get(:@nicknames).must_equal ["Brush", "Guy"]
78
+ end
79
+ it { subject.location_name.must_equal "Plunder Island" }
80
+ end
81
+
82
+ describe "when string has a location and tags" do
83
+ let(:serialized_str) do
84
+ "Guybrush Threepwood [Plunder Island] @pirate @swashbuckler"
85
+ end
86
+ it { subject.name.must_equal "Guybrush Threepwood" }
87
+ it { subject.location_name.must_equal "Plunder Island" }
88
+ it { subject.tags.must_equal ["@pirate", "@swashbuckler"] }
89
+ end
90
+
91
+ describe "when string has nicknames, a location, and tags" do
92
+ let(:serialized_str) do
93
+ "Guybrush Threepwood (a.k.a. Brush a.k.a. Guy) [Plunder Island] "\
94
+ "@pirate @swashbuckler"
95
+ end
96
+ it { subject.name.must_equal "Guybrush Threepwood" }
97
+ it do
98
+ subject.instance_variable_get(:@nicknames).must_equal ["Brush", "Guy"]
99
+ end
100
+ it { subject.location_name.must_equal "Plunder Island" }
101
+ it { subject.tags.must_equal ["@pirate", "@swashbuckler"] }
102
+ end
27
103
  end
28
104
 
29
105
  describe "#new" do
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.25'
4
+ version: '0.26'
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-05-22 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic