From da3e34174fa6ba6d3791fd790254f134614785ef Mon Sep 17 00:00:00 2001 From: fmoudoute Date: Thu, 29 Dec 2022 11:18:55 +0800 Subject: [PATCH] Add new feature --- .DS_Store | Bin 0 -> 6148 bytes lib/google_directions.rb | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..bef970bd43719022950370eca2481a9ef31d9346 GIT binary patch literal 6148 zcmeHKu};H447Jk?soJ4pV$6WVhUg!JDu|tKOeho;q(rGikr*@a8~g!Z!N6znd}m#A zq%fii*^=*F?DJXoa*AUj;>Gi7PBbH;3@Vt6G3*iXiw-1F%M{46N4=ge@7iWFSZRhs zWkB9tN@ujDN7_d3k551QzNRh9s%|UTvX`6J>D&9qMeJYw>fb!{?ndIS$cSoWt)i?n zKEbZ)>F1=YkTZC98He5|pS#~U=a%m2>DxK!sCMU2Uq9#MI^+zoO}opw&mZSK$JQps zfH7bU92^6v*&^A*qm9OZF<=Y?2ITvYLj?=P&ZGNuU~nw}FooF(=F&?@Os-fcb{^q@ zunz_LP}UZMeK_p7t}7Hfk3O7On-A8^tQ`uw?ASkd%ZUq*HW~xQK+M3%KhC87U;fX9diUCf`Wx2qSw6+coC$%<*-agmkF>?>^#B( Pu^$0PgAK;OpEB?TWT0B7 literal 0 HcmV?d00001 diff --git a/lib/google_directions.rb b/lib/google_directions.rb index 4e032ad..1d0a79a 100644 --- a/lib/google_directions.rb +++ b/lib/google_directions.rb @@ -23,8 +23,8 @@ def initialize(origin, destination, opts=@@default_options) @options = opts.merge({:origin => @origin, :destination => @destination}) @url = @@base_url + '?' + @options.to_query - @xml = open(@url).read - @doc = Nokogiri::XML(@xml) + @response = Net::HTTP.get_response(URI(@url)) + @doc = Nokogiri::XML(@response.body) @status = @doc.css('status').text end