fakeit 0.5.1 → 0.5.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/docs/random.md +2 -1
- data/docs/static.md +2 -1
- data/lib/fakeit.rb +1 -0
- data/lib/fakeit/openapi/example/string_example.rb +4 -2
- data/lib/fakeit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30ea4d2aa93efde5e87605835f598e5f73de921fd00d2fd4f15b1784dbc44c87
|
|
4
|
+
data.tar.gz: e10dc92c54c9463a7a75c9caf0391d1a563445d99ded2e0d02038cde2f7c9886
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fdca80c0d4597949df629c3691bac048ed915bbe7fc69ea684c28d36bb21ecf6aa469910e107a9e8264fc93d11db6e23ded0d97a42b19e8bc613e63b2f0d0df2
|
|
7
|
+
data.tar.gz: 12b14f11d000f28bc18534f3ceb20f6ccc2cb1fac8ced1e9b28e74c2a6886b302e0106f504229ac8becac342632c6df3fcbd133d8d77694a23d8aaec196c34f1
|
data/Gemfile.lock
CHANGED
data/docs/random.md
CHANGED
|
@@ -18,7 +18,8 @@ The following Openapi properties are supported in random response generation
|
|
|
18
18
|
| |format=email| |
|
|
19
19
|
| |format=date|In past 100 days|
|
|
20
20
|
| |format=date-time|In past 100 days|
|
|
21
|
-
| |format=binary|
|
|
21
|
+
| |format=binary|UTF-8 string|
|
|
22
|
+
| |format=byte|Base64 encoded UTF-8 string|
|
|
22
23
|
| |minLength|Default: `0`|
|
|
23
24
|
| |maxLength|Default: `minLength + 10`|
|
|
24
25
|
|integer|enum| |
|
data/docs/static.md
CHANGED
|
@@ -17,7 +17,8 @@ Static value generation rule
|
|
|
17
17
|
| |format=email|`some@email.com`|
|
|
18
18
|
| |format=date|today|
|
|
19
19
|
| |format=date-time|midnight today|
|
|
20
|
-
| |format=binary|`
|
|
20
|
+
| |format=binary|`binary`|
|
|
21
|
+
| |format=byte|`Ynl0ZQ==`|
|
|
21
22
|
| |minLength|`1` repeats for (minLength + 10) times if no maxLength specified|
|
|
22
23
|
| |maxLength|`1` repeats for maxLength times|
|
|
23
24
|
|integer|N/A|`2^31 - 1`|
|
data/lib/fakeit.rb
CHANGED
|
@@ -11,7 +11,8 @@ module Fakeit
|
|
|
11
11
|
now = Time.now
|
|
12
12
|
Time.new(now.year, now.month, now.day, 0, 0, 0, now.utc_offset).iso8601
|
|
13
13
|
end,
|
|
14
|
-
'binary' => -> { '
|
|
14
|
+
'binary' => -> { 'binary' },
|
|
15
|
+
'byte' => -> { 'Ynl0ZQ==' }
|
|
15
16
|
}.freeze
|
|
16
17
|
|
|
17
18
|
RANDOM_FORMAT_HANDLERS = {
|
|
@@ -21,7 +22,8 @@ module Fakeit
|
|
|
21
22
|
'email' => -> { Faker::Internet.email },
|
|
22
23
|
'date' => -> { Faker::Date.backward(days: 100).iso8601 },
|
|
23
24
|
'date-time' => -> { Faker::Time.backward(days: 100).iso8601 },
|
|
24
|
-
'binary' => -> { Faker::String.random(length:
|
|
25
|
+
'binary' => -> { Faker::String.random(length: 1..30) },
|
|
26
|
+
'byte' => -> { Base64.strict_encode64(Faker::String.random(length: 1..30)) }
|
|
25
27
|
}.freeze
|
|
26
28
|
|
|
27
29
|
def string_example(example_options)
|
data/lib/fakeit/version.rb
CHANGED