epom 0.6.2 → 0.7

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: 2f11a1470a42941247210ba13862836bb40f2007
4
- data.tar.gz: 918845dcfd22c8a2e00510eea7919db74dfe660f
3
+ metadata.gz: d3fee8ba5c0b34b8cb4bfd75b7d515ea3b7f6ea9
4
+ data.tar.gz: ad87daee2a63a66bc872cadb40ae6b5ab303b81a
5
5
  SHA512:
6
- metadata.gz: 13f3fb6d07de759e1970cc93ba5d99f4e438bd94d25b9409b984a64b849f738f7490c6d4ba1c9b564d9d2bf1cc48cb137a61aa5626781b5ddbe5453875a05009
7
- data.tar.gz: 9b774128dbb38f78e516be557bc8eca56b50ba5261ff8dfb44de330a48894ad8b04ad9687876baea74202802b945e9ca94565135f0fc20251b435d783af966b8
6
+ metadata.gz: d612e6b3b7d6b11b70c0f4bd16a121f2f5fb73d5863dcc603a39ba5c5306a50bbfd585557420c306e98e338102cca47b10aa00b3ba141c66ef03e024e0c9a990
7
+ data.tar.gz: ef5418b65af7755c8577bc3cd75468b25d7e016596460d677112c40d6da82056c85e5dc5c931e8a1d0453025d4c22375d16167099d6c7163795c4c963b9fb784
@@ -6,6 +6,11 @@ module Epom
6
6
  default_params :output => 'json'
7
7
  debug_output $stderr
8
8
 
9
+ def self.login(username, password)
10
+ @@username = username
11
+ @@password = password
12
+ end
13
+
9
14
  def self.extended_methods
10
15
  { }
11
16
  end
@@ -38,6 +43,16 @@ module Epom
38
43
  format :json
39
44
  end
40
45
 
46
+ timestamp = Time.now.to_i * 1000
47
+ if body_params_signature.include?(:hash) and not body_params[:hash]
48
+ body_params[:hash] = Epom.create_hash(Epom.create_hash(@@password), timestamp)
49
+ end
50
+ if body_params_signature.include?(:timestamp) and not body_params[:timestamp]
51
+ body_params[:timestamp] = timestamp
52
+ end
53
+ if body_params_signature.include?(:username) and not body_params[:username]
54
+ body_params[:username] = @@username
55
+ end
41
56
 
42
57
  if params_validation(url_params, url_params_signature) and params_validation(body_params, body_params_signature)
43
58
  http_proxy ENV['proxy_address'], ENV['proxy_port'], ENV['proxy_user'], ENV['proxy_password']
@@ -1,3 +1,3 @@
1
1
  module Epom
2
- VERSION = '0.6.2'
2
+ VERSION = '0.7'
3
3
  end
@@ -2,6 +2,8 @@ require 'test_helper'
2
2
  require 'epom/advertiser'
3
3
 
4
4
  class AdvertiserTest < ActiveSupport::TestCase
5
+ Epom::EpomElement.login(ENV['username'], ENV['password'])
6
+
5
7
  test "truth" do
6
8
  assert_kind_of Class, Epom::Advertiser
7
9
  end
@@ -12,7 +14,6 @@ class AdvertiserTest < ActiveSupport::TestCase
12
14
  timestamp = Time.now.to_i * 1000
13
15
  body_params = {
14
16
  :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
15
- :timestamp => timestamp,
16
17
  :username => ENV['username']
17
18
  }
18
19
  url_params = {
@@ -29,7 +30,6 @@ class AdvertiserTest < ActiveSupport::TestCase
29
30
  body_params = {
30
31
  :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
31
32
  :timestamp => timestamp,
32
- :username => ENV['username']
33
33
  }
34
34
 
35
35
  response = Epom::Advertiser.get_advertiser_permissions_for_user({}, body_params)
@@ -46,7 +46,6 @@ class AdvertiserTest < ActiveSupport::TestCase
46
46
  test "get_campaigns_for_advertiser" do
47
47
  timestamp = Time.now.to_i * 1000
48
48
  body_params = {
49
- :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
50
49
  :timestamp => timestamp,
51
50
  :username => ENV['username']
52
51
  }
@@ -67,9 +66,6 @@ class AdvertiserTest < ActiveSupport::TestCase
67
66
  test "create advertiser" do
68
67
  timestamp = Time.now.to_i * 1000
69
68
  body_params = {
70
- :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
71
- :timestamp => timestamp,
72
- :username => ENV['username'],
73
69
  :name => "advertiser #{DateTime.now}",
74
70
  :contactName => "advertiser contactName",
75
71
  :contactEmail => "advertiser@gmail.com",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Quintero