mock_search 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5c8d19ea0cea25c387667d1c9f97ce94b7a5284
4
- data.tar.gz: 232eff05b5c958f0ce3400841beb4faf62ef9c95
3
+ metadata.gz: 14e6dd5f54f4e892447d4be3ccf7d652120d06d3
4
+ data.tar.gz: daaffe04f2e7a0e26863cfdf16951df409b4677a
5
5
  SHA512:
6
- metadata.gz: 1f7926dce845d437dbc3c40df87e639b4fa258196667f75c044898970bb31ce0fdf5b92015602cadecbffb5d879ea3e630a394a3dd3bb9184a2e8331d08d94c7
7
- data.tar.gz: 2a607d7123685117b16380f044853eb7da59b3a1d8baf782808fead9febe1d92b2417728aa912d5f0e54f90ecadd9e74afb6b99cbabdb71636d04794aa30c107
6
+ metadata.gz: db1d2d417fc7898a9438470541d920224c765741a19c4f7b3eff70d35fa2e75a572b5f0ef4cd4320ab0a14cd201cbd8a3c1f30f5bf7c84049aabcd5e4cb1cdc3
7
+ data.tar.gz: 5cc3fe726acf89851844375ca57e874a6490812f354253299a2378f1cd1f324fcb2d6cd92676d60307165cd7e1814c41a73f1aa020aafadc27084e58f73c2841
data/lib/mock_search.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'digest/md5'
3
3
  require 'httparty'
4
+ require 'ruby-des'
5
+ require "base64"
4
6
 
5
7
  require_relative 'mock_city'
6
8
 
@@ -118,6 +120,14 @@ class MockSearch
118
120
  def digest_md5()
119
121
  return Digest::MD5.hexdigest(self.generate_url_results_search+"despegar")
120
122
  end
123
+
124
+ def des()
125
+ des = OpenSSL::Cipher::Cipher.new 'DES-ECB'
126
+ des.encrypt
127
+ des.key = "RTBLL744"
128
+ up_final = des.update((Time.now.to_f * 1000).to_i.to_s) + des.final
129
+ return Base64.encode64(up_final).force_encoding('UTF-8').gsub(/\n/, "")
130
+ end
121
131
 
122
132
  def paginate(page)
123
133
  json = self.get_results_search_service
@@ -41,7 +41,7 @@ class MockSearchMultipledestinations < MockSearch
41
41
 
42
42
  #genero la url del servicio de resultados
43
43
  def generate_url_results_search_service(type="TOTALFARE")
44
- return @host + "/shop/flights/data/search/multipledestinations/" + @path + "/#{type}/ASCENDING?hashForData=#{digest_md5()}"
44
+ return @host + "/shop/flights/data/search/multipledestinations/" + @path + "/#{type}/ASCENDING?hashForData=#{digest_md5()}#{des()}"
45
45
  end
46
46
 
47
47
  def get_ticket_date()
@@ -40,7 +40,7 @@ class MockSearchOneway < MockSearch
40
40
 
41
41
  #genero la url del servicio de resultados
42
42
  def generate_url_results_search_service(type="TOTALFARE")
43
- return @host + "/shop/flights/data/search/oneway/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA?hashForData=#{digest_md5()}"
43
+ return @host + "/shop/flights/data/search/oneway/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA?hashForData=#{digest_md5()}#{des()}"
44
44
  end
45
45
 
46
46
  #genero la url del paginado
@@ -67,7 +67,7 @@ class MockSearchRoundtrip < MockSearch
67
67
 
68
68
  #genero la url del servicio de resultados
69
69
  def generate_url_results_search_service(type="TOTALFARE")
70
- return @host + "/shop/flights/data/search/roundtrip/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA/NA?hashForData=#{digest_md5()}"
70
+ return @host + "/shop/flights/data/search/roundtrip/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA/NA?hashForData=#{digest_md5()}#{des()}"
71
71
  end
72
72
 
73
73
  #genero la url del paginado
data/mock_search.gemspec CHANGED
@@ -15,9 +15,10 @@
15
15
 
16
16
  gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]
17
17
 
18
- gem.version = '1.0.8' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
18
+ gem.version = '1.0.9' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
19
19
 
20
20
  gem.add_dependency('httparty')
21
+ gem.add_dependency('ruby-des')
21
22
 
22
23
  gem.add_development_dependency('geminabox')
23
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - lgonzalez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-des
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: geminabox
29
43
  requirement: !ruby/object:Gem::Requirement