bbk-utils 1.0.0.68936 → 1.0.0.68939
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bbk/utils/logger.rb +1 -1
- data/lib/bbk/utils/xml.rb +5 -4
- data/lib/bbk/utils.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5640d1eceff89af0d9763d7077f210b20451b99cc481621c1339678a8a4061b5
|
4
|
+
data.tar.gz: e9e87bf452fe48f433c4aa42bf6ec8e4058e290257a15480ee4073cff7020d81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 177182acbdbef997dc78198f46c295b71dd8bcf8bad7d7217158bdfbedc3bab4f101d4a17e550868e3fd0857881da31f8788733c679ebf00b055086e007353fe
|
7
|
+
data.tar.gz: 8581d889f8ce881c26a742db145bb4ce06c3483c70b0d0e4a946f62d7421fb9e1ff33649caa0cc7827c97a0b702832516603e5a70212b1cf0e219aeeeacae7e9
|
data/Gemfile.lock
CHANGED
data/lib/bbk/utils/logger.rb
CHANGED
data/lib/bbk/utils/xml.rb
CHANGED
@@ -6,22 +6,23 @@ module BBK
|
|
6
6
|
MTOM_ID_FIRST_LETTERS = %w[a b c d e f].freeze
|
7
7
|
|
8
8
|
##
|
9
|
-
#
|
10
|
-
# Который затем в сервисе smev3 будет заменен на реальный идентификатор вложения в ftp хранилище.
|
9
|
+
# Generate identifier to future substitution in XML body. Ex.: real attachment identifier when uploading to FTP
|
11
10
|
def self.build_substitution_id(id)
|
12
11
|
"@{#{id}}"
|
13
12
|
end
|
14
13
|
|
15
|
-
|
14
|
+
##
|
15
|
+
# Generate uuid compatible with SOAP AttachmentContent identifier
|
16
16
|
def self.generate_mtom_attachment_id
|
17
17
|
id = SecureRandom.uuid
|
18
18
|
id[0] = MTOM_ID_FIRST_LETTERS.sample
|
19
19
|
id
|
20
20
|
end
|
21
21
|
|
22
|
+
##
|
23
|
+
# Normalize XML href to be predictible and constant in various cases
|
22
24
|
def self.normalize_slug(name, href)
|
23
25
|
href_uri = URI.parse(href)
|
24
|
-
# href_slug = [href_uri.scheme, href_uri.host, *href_uri.path.gsub('.', '-').split('/')].select(&:present?).join('-')
|
25
26
|
href_slug = [href_uri.scheme, href_uri.host, *href_uri.path.split('/'), href_uri.query].select(&:present?).join('-').gsub(/[\.&]/, '-')
|
26
27
|
Russian.translit "#{name}_#{href_slug}"
|
27
28
|
end
|
data/lib/bbk/utils.rb
CHANGED