bbk-utils 1.0.0.68936 → 1.0.1.68944

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 240b6b327994eab2d451b2ac4f95d37bb518f57fa9af862a2880fda8398e98d2
4
- data.tar.gz: 98322898dbb34a0589bcf15ae4f4ff9207be3bb49813ef04aefd7afe3a72c38b
3
+ metadata.gz: 1fa9c2b58a8f2ae38434780294d1ce2a32c9b19400301fd75c7e6adddec4575e
4
+ data.tar.gz: daed58c38da382042533b66e6054826aeee8b5242826a93900bbc2fa7da1ef0b
5
5
  SHA512:
6
- metadata.gz: dfe5e0990e39e9c1c72396c02f380bf7ce48c8806b771d64479b876e579eb30935db9670d0938fa6851f590130b8306251d7bb580c1cc9f205a73700a2e0d5bf
7
- data.tar.gz: 626c05b816608d581bbb7897d85bd923d54d31e5d487af6fac1bf68682a74aaf198c7d6247eff230e847a318d9de750264160adc41c972a55aef17285f60942c
6
+ metadata.gz: c4788685b6d87fb0c6953e366023c4f7e5bd3545300d1b98d9b4bcc42993492331f31819a33c829e13427a5c308dd817d26617173c55f9007f625de99d094e71
7
+ data.tar.gz: 6fcf63648215bf1c857b8e492b3fe7ead0a6c794ee6aa2db8c57cfed52176aad4a6764b1b5b19799ed7eae1c290ca39570d57c62698501237b21650f2889904e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-utils (1.0.0.68936)
4
+ bbk-utils (1.0.1.68944)
5
5
  activesupport
6
6
  russian
7
7
 
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
@@ -39,7 +39,7 @@ module BBK
39
39
  if @default
40
40
  @default
41
41
  else
42
- @default = new(DEFAULT_NAME, 'UNKNOWN')
42
+ @default = new(DEFAULT_NAME, DEFAULT_LEVEL)
43
43
  @default.level = DEFAULT_LEVEL
44
44
  @default
45
45
  end
@@ -1,5 +1,5 @@
1
1
  module BBK
2
2
  module Utils
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
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
- # Метод для генерации идентификатора вложения подставляемого сервисом в xml вида сведений.
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
- # Создает attachment_id который можно указывать в AttachmentContent в качестве идентификатора
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
@@ -15,6 +15,6 @@ module BBK
15
15
 
16
16
  end
17
17
 
18
- self.logger = ::Logger.new(STDOUT)
18
+ self.logger = ::BBK::Logger.default
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbk-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.68936
4
+ version: 1.0.1.68944
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri