duckface-interfaces 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +57 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -2
- data/README.md +13 -1
- data/lib/duckface/implementation_methods.rb +4 -0
- data/lib/duckface/object_sugar.rb +10 -2
- data/lib/duckface/version.rb +1 -1
- metadata +3 -3
- data/lib/duckface/example_class.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30396b46a38049271ab9ed210b927668e994da99
|
4
|
+
data.tar.gz: 56d6a155fde25658a4e7cb1a735b0d74a6efbce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 296f5f84390d8f29802e599678e7cd094e68dd0dd405deb91e0e081d526082ce0fa1be9b250530bdfb21d581056ab6455d1206d1686200f30982d7064a2102cd
|
7
|
+
data.tar.gz: 87bcbc634568b6dd6d4764be504f55752541fb6432d29d0aa6886a1540eac79fa30973954d10b979d7a6a71e2029122a89fafb519c68040c2acb8cdaeab99946
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.4.4-node-browsers
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- checkout
|
21
|
+
|
22
|
+
# Download and cache dependencies
|
23
|
+
- restore_cache:
|
24
|
+
keys:
|
25
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
26
|
+
# fallback to using the latest cache if no exact match is found
|
27
|
+
- v1-dependencies-
|
28
|
+
|
29
|
+
- run:
|
30
|
+
name: install dependencies
|
31
|
+
command: |
|
32
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
33
|
+
|
34
|
+
- save_cache:
|
35
|
+
paths:
|
36
|
+
- ./vendor/bundle
|
37
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
38
|
+
|
39
|
+
# run tests!
|
40
|
+
- run:
|
41
|
+
name: run tests
|
42
|
+
command: |
|
43
|
+
mkdir /tmp/test-results
|
44
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
45
|
+
|
46
|
+
bundle exec rspec --format progress \
|
47
|
+
--format RspecJunitFormatter \
|
48
|
+
--out /tmp/test-results/rspec.xml \
|
49
|
+
--format progress \
|
50
|
+
$TEST_FILES
|
51
|
+
|
52
|
+
# collect reports
|
53
|
+
- store_test_results:
|
54
|
+
path: /tmp/test-results
|
55
|
+
- store_artifacts:
|
56
|
+
path: /tmp/test-results
|
57
|
+
destination: test-results
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
0.0.2
|
2
|
+
|
3
|
+
* Add `Class.says_it_implements?` for quickly checking whether a class says it is implementing a given interface. This doesn't perform the full method/params checking that happens on `.check_it_implements`.
|
4
|
+
* Make `.check_it_implements` available on any class
|
5
|
+
|
1
6
|
0.0.1
|
2
7
|
|
3
8
|
* Initial release
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
duckface (0.0.1)
|
4
|
+
duckface-interfaces (0.0.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -105,6 +105,8 @@ GEM
|
|
105
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
106
106
|
rspec-support (~> 3.6.0)
|
107
107
|
rspec-support (3.6.0)
|
108
|
+
rspec_junit_formatter (0.4.1)
|
109
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
108
110
|
rubocop (0.49.1)
|
109
111
|
parallel (~> 1.10)
|
110
112
|
parser (>= 2.3.3.1, < 3.0)
|
@@ -146,7 +148,7 @@ PLATFORMS
|
|
146
148
|
|
147
149
|
DEPENDENCIES
|
148
150
|
bundler (>= 1.13)
|
149
|
-
duckface!
|
151
|
+
duckface-interfaces!
|
150
152
|
guard-livereload
|
151
153
|
guard-rspec
|
152
154
|
pry-byebug
|
@@ -155,6 +157,7 @@ DEPENDENCIES
|
|
155
157
|
rb-readline
|
156
158
|
reek
|
157
159
|
rspec
|
160
|
+
rspec_junit_formatter
|
158
161
|
rubocop
|
159
162
|
rubocop-rspec
|
160
163
|
simplecov
|
data/README.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
1
|
![duckface](https://user-images.githubusercontent.com/2643026/40590182-811ac3bc-61f2-11e8-814a-b235c51fd52c.jpg)
|
2
2
|
|
3
|
-
# Duckface
|
3
|
+
# Duckface [![CircleCI](https://circleci.com/gh/samuelgiles/duckface.svg?style=svg)](https://circleci.com/gh/samuelgiles/duckface)
|
4
4
|
|
5
5
|
A collection of tools to enforce duck typing based interfaces in Ruby.
|
6
6
|
|
7
|
+
## Install
|
8
|
+
|
9
|
+
From gem:
|
10
|
+
```
|
11
|
+
gem 'duckface-interfaces', require: 'duckface'
|
12
|
+
```
|
13
|
+
|
14
|
+
From source:
|
15
|
+
```
|
16
|
+
gem 'duckface-interfaces', require: 'duckface', git: 'git@github.com:samuelgiles/duckface.git'
|
17
|
+
```
|
18
|
+
|
7
19
|
## Configure
|
8
20
|
|
9
21
|
### RSpec
|
@@ -4,8 +4,16 @@ require 'duckface/services/check_class_implements_interface'
|
|
4
4
|
require 'duckface/implementation_methods'
|
5
5
|
|
6
6
|
module Duckface
|
7
|
-
# Provides methods on any class
|
7
|
+
# Provides methods on any class to indicate usage of interfaces
|
8
8
|
module ObjectSugar
|
9
|
+
def check_it_implements(_interface_class)
|
10
|
+
false
|
11
|
+
end
|
12
|
+
|
13
|
+
def says_it_implements?(_interface_class)
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
9
17
|
def implements_interface(interface_class)
|
10
18
|
extend Duckface::ImplementationMethods
|
11
19
|
include interface_class
|
@@ -13,4 +21,4 @@ module Duckface
|
|
13
21
|
end
|
14
22
|
end
|
15
23
|
|
16
|
-
|
24
|
+
Class.include(Duckface::ObjectSugar)
|
data/lib/duckface/version.rb
CHANGED
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
|
+
version: 0.0.2
|
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: 2018-
|
11
|
+
date: 2018-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,6 +59,7 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- ".circleci/config.yml"
|
62
63
|
- ".gitignore"
|
63
64
|
- ".reek"
|
64
65
|
- ".rspec"
|
@@ -77,7 +78,6 @@ files:
|
|
77
78
|
- lib/duckface/acts_as_interface.rb
|
78
79
|
- lib/duckface/constants.rb
|
79
80
|
- lib/duckface/errors.rb
|
80
|
-
- lib/duckface/example_class.rb
|
81
81
|
- lib/duckface/implementation_methods.rb
|
82
82
|
- lib/duckface/method_implementation.rb
|
83
83
|
- lib/duckface/object_sugar.rb
|
File without changes
|