factory_bro 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/factory_bro.rb +9 -5
- 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: ccbf3ce420985e7313564c11ccdb881e3ea61b15
|
4
|
+
data.tar.gz: 28a93e78439b63eb2ae45d9f9ed1fe40efb0b9af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38c062e31591600f2a268fccc36044a115d6f92aeb059df150e63874f1c7692d5dc18481d1e7bc38d1b9b79de97c3d475524f7b96d255543223fb9407c118c3a
|
7
|
+
data.tar.gz: a433fda6ed7118c61de1bd7ff3d0d71da2948300f5892544548e302da31b43960c1e9ed5e5118e5b0683155b31bcefb7c0aacb25b46ed2cf48b5011faaa24b64
|
data/lib/factory_bro.rb
CHANGED
@@ -69,11 +69,15 @@ class FactoryBro
|
|
69
69
|
private
|
70
70
|
|
71
71
|
def self.parse_url(url)
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
pwData = url.scan(/:[A-Za-z0-9]+@/).first
|
73
|
+
hostData = url.scan(/(?<=@)(.*)(?=:)/).first
|
74
|
+
user = (url.scan(/postgres:..[A-Za-z0-9]+/).first.split('//') - ['localhost', 'postgres:']).first
|
75
|
+
|
76
|
+
{ :user => user,
|
75
77
|
:port => url.scan(/:[0-9]+./).first.split('/').first.gsub(/[^a-zA-Z0-9\-]/,""),
|
76
|
-
:dbname => url.scan(/.[A-Za-z0-9]+$/).first.gsub(/[^a-zA-Z0-9\-]/,"")
|
78
|
+
:dbname => url.scan(/.[A-Za-z0-9]+$/).first.gsub(/[^a-zA-Z0-9\-]/,""),
|
79
|
+
:host => hostData ? hostData.first : 'localhost',
|
80
|
+
:pw => pwData ? pwData.gsub(/[^a-zA-Z0-9\-]/,"") : nil
|
77
81
|
}
|
78
82
|
end
|
79
83
|
|
@@ -122,7 +126,7 @@ end
|
|
122
126
|
if name.include? 'sign_in_ip'
|
123
127
|
return "Faker::Internet.ip_v4_address"
|
124
128
|
elsif name == 'email'
|
125
|
-
return "
|
129
|
+
return "test#{rand(99999)}@example.com"
|
126
130
|
else
|
127
131
|
return "Faker::Lorem.characters(32)"
|
128
132
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_bro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Reynolds
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|