crm_formatter 2.61 → 2.62

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3146117f9aa6701a02a859e3d698617fb6e822c663ed55498874cffbe1cf96bc
4
- data.tar.gz: ccf3f965f9f8aa153cf915e4c4165346ba2852dd97d222a78b55557937940f6d
3
+ metadata.gz: cdd79a5c7dd057ad862d974f30170f67f3b066536388c0941d878d2343eb3321
4
+ data.tar.gz: e6e0be7cb05c90d46d384291d66639e29291654227e373b2e77c7605a9eaf0bd
5
5
  SHA512:
6
- metadata.gz: 12a8b0c88c6c7e6f9b3083cee24ea29fb2888d1acf68cf7bfb38e1678fc859bccc974fe6545b3237b98498a7d7294285c04f348ba6f70441ea5a6cbb3c8442ec
7
- data.tar.gz: 7d340995b9ca0248542dc4dc712b9e3a55082d4de7e9846967c30cf2932d3f18f18285db474eaffed4a0fb4d1196281abf0a1d2e014a6f4a4637e40403713fc8
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
- # formatted_urls = format_urls
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[sample01.com/staff www.sample02.net.com http://www.sample3.net www.sample04.net/contact_us http://sample05.net www.sample06.sofake www.sample07.com.sofake example08.not.real www.sample09.net/staff/management www.www.sample10.com]
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
- # require 'pry'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module CrmFormatter
4
- VERSION = "2.61"
4
+ VERSION = "2.62"
5
5
  end
@@ -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
- inv_ext = (url_exts - matched_exts).join
131
- url = url.gsub(".#{inv_ext}", '')
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.61'
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-06-30 00:00:00.000000000 Z
11
+ date: 2018-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport