cartograph 1.0.1 → 1.0.2

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: 90b543ae76c47f554c739ccbb63a326eb070fc49
4
- data.tar.gz: bf168f87091650914b8dc78135d39e6035c99bca
3
+ metadata.gz: 5b338abbffa462113f4b56ec8db6893b229a9aee
4
+ data.tar.gz: 066670b2d5e2ded2ceb9e35f17721f9c330f57cf
5
5
  SHA512:
6
- metadata.gz: aac68c2c8060a0eba221aa52a27021c7ed581940b6d433df43089de09bd514291a9c44904b6d975eb3148a79127ae941f34e86cf5c1dfa4b964facacf273eb42
7
- data.tar.gz: 68d5375c67f29828d40f71c3f6e606e729f0d1258ee0affd915b6b601c81f1c2c88a31c3316e9004f646fc902350fd81d7c33a9b86ea4d35dfa603709bf0e156
6
+ metadata.gz: bb55e3757afc9ca5fc2dcea2ad3595a6411badef806d816d96c268bcb4ab7057661b3ffbcbf8ee06f6588ec845fa1bbcdbc4dc1f9155d8d4e2662dbf91a5ea36
7
+ data.tar.gz: 48290e66de6817b117f23ad199573e0d8ca6f9e3b100000cb58ed3eaa1f5348f1e96e8a3c990204f6397c1523e1f947a4ec2edefbdf25db63050eb9bcfa43435
@@ -3,6 +3,11 @@ Cartograph Changelog
3
3
 
4
4
  ### master
5
5
 
6
+ ### [v1.0.2][v1.0.2] (November 7, 2017)
7
+
8
+ * Fixed the "possibly useless use of ... in void context" warning
9
+ ([#8](https://github.com/kyrylo/cartograph/pull/8))
10
+
6
11
  ### [v1.0.1][v1.0.1] (September 8, 2017)
7
12
 
8
13
  * Fixed Ruby warnings ([#6](https://github.com/kyrylo/cartograph/pull/6))
@@ -14,3 +19,4 @@ Cartograph Changelog
14
19
 
15
20
  [v1.0.0]: https://github.com/kyrylo/cartograph/releases/tag/v1.0.0
16
21
  [v1.0.1]: https://github.com/kyrylo/cartograph/releases/tag/v1.0.1
22
+ [v1.0.2]: https://github.com/kyrylo/cartograph/releases/tag/v1.0.2
@@ -2,10 +2,18 @@ require 'forwardable'
2
2
 
3
3
  module Cartograph
4
4
  class PropertyCollection
5
+ # When either of these methods is used with 'def_delegators' Ruby prints a
6
+ # warning such as "possibly useless use of ... in void context". To work
7
+ # around it, we skip them in 'def_delegators' and define them manually.
8
+ WARNING_METHODS = %i[& * + - |]
9
+
5
10
  # Make this collection quack like an array
6
11
  # http://words.steveklabnik.com/beware-subclassing-ruby-core-classes
7
12
  extend Forwardable
8
- def_delegators :@collection, *(Array.instance_methods - Object.instance_methods)
13
+ def_delegators(
14
+ :@collection,
15
+ *(Array.instance_methods - Object.instance_methods - WARNING_METHODS)
16
+ )
9
17
 
10
18
  def initialize(*)
11
19
  @collection = []
@@ -23,5 +31,25 @@ module Cartograph
23
31
  property == other[index]
24
32
  end
25
33
  end
34
+
35
+ def &(other)
36
+ @collection & other
37
+ end
38
+
39
+ def *(other)
40
+ @collection * other
41
+ end
42
+
43
+ def +(other)
44
+ @collection + other
45
+ end
46
+
47
+ def -(other)
48
+ @collection + other
49
+ end
50
+
51
+ def |(other)
52
+ @collection | other
53
+ end
26
54
  end
27
55
  end
@@ -1,3 +1,3 @@
1
1
  module Cartograph
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cartograph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Ross
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-07 00:00:00.000000000 Z
12
+ date: 2017-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.6.8
116
+ rubygems_version: 2.6.13
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Cartograph makes it easy to generate and convert JSON. It's intention is