crm_formatter 2.61 → 2.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -3
- data/lib/crm_formatter.rb +3 -2
- data/lib/crm_formatter/version.rb +1 -1
- data/lib/crm_formatter/web.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd79a5c7dd057ad862d974f30170f67f3b066536388c0941d878d2343eb3321
|
4
|
+
data.tar.gz: e6e0be7cb05c90d46d384291d66639e29291654227e373b2e77c7605a9eaf0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9793768c46817902f330fb40d48349a57e86f8b76bc815d425277579eb1ee59a031e2b0c9237877ffeb1e472dec960aa497afaefa306777a79c2900826bbe9d0
|
7
|
+
data.tar.gz: c7ae813cbff69cb95cad6985c401e3f5adde702ab5034010a448b3f5bb0f579bc2c727eb18f0a94f2dad7dc6613febf154f790be9fab69c39f6581d6cbaadf12
|
data/Rakefile
CHANGED
@@ -18,8 +18,8 @@ task :console do
|
|
18
18
|
|
19
19
|
# formatted_data = format_with_report
|
20
20
|
# formatted_phones = format_phones
|
21
|
-
|
22
|
-
formatted_propers = format_propers
|
21
|
+
formatted_urls = format_urls
|
22
|
+
# formatted_propers = format_propers
|
23
23
|
# formatted_addresses = format_addresses
|
24
24
|
# binding.pry
|
25
25
|
IRB.start
|
@@ -89,7 +89,8 @@ def format_urls
|
|
89
89
|
www.www.sample10.com
|
90
90
|
]
|
91
91
|
|
92
|
-
array_of_urls = %w[
|
92
|
+
# array_of_urls = %w[texarkana.mercedesdealer.com.notreal minooka.subaru.com http://www.mccrea.subaru.com blackwellford.com www.bobilya.com https://www.century1chevy.com hammondautoplex.com www.harbinfordscottsboro.net http://www.lancaster.subaru.com loufusz.subaru.com www.mastro.subaru.com www.muller.subaru.com reinekefamilydealerships.com]
|
93
|
+
|
93
94
|
formatted_urls = CrmFormatter.format_urls(array_of_urls)
|
94
95
|
end
|
95
96
|
|
data/lib/crm_formatter.rb
CHANGED
@@ -9,7 +9,7 @@ require 'crm_formatter/web'
|
|
9
9
|
require 'crm_formatter/wrap'
|
10
10
|
|
11
11
|
require 'utf8_sanitizer'
|
12
|
-
|
12
|
+
require 'pry'
|
13
13
|
|
14
14
|
# require 'crm_formatter/tools'
|
15
15
|
# require 'crm_formatter/seed_criteria'
|
@@ -58,9 +58,10 @@ module CrmFormatter
|
|
58
58
|
crmf_url_hsh.merge!(web_obj.format_url(url))
|
59
59
|
crmf_url_hsh
|
60
60
|
end
|
61
|
-
formatted_url_hashes
|
62
61
|
end
|
63
62
|
|
63
|
+
|
64
|
+
|
64
65
|
def self.format_with_report(args={})
|
65
66
|
formatted_data = self::Wrap.new.run(args)
|
66
67
|
formatted_data
|
data/lib/crm_formatter/web.rb
CHANGED
@@ -15,6 +15,7 @@ module CrmFormatter
|
|
15
15
|
if url&.present?
|
16
16
|
url = normalize_url(url)
|
17
17
|
ext_result = validate_extension(url_hash, url)
|
18
|
+
|
18
19
|
url_hash = ext_result[:url_hash]
|
19
20
|
url = ext_result[:url]
|
20
21
|
(url = nil if errors?(url_hash)) if url.present?
|
@@ -24,7 +25,6 @@ module CrmFormatter
|
|
24
25
|
url_hash[:url_f] = url
|
25
26
|
url_hash = extract_path(url_hash) if url.present?
|
26
27
|
url_hash = check_web_status(url_hash)
|
27
|
-
url_hash
|
28
28
|
end
|
29
29
|
|
30
30
|
### COMPARE ORIGINAL AND FORMATTED URL ###
|
@@ -127,8 +127,11 @@ module CrmFormatter
|
|
127
127
|
### Only Non-Errors Get Here ###
|
128
128
|
## Has one valid ext, but need to check if original url exts were > 1. Replace if so.
|
129
129
|
if url_exts.count > matched_exts.count
|
130
|
-
|
131
|
-
|
130
|
+
matched_ext = matched_exts.first
|
131
|
+
u1 = url.split(matched_ext).first
|
132
|
+
url = "#{u1}#{matched_ext}"
|
133
|
+
# inv_ext = (url_exts - matched_exts).join
|
134
|
+
# url = url.gsub(".#{inv_ext}", '')
|
132
135
|
end
|
133
136
|
|
134
137
|
ext_result = { url_hash: url_hash, url: url }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crm_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.62'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Booth
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|