duckface-interfaces 0.0.4 → 0.0.5

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: 2595e9a679d9be84caf8e0afbf4c942fe3622267
4
- data.tar.gz: 01d464a555e12df3ffad3ecbb97d48d656b65abc
3
+ metadata.gz: 78c7146b486750ef72851c62e8d1906022cbe9da
4
+ data.tar.gz: cf4ef06c1d3593808a248eef813aa37583e6af48
5
5
  SHA512:
6
- metadata.gz: 2369548a1f3f4f9c3b181a2af47962f0557171c1d22d17b9d60c554c6d4e9ec0176671b9622ca858f9fb16e54e433629f2e28a7f7be6a7a0d0229aa3d38a6d2b
7
- data.tar.gz: c680789f43194c1f9ceb80c5923bd56245ab7d8630b341beb88a59adf9deb6c2a65d420fac1b541f923fbf788108f2394fdf45beb02de31033764de0fe409d50
6
+ metadata.gz: 721b26281cc32e0ce30625930d071cddd6c611f1ed381a42d6b5dfa40e724b5ae06e47c9050aa2ee393638faa905f48c5e78b881450c9849c324e0a021d0875a
7
+ data.tar.gz: 9a5716a76cbac9fc27c8a613b90b35e343b3a83eb9e0e7e71b4a02becaf4b96d03cb85a4d575d182e27290ebfe692bbc11a1e67d441578c1a9b1cfeca7a8c0d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.5
2
+
3
+ * Add support for dry-struct >= 0.6.0
4
+
1
5
  0.0.4
2
6
 
3
7
  * Add support for checking Dry::Struct's against an interface
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckface-interfaces (0.0.4)
4
+ duckface-interfaces (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -166,4 +166,4 @@ DEPENDENCIES
166
166
  spring-watcher-listen
167
167
 
168
168
  BUNDLED WITH
169
- 1.16.5
169
+ 1.17.1
data/MIT-LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018-2019 Samuel Giles
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -34,7 +34,15 @@ module Duckface
34
34
 
35
35
  def present_in_schema?
36
36
  return false unless schema?
37
- @klass.schema.keys.include?(@method_name)
37
+
38
+ schema_keys = @klass.schema.keys
39
+ if schema_keys.first.is_a?(Symbol)
40
+ @klass.schema.keys.include?(@method_name)
41
+ elsif schema_keys.first.respond_to?(:name)
42
+ @klass.schema.keys.map(&:name).include?(@method_name)
43
+ else
44
+ raise "Can't determine schema methods. `Class.schema.keys` returns array of unknown types."
45
+ end
38
46
  end
39
47
 
40
48
  def schema?
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'duckface/method_implementation'
4
4
  require 'duckface/check_session'
5
+ require 'forwardable'
5
6
 
6
7
  module Duckface
7
8
  module Services
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Duckface
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duckface-interfaces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bellroy Tech Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-04 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - Gemfile
70
70
  - Gemfile.lock
71
71
  - Guardfile
72
+ - MIT-LICENSE
72
73
  - README.md
73
74
  - Rakefile
74
75
  - bin/console