colonization 0.3.3 → 0.3.4
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/lib/colonization/values_generator.rb +14 -0
- data/lib/colonization/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a16a2e6a128d704c81093c40a4b65876bfe38ea
|
4
|
+
data.tar.gz: ee5c40cdbfdce588e48f5757a2d718a58a1ec0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac27909a89414767da093f69b9b706d3da8c3bf25f3c938c3d62e7e5e09cc732df46f938f42ebaa1559fc78107083566321afd09abe2a89b097ed1a0daa6b85
|
7
|
+
data.tar.gz: 6738a0dde708eb24f26038655f8fec34988a81506e37d341b19b04bade6ac672f91ba3092020a66c23f727516c2090639836ac2ecdbc276cd6ece33ed93df76e
|
@@ -72,6 +72,8 @@ class Colonization::ValuesGenerator
|
|
72
72
|
case validator.type
|
73
73
|
when :acceptance
|
74
74
|
raise DisaparateValidatorError
|
75
|
+
when :presence
|
76
|
+
return Faker::Number.decimal(2, 3)
|
75
77
|
when :exclusion
|
76
78
|
begin
|
77
79
|
num = Faker::Number.decimal(2)
|
@@ -90,6 +92,8 @@ class Colonization::ValuesGenerator
|
|
90
92
|
when :acceptance
|
91
93
|
return validator.options[:accept].sample if validator.options[:accept].present?
|
92
94
|
return "1"
|
95
|
+
when :presence
|
96
|
+
return Faker::Lorem.word
|
93
97
|
when :exclusion
|
94
98
|
begin
|
95
99
|
word = Faker::Lorem.word
|
@@ -107,6 +111,8 @@ class Colonization::ValuesGenerator
|
|
107
111
|
case validator.type
|
108
112
|
when :acceptance
|
109
113
|
raise DisaparateValidatorError
|
114
|
+
when :presence
|
115
|
+
return Faker::Lorem.sentence
|
110
116
|
when :exclusion
|
111
117
|
begin
|
112
118
|
sentence = Faker::Lorem.sentence
|
@@ -124,6 +130,8 @@ class Colonization::ValuesGenerator
|
|
124
130
|
case validator.type
|
125
131
|
when :acceptance
|
126
132
|
raise DisaparateValidatorError
|
133
|
+
when :presence
|
134
|
+
return Faker::Date.between(30.days.ago, Date.today)
|
127
135
|
when :exclusion
|
128
136
|
begin
|
129
137
|
date = Faker::Date.between(30.days.ago, Date.today)
|
@@ -141,6 +149,8 @@ class Colonization::ValuesGenerator
|
|
141
149
|
case validator.type
|
142
150
|
when :acceptance
|
143
151
|
raise DisaparateValidatorError
|
152
|
+
when :presence
|
153
|
+
return Faker::Time.between(30.days.ago, Date.today)
|
144
154
|
when :exclusion
|
145
155
|
begin
|
146
156
|
datetime = Faker::Time.between(30.days.ago, Date.today)
|
@@ -158,6 +168,8 @@ class Colonization::ValuesGenerator
|
|
158
168
|
case validator.type
|
159
169
|
when :acceptance
|
160
170
|
return true
|
171
|
+
when :presence
|
172
|
+
return [false, true].sample
|
161
173
|
when :exclusion
|
162
174
|
if validator.options[:in].exclude?(false)
|
163
175
|
return false
|
@@ -178,6 +190,8 @@ class Colonization::ValuesGenerator
|
|
178
190
|
case validator.type
|
179
191
|
when :acceptance
|
180
192
|
raise DisaparateValidatorError
|
193
|
+
when :presence
|
194
|
+
return Faker::Time.between(30.days.ago, Date.today)
|
181
195
|
when :exclusion
|
182
196
|
begin
|
183
197
|
time = Faker::Time.between(30.days.ago, Date.today)
|
data/lib/colonization/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colonization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denys Dvoriashyn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|