elibri_watermarking 0.8 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,11 +11,12 @@ require 'json'
|
|
11
11
|
module ElibriWatermarking
|
12
12
|
class Client
|
13
13
|
|
14
|
-
attr_accessor :token, :secret, :logger
|
14
|
+
attr_accessor :token, :secret, :logger, :servers
|
15
15
|
|
16
|
-
def initialize(token, secret)
|
16
|
+
def initialize(token, secret, servers = nil)
|
17
17
|
self.token = token
|
18
18
|
self.secret = secret
|
19
|
+
self.servers = servers
|
19
20
|
end
|
20
21
|
|
21
22
|
def watermark(ident, formats, visible_watermark, title_postfix, customer_ip, client_symbol = nil, supplier = nil)
|
@@ -86,7 +87,7 @@ module ElibriWatermarking
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def try_with_different_servers(action)
|
89
|
-
txt_record = Net::DNS::Resolver.start("transactional-servers.elibri.com.pl", Net::DNS::TXT).answer.first.txt
|
90
|
+
txt_record = self.servers || Net::DNS::Resolver.start("transactional-servers.elibri.com.pl", Net::DNS::TXT).answer.first.txt
|
90
91
|
servers = txt_record.split(",").sort_by(&:rand).map(&:strip)
|
91
92
|
servers.each do |server|
|
92
93
|
uri = URI("https://#{server}.elibri.com.pl/watermarking/#{action}")
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elibri_watermarking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Piotr Szmielew
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2012-11-
|
19
|
+
date: 2012-11-06 00:00:00 +01:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|