mock_search 1.1.1 → 1.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc5682a7ccf3bdfe19e2d87ef9cc2e3bc6ea9bb
|
4
|
+
data.tar.gz: a4adcdb4e7d00e39ec022b700eefcdafd40bc920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c89de226f0733e336cb356998918042777298aff6836318e6f0f47922f3d09c2f10cb669aea8489aa0687c4aaba82db87afd852fbe8c447e1dd753ea134667
|
7
|
+
data.tar.gz: 5cef9b597a47114d3d0983c0afc5d96b876ffb1d96274f69db710535ef796a8b88ab15ef3859581788cc7e31a3f7b95b719e6289d892d7e25932e8c2583be8ea
|
@@ -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=#{
|
44
|
+
return @host + "/shop/flights/data/search/multipledestinations/" + @path + "/#{type}/ASCENDING?hashForData=#{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=#{
|
43
|
+
return @host + "/shop/flights/data/search/oneway/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA?hashForData=#{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=#{
|
70
|
+
return @host + "/shop/flights/data/search/roundtrip/" + @path + "/#{type}/ASCENDING/NA/NA/NA/NA/NA?hashForData=#{des()}"
|
71
71
|
end
|
72
72
|
|
73
73
|
#genero la url del paginado
|
data/lib/mock_search.rb
CHANGED
@@ -121,11 +121,16 @@ class MockSearch
|
|
121
121
|
return Digest::MD5.hexdigest(self.generate_url_results_search+"despegar")
|
122
122
|
end
|
123
123
|
|
124
|
-
def
|
124
|
+
def encrypt(key,value)
|
125
125
|
des = OpenSSL::Cipher::Cipher.new 'DES-ECB'
|
126
126
|
des.encrypt
|
127
|
-
des.key =
|
128
|
-
|
127
|
+
des.key = key
|
128
|
+
return des.update(value) + des.final
|
129
|
+
end
|
130
|
+
|
131
|
+
def des()
|
132
|
+
up_temp = self.encrypt("RTBLL744", (Time.now.to_f * 1000).to_i.to_s)
|
133
|
+
up_final = self.encrypt("G3N1S*72", digest_md5()+Base64.encode64(up_temp).force_encoding('UTF-8').gsub(/\n/, ""))
|
129
134
|
return ERB::Util.url_encode(Base64.encode64(up_final).force_encoding('UTF-8').gsub(/\n/, ""))
|
130
135
|
end
|
131
136
|
|
data/mock_search.gemspec
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]
|
17
17
|
|
18
|
-
gem.version = '1.1.
|
18
|
+
gem.version = '1.1.2' #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
21
|
gem.add_dependency('ruby-des')
|
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.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lgonzalez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|