factory-helper 1.7.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/factory-helper/internet.rb +14 -5
- data/lib/factory-helper/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: b6da63f932142e44ce11edd71bab598badb64c53
|
4
|
+
data.tar.gz: 04493c963464eaf1cdcdf9c2cd875d4bb9bfc35e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a27de292ae66e4dffb5d75611acad4d150cc3e596100a7417870405aa51733896bd6d5c708626bb5e29b011817031be77e883fb14c72eb2189ca09a072680c
|
7
|
+
data.tar.gz: caee66faea0cf88d53a03c6193c6e15c2a026303d02726c122501208dd059bc65ccd10110ca43f263885c4326367ca9fd4e0da35f8f27a92c5b4063c2dcaa9aa
|
data/README.md
CHANGED
@@ -54,13 +54,14 @@ FactoryHelper::Company.bs #=> "revolutionize plug-and-play architectures"
|
|
54
54
|
|
55
55
|
###FactoryHelper::String
|
56
56
|
-----------------
|
57
|
-
Random UTF-8 string with
|
57
|
+
Random UTF-8 string with optional nested length arguments.
|
58
58
|
|
59
59
|
```ruby
|
60
60
|
FactoryHelper::String.random #=> "3 뇦\u0017&y\u{3A109}$8^4* 녹豿4좘툢ꔾ쉙6ɉ\uA6F8TN畀챵|\"3쇤Ŵ"
|
61
61
|
FactoryHelper::String.random(4) #=> "⼨%0*"
|
62
62
|
FactoryHelper::String.random(3..12) #=> "\u{69FDC};秨툫"
|
63
63
|
FactoryHelper::String.random([0, 6]) #=> "I轤𣴒P溟L"
|
64
|
+
FactoryHelper::String.random([0, 3..12]) #=> "葓L#ћ"
|
64
65
|
```
|
65
66
|
|
66
67
|
|
@@ -3,7 +3,7 @@ module FactoryHelper
|
|
3
3
|
class Internet < Base
|
4
4
|
class << self
|
5
5
|
def email(name = nil)
|
6
|
-
[
|
6
|
+
[ email_word, domain_name ].join('@')
|
7
7
|
end
|
8
8
|
|
9
9
|
def free_email(name = nil)
|
@@ -67,10 +67,6 @@ module FactoryHelper
|
|
67
67
|
[ fix_umlauts(domain_word), domain_suffix ].join('.')
|
68
68
|
end
|
69
69
|
|
70
|
-
def domain_word
|
71
|
-
Company.name.split(' ').first.gsub(/\W/, '').downcase
|
72
|
-
end
|
73
|
-
|
74
70
|
def domain_suffix
|
75
71
|
fetch('internet.domain_suffix')
|
76
72
|
end
|
@@ -121,6 +117,19 @@ module FactoryHelper
|
|
121
117
|
string
|
122
118
|
end
|
123
119
|
|
120
|
+
def domain_word
|
121
|
+
Lorem.word
|
122
|
+
end
|
123
|
+
|
124
|
+
private
|
125
|
+
|
126
|
+
def email_word
|
127
|
+
name= Name.first_name.downcase
|
128
|
+
return name unless name.empty?
|
129
|
+
I18n.with_locale('en') do
|
130
|
+
return Name.first_name.downcase
|
131
|
+
end
|
132
|
+
end
|
124
133
|
end
|
125
134
|
end
|
126
135
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Avvakumov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|