clean-architecture 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/lib/clean_architecture/interfaces/success_payload.rb +1 -1
- data/lib/clean_architecture/serializers/all.rb +1 -0
- data/lib/clean_architecture/serializers/json_response_from_result.rb +1 -1
- data/lib/clean_architecture/serializers/success_collection_payload.rb +28 -0
- data/lib/clean_architecture/serializers/success_payload.rb +6 -5
- data/lib/clean_architecture/version.rb +1 -1
- data/shell.nix +15 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cff6e5d81156369ad42cbb55c06b1931b4949da5c1c3c1a80a2425d3307b459f
|
4
|
+
data.tar.gz: 6fa2e337acd93963c6fa915f70a4109b81ec2540721b086416a275b981593eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec3751be4de839c3887ec1f4ca3a7ed3f7c6abe3068cdccfa12976f93cf8882416731e74be99507e555607889f1521145b17d46e435cfa9702370bca3492f0fc
|
7
|
+
data.tar.gz: 46d4eb2641a76e284265d54c870ecc695381befd52c3f786eee87703aa5081cb8fdb64fee34aedb38de0dcf9dd0e4c87920bd7b6b6c6bf36010c2903b1ed2e4d
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clean-architecture (
|
4
|
+
clean-architecture (2.0.0)
|
5
5
|
dry-matcher (~> 0.0)
|
6
6
|
dry-monads (~> 1.0)
|
7
7
|
dry-struct (~> 0.0)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
coderay (1.1.2)
|
23
23
|
coercible (1.0.0)
|
24
24
|
descendants_tracker (~> 0.0.1)
|
25
|
-
concurrent-ruby (1.
|
25
|
+
concurrent-ruby (1.1.3)
|
26
26
|
descendants_tracker (0.0.4)
|
27
27
|
thread_safe (~> 0.3, >= 0.3.1)
|
28
28
|
diff-lcs (1.3)
|
@@ -184,4 +184,4 @@ DEPENDENCIES
|
|
184
184
|
timecop
|
185
185
|
|
186
186
|
BUNDLED WITH
|
187
|
-
1.
|
187
|
+
1.17.1
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'duckface'
|
4
|
+
require 'clean_architecture/interfaces/success_payload'
|
5
|
+
require 'clean_architecture/serializers/success_payload'
|
6
|
+
|
7
|
+
module CleanArchitecture
|
8
|
+
module Serializers
|
9
|
+
class SuccessCollectionPayload
|
10
|
+
implements_interface CleanArchitecture::Interfaces::SuccessPayload
|
11
|
+
|
12
|
+
def initialize(collection, use_case_target_class)
|
13
|
+
@collection = collection
|
14
|
+
@use_case_target_class = use_case_target_class
|
15
|
+
end
|
16
|
+
|
17
|
+
def data
|
18
|
+
@collection.map do |object|
|
19
|
+
SuccessPayload.new(@use_case_target_class.new(object)).data
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def version
|
24
|
+
'1.0'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -8,20 +8,21 @@ module CleanArchitecture
|
|
8
8
|
class SuccessPayload
|
9
9
|
implements_interface CleanArchitecture::Interfaces::SuccessPayload
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
def initialize(use_case_target, version)
|
11
|
+
def initialize(use_case_target)
|
14
12
|
@use_case_target = use_case_target
|
15
|
-
@version = version
|
16
13
|
end
|
17
14
|
|
18
|
-
def
|
15
|
+
def data
|
19
16
|
{
|
20
17
|
type: @use_case_target.type_name,
|
21
18
|
id: @use_case_target.identifier,
|
22
19
|
attributes: @use_case_target.attribute_hash
|
23
20
|
}.compact
|
24
21
|
end
|
22
|
+
|
23
|
+
def version
|
24
|
+
'1.0'
|
25
|
+
end
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
data/shell.nix
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{ pkgs ? import <nixpkgs> {} }:
|
2
|
+
|
3
|
+
with pkgs;
|
4
|
+
|
5
|
+
let
|
6
|
+
ruby = pkgs.ruby_2_4;
|
7
|
+
bundler = pkgs.bundler.override { inherit ruby; };
|
8
|
+
|
9
|
+
in pkgs.stdenv.mkDerivation {
|
10
|
+
name = "cleanArchitectureEnv";
|
11
|
+
buildInputs = [
|
12
|
+
readline
|
13
|
+
ruby.devEnv
|
14
|
+
];
|
15
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clean-architecture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
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-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-matcher
|
@@ -171,9 +171,11 @@ files:
|
|
171
171
|
- lib/clean_architecture/serializers/all.rb
|
172
172
|
- lib/clean_architecture/serializers/html_response_from_result.rb
|
173
173
|
- lib/clean_architecture/serializers/json_response_from_result.rb
|
174
|
+
- lib/clean_architecture/serializers/success_collection_payload.rb
|
174
175
|
- lib/clean_architecture/serializers/success_payload.rb
|
175
176
|
- lib/clean_architecture/types.rb
|
176
177
|
- lib/clean_architecture/version.rb
|
178
|
+
- shell.nix
|
177
179
|
homepage: https://bellroy.com
|
178
180
|
licenses: []
|
179
181
|
metadata: {}
|
@@ -193,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
195
|
version: '0'
|
194
196
|
requirements: []
|
195
197
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.7.7
|
197
199
|
signing_key:
|
198
200
|
specification_version: 4
|
199
201
|
summary: Bellroy Clean Architecture Framework
|