dryer_factories 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18286ce2561d13272e7fbd832db21eeaecbff6ff36c71e66f492ad7e10fca800
4
- data.tar.gz: e01e177bbfacd57ab481e87401582b84d4e29ae6468bdd8a787932f05d53c0f1
3
+ metadata.gz: 9d05663a63dd5b25ae02fd9737222a6c7ad4a934124767fed02460e881c988bd
4
+ data.tar.gz: 2a1037cd3884108163777ea36534709f74799e0f56dffa61c0a8320c3ecefabd
5
5
  SHA512:
6
- metadata.gz: 0c2587adad52a5703f84dd7a16fced350f95d9577a0cd6579a910e78455d56e0a31471e0625590bf1a5763bff65313930ba3e941fffed370c6724626a643b9e2
7
- data.tar.gz: 2e3d26a0a4e5d1f2a533d368eb929fab80d05619c317e8157cc297f5684c1480cf13083a96b26fdd35f7be3fabc9a5a83501e1b908d260b684cf8dd1d75dc0ea
6
+ metadata.gz: 6a9044151eb6bef54b17416fa4ba5cee168938c604ddbf7569a3220fa933b80ffe8a91fbfba89e913019d8f51f3c5bf28ace95fe7fd2045130785ab2901cedf6
7
+ data.tar.gz: c559f032433c5500645024c565f502ae3e760d2bbbcf1bc6287dd4fbaab3c3824137c04ef8406e16a1659d3850869ddc841c3a14396f69c607fe2e6a5d1153f2
data/README.md CHANGED
@@ -11,10 +11,15 @@ gem "dryer_factories"
11
11
  ## Usage
12
12
  ```
13
13
  test "POST 200 - successfully creating a user" do
14
- request = Dryer::Factories::BuildFromContract.call(
15
- ApiResources::Users::Post.request_contract
16
- )
17
- post ApiResources::Users::Post.url, params: request.as_json
14
+ class SimpleContract < Dry::Validation::Contract
15
+ params do
16
+ required(:email).filled(:string)
17
+ required(:password).filled(:string)
18
+ end
19
+ end
20
+
21
+ request = Dryer::Factories::BuildFromContract.call(SimpleContract)
22
+ post "/users", params: request.as_json
18
23
 
19
24
  assert_response :success
20
25
  end
@@ -1,12 +1,6 @@
1
- #require File.expand_path('lib/dryer/factories/version.rb', __dir__)
2
1
  Gem::Specification.new do |spec|
3
2
  spec.name = 'dryer_factories'
4
-
5
- # this should be imported from lib/dryer/factories/version.rb
6
- # but I am having nix issues with importing the version file
7
- # when this file is evaluated
8
- #spec.version = Dryer::Factories::Version
9
- spec.version = "0.0.2"
3
+ spec.version = "0.0.3"
10
4
  spec.authors = ['John Bernier']
11
5
  spec.email = ['john.b.bernier@gmail.com']
12
6
  spec.summary = 'Generate payloads from dry-validation definitions'
@@ -1,5 +1,9 @@
1
+ require "rubygems"
2
+
1
3
  module Dryer
2
4
  module Factories
3
- VERSION = '0.0.1'
5
+ VERSION = Gem::Specification::load(
6
+ "./dryer_factories.gemspec"
7
+ ).version
4
8
  end
5
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryer_factories
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bernier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-29 00:00:00.000000000 Z
11
+ date: 2023-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation