fakeit 0.5.1 → 0.5.2

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: e532a36b31f1e5ae42a1e424d77f8ef336c54d7519bfa7b3223f27d46c7b1a8d
4
- data.tar.gz: dc4e70a6bac2858abc1a251cb2ffe8aff2272ec4926187dd69c19d4ad0be867f
3
+ metadata.gz: 30ea4d2aa93efde5e87605835f598e5f73de921fd00d2fd4f15b1784dbc44c87
4
+ data.tar.gz: e10dc92c54c9463a7a75c9caf0391d1a563445d99ded2e0d02038cde2f7c9886
5
5
  SHA512:
6
- metadata.gz: a57970664a9b1e27d0bc8d1a78cea8b4311c0a56b6c3edc252f232728de767c11dea3af0b8419a00e2ce722659f053c2504f8a5432b9cdfe21ab35a77e6c63df
7
- data.tar.gz: f36c7175d63d53f35c0b4de54ec07f0129179cc2f2187d7640c5811ae639084f01f1d5cd80ac08e40a713910f6a3d1c5f440a8be3978772565a444467519d66d
6
+ metadata.gz: fdca80c0d4597949df629c3691bac048ed915bbe7fc69ea684c28d36bb21ecf6aa469910e107a9e8264fc93d11db6e23ded0d97a42b19e8bc613e63b2f0d0df2
7
+ data.tar.gz: 12b14f11d000f28bc18534f3ceb20f6ccc2cb1fac8ced1e9b28e74c2a6886b302e0106f504229ac8becac342632c6df3fcbd133d8d77694a23d8aaec196c34f1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fakeit (0.5.1)
4
+ fakeit (0.5.2)
5
5
  faker (~> 2.2)
6
6
  openapi_parser (= 0.8.0)
7
7
  rack (~> 2.0)
@@ -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|Length is a multiple of `4` between `4` ~ `100`|
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| |
@@ -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|`1111`|
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`|
@@ -1,6 +1,7 @@
1
1
  require 'json'
2
2
  require 'yaml'
3
3
  require 'open-uri'
4
+ require 'base64'
4
5
  require 'openapi_parser'
5
6
  require 'faker'
6
7
  require 'rack'
@@ -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' => -> { '1111' }
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: (4..100).step(4)) }
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)
@@ -1,3 +1,3 @@
1
1
  module Fakeit
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.5.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakeit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Feng