epom 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epom/config.rb +6 -2
- data/lib/epom/epom_element.rb +5 -5
- data/lib/epom/version.rb +1 -1
- data/lib/generators/epom/config/config_generator.rb +3 -0
- data/lib/generators/epom/config/templates/epom.rb +7 -2
- data/test/dummy/config/initializers/epom.rb +7 -2
- data/test/test_helper.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e9c4113502fefbc5778f90f4628a2250a020696
|
4
|
+
data.tar.gz: 87235b12a06a778f3715e8987db9b7f80a443463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2cfb0b0537ff0e3446d00e5e8a5846cb630059d57704c3d9bf2d528e95dc797b25acba45ab94313b7ba82cd6628c6672f4b3dd4fd7d67202f9ae05f23553b1c
|
7
|
+
data.tar.gz: d7402c2236109432922ed6f62c96f88244de4f5e6a6e590107e24faf88a7055e14f1962cc6db3e2688e2cd3fbdfd0b9a25c90f04e42ecc3d88358ca38f6e0103
|
data/lib/epom/config.rb
CHANGED
@@ -17,9 +17,13 @@ module Epom
|
|
17
17
|
# need a Class for 3.0
|
18
18
|
class Configuration #:nodoc:
|
19
19
|
include ActiveSupport::Configurable
|
20
|
-
config_accessor :public_key
|
21
|
-
config_accessor :private_key
|
22
20
|
config_accessor :epom_server
|
21
|
+
config_accessor :username
|
22
|
+
config_accessor :password
|
23
|
+
config_accessor :proxy_address
|
24
|
+
config_accessor :proxy_port
|
25
|
+
config_accessor :proxy_user
|
26
|
+
config_accessor :proxy_password
|
23
27
|
|
24
28
|
def param_name
|
25
29
|
config.param_name.respond_to?(:call) ? config.param_name.call : config.param_name
|
data/lib/epom/epom_element.rb
CHANGED
@@ -6,8 +6,8 @@ module Epom
|
|
6
6
|
debug_output $stderr
|
7
7
|
|
8
8
|
def self.login(username, password)
|
9
|
-
|
10
|
-
|
9
|
+
Epom.config.username = username
|
10
|
+
Epom.config.password = password
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.extended_methods
|
@@ -47,17 +47,17 @@ module Epom
|
|
47
47
|
|
48
48
|
timestamp = Time.now.to_i * 1000
|
49
49
|
if body_params_signature.include?(:hash) and not body_params[:hash]
|
50
|
-
body_params[:hash] = Epom.create_hash(Epom.create_hash(
|
50
|
+
body_params[:hash] = Epom.create_hash(Epom.create_hash(Epom.config.password), timestamp)
|
51
51
|
end
|
52
52
|
if body_params_signature.include?(:timestamp) and not body_params[:timestamp]
|
53
53
|
body_params[:timestamp] = timestamp
|
54
54
|
end
|
55
55
|
if body_params_signature.include?(:username) and not body_params[:username]
|
56
|
-
body_params[:username] =
|
56
|
+
body_params[:username] = Epom.config.username
|
57
57
|
end
|
58
58
|
|
59
59
|
if params_validation(url_params, url_params_signature) and params_validation(body_params, body_params_signature)
|
60
|
-
http_proxy
|
60
|
+
http_proxy Epom.config.proxy_address, Epom.config.proxy_port, Epom.config.proxy_user, Epom.config.proxy_password
|
61
61
|
base_uri Epom.config.epom_server
|
62
62
|
response = send(method, url, :query => body_params)
|
63
63
|
if response.success?
|
data/lib/epom/version.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
Epom.configure do |config|
|
2
|
-
config.public_key = 'public_key'
|
3
|
-
config.private_key = 'private_key'
|
4
2
|
config.epom_server = 'https://n29.epom.com/'
|
3
|
+
config.username = 'username'
|
4
|
+
config.password = 'password'
|
5
|
+
|
6
|
+
config.proxy_address = ''
|
7
|
+
config.proxy_port = ''
|
8
|
+
config.proxy_user = ''
|
9
|
+
config.proxy_password = ''
|
5
10
|
end
|
@@ -1,5 +1,10 @@
|
|
1
1
|
Epom.configure do |config|
|
2
|
-
config.public_key = 'public_key'
|
3
|
-
config.private_key = 'private_key'
|
4
2
|
config.epom_server = 'https://n29.epom.com/'
|
3
|
+
config.username = 'username'
|
4
|
+
config.password = 'password'
|
5
|
+
|
6
|
+
config.proxy_address = ''
|
7
|
+
config.proxy_port = ''
|
8
|
+
config.proxy_user = ''
|
9
|
+
config.proxy_password = ''
|
5
10
|
end
|
data/test/test_helper.rb
CHANGED
@@ -58,9 +58,11 @@ def define_get_tests_auto(klass)
|
|
58
58
|
end
|
59
59
|
|
60
60
|
Epom.configure do |config|
|
61
|
-
config.public_key = ENV['public_key']
|
62
|
-
config.private_key = ENV['private_key']
|
63
61
|
config.epom_server = ENV['epom_server']
|
62
|
+
config.proxy_address = ENV['proxy_address']
|
63
|
+
config.proxy_port = ENV['proxy_port']
|
64
|
+
config.proxy_user = ENV['proxy_user']
|
65
|
+
config.proxy_password = ENV['proxy_password']
|
64
66
|
end
|
65
67
|
|
66
68
|
Epom::EpomElement.login(ENV['username'], ENV['password'])
|
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.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Quintero
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-06-
|
13
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.4.
|
201
|
+
rubygems_version: 2.4.8
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Epom gem.
|