interface_comparator 0.1.1 → 0.2.1

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: ab52ecbe5d7bbe7c2135073b650a96e7a68df233
4
- data.tar.gz: 0ee0f8b979afa011e8ef340c8834befa603ea244
3
+ metadata.gz: 72fe80ef785b45a49d3d797b0a4b89fcd3840861
4
+ data.tar.gz: 37acee2a314d3bfcc6ac129c51c227b53174207e
5
5
  SHA512:
6
- metadata.gz: 1a72e81effab2c519c736284cdb6bf22f7c6ffa1918f1053b2a5922c6b360fd8472ae3ab6a1ff9b6937a300e29b9f75d75f5c68607bcd6762c3fc1d04ca77ae6
7
- data.tar.gz: ca6ebad2c0e5cd90e8c2d6e2adb3ffd98b862e65b6ccc868b44c58fe753c389ea4d3dd0c09ac6fb3740d0b79f2375212854a552317fb655537b5018e41a92c96
6
+ metadata.gz: 8df2e9d820bd5b7c7a7e870cb43bcdff06af2c1ee7df68d9ba2b97531857962df581d487b1540b61dcce37bf19646a5af6930f4f15090c34ee286308baf0bea9
7
+ data.tar.gz: 5f00aad85d3a02f81922926b7556fe742fb3c850771f1ea97f5635c8a4e92aa7ca03edb3450ff93d4368382b6dbc1f466fc76cb14d7d4a87d327b288d639543c
data/README.md CHANGED
@@ -22,11 +22,11 @@ Or install it yourself as:
22
22
  require 'interface_comparator'
23
23
  # check if two objects has the same interface
24
24
  # including public methods list and their arity
25
- InterfaceComparator.interfaces_are_same?(a, b) # => true or false
25
+ InterfaceComparator.same?(a, b) # => true or false
26
26
 
27
27
  # see detailed list of difference between interfaces
28
28
  # of two objects
29
- InterfaceComparator.diff_interfaces(a, b)
29
+ InterfaceComparator.diff(a, b)
30
30
  # if there are difference between methods
31
31
  # it will return them in aa array of hashes:
32
32
  #[{
@@ -58,7 +58,7 @@ assert_equal_interfaces a, b
58
58
  refute_equal_interfaces a, b
59
59
  ```
60
60
 
61
- Output in case of failure will be similar to those in diff_interfaces.
61
+ Output in case of failure will be similar to those in diff.
62
62
 
63
63
  ## Development
64
64
 
@@ -4,12 +4,12 @@ require 'interface_comparator/version'
4
4
  # including public methods list and their arity
5
5
  module InterfaceComparator
6
6
  # is the interface of this two objects are the same?
7
- def self.interfaces_are_same?(a, b)
8
- diff_interfaces(a, b).empty?
7
+ def self.same?(a, b)
8
+ diff(a, b).empty?
9
9
  end
10
10
 
11
11
  # show me the difference between interface of these two objects
12
- def self.diff_interfaces(a, b)
12
+ def self.diff(a, b)
13
13
  methods_diff = diff_methods(a, b)
14
14
  return methods_diff unless methods_diff.empty?
15
15
  arity_diff = methods_arity_diff(a, b)
@@ -3,15 +3,15 @@ module Minitest::Assertions
3
3
  # Fails unless +object_a and +object_a have the same interfaces (in terms of method and their arity).
4
4
  #
5
5
  def assert_equal_interfaces(object_a, object_b)
6
- assert InterfaceComparator.interfaces_are_same?(object_a, object_b),
7
- "Interfaces are not the same: #{InterfaceComparator.diff_interfaces(object_a, object_b)}"
6
+ assert InterfaceComparator.same?(object_a, object_b),
7
+ "Interfaces are not the same: #{InterfaceComparator.diff(object_a, object_b)}"
8
8
  end
9
9
 
10
10
  #
11
11
  # Fails if +object_a and +object_a have the same interfaces (in terms of method and their arity).
12
12
  #
13
13
  def refute_equal_interfaces(object_a, object_b)
14
- refute InterfaceComparator.interfaces_are_same?(object_a, object_b),
14
+ refute InterfaceComparator.same?(object_a, object_b),
15
15
  "Interfaces are of these two object are the same"
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module InterfaceComparator
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interface_comparator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Szmielew
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-10 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.6.11
109
+ rubygems_version: 2.6.13
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Module that checks if two objects has the same interface including public