bbk-utils 1.0.0.68936 → 1.0.1.68944
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/README.md +10 -0
- data/lib/bbk/utils/logger.rb +1 -1
- data/lib/bbk/utils/version.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: 1fa9c2b58a8f2ae38434780294d1ce2a32c9b19400301fd75c7e6adddec4575e
|
4
|
+
data.tar.gz: daed58c38da382042533b66e6054826aeee8b5242826a93900bbc2fa7da1ef0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4788685b6d87fb0c6953e366023c4f7e5bd3545300d1b98d9b4bcc42993492331f31819a33c829e13427a5c308dd817d26617173c55f9007f625de99d094e71
|
7
|
+
data.tar.gz: 6fcf63648215bf1c857b8e492b3fe7ead0a6c794ee6aa2db8c57cfed52176aad4a6764b1b5b19799ed7eae1c290ca39570d57c62698501237b21650f2889904e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# BBK::Utils
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/bbk-utils.svg)](https://rubygems.org/gems/bbk-utils)
|
4
|
+
[![Gem](https://img.shields.io/gem/dt/bbk-utils.svg)](https://rubygems.org/gems/bbk-utils/versions)
|
5
|
+
[![YARD](https://badgen.net/badge/YARD/doc/blue)](http://www.rubydoc.info/gems/bbk-utils)
|
6
|
+
|
7
|
+
[![Coverage](https://lysander.rnds.pro/api/v1/badges/bbk-utils_coverage.svg)](https://lysander.rnds.pro/api/v1/badges/bbkutils_coverage.html)
|
8
|
+
[![Quality](https://lysander.rnds.pro/api/v1/badges/bbk-utils_quality.svg)](https://lysander.rnds.pro/api/v1/badges/bbkutils_quality.html)
|
9
|
+
[![Outdated](https://lysander.rnds.pro/api/v1/badges/bbk-utils_outdated.svg)](https://lysander.rnds.pro/api/v1/badges/bbkutils_outdated.html)
|
10
|
+
[![Vulnerabilities](https://lysander.rnds.pro/api/v1/badges/bbk-utils_vulnerable.svg)](https://lysander.rnds.pro/api/v1/badges/bbkutils_vulnerable.html)
|
11
|
+
|
12
|
+
|
3
13
|
Common classes for BBK library stack.
|
4
14
|
|
5
15
|
## Installation
|
data/lib/bbk/utils/logger.rb
CHANGED
data/lib/bbk/utils/version.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