blackstack_commons 0.0.20 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extend_time.rb +6 -1
- data/lib/functions.rb +14 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3af551bd870c5dbc4444fae14abb1d312f89111e
|
4
|
+
data.tar.gz: 25331c677282623de5dda429a0b6630b972a7086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85044e3300958ab0e15bd317c427acad1bda635753ec04e6a1ea72565ace7c5006fe4a39371d495d5888f2dc9c56220fa1b372a21cd58d8a5fdbbee3786eacd0
|
7
|
+
data.tar.gz: db50cb526f6959e88c3839046e7fb4778070987cbf8cc08606d6fccbecfeaa71addfc7000a708210d95f361ab0a1e26fa245d00ac8d14a9dc0618b98be552a9a
|
data/lib/extend_time.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
class Time
|
2
|
-
# Converts a time object to an SQL friendy string
|
2
|
+
# Converts a time object to an SQL friendy string: YYYY-MM-DD HH:mm:ss
|
3
3
|
def to_sql()
|
4
4
|
BlackStack::DateTime::Encoding::datetime_to_sql(self)
|
5
5
|
end
|
6
|
+
|
7
|
+
# Converts a time object to an API friendy string: YYYYMMDDHHmmss
|
8
|
+
def to_api()
|
9
|
+
BlackStack::Strings::DateTime::datetime_sql_to_api(self.to_sql)
|
10
|
+
end
|
6
11
|
end # class DateTime
|
data/lib/functions.rb
CHANGED
@@ -447,6 +447,18 @@ module BlackStack
|
|
447
447
|
DEFAULT_SSL_VERIFY_MODE = OpenSSL::SSL::VERIFY_NONE
|
448
448
|
SUCCESS = 'success'
|
449
449
|
|
450
|
+
class ApiCallException < StandardError
|
451
|
+
attr_accessor :description
|
452
|
+
|
453
|
+
def initialize(s)
|
454
|
+
self.description = s
|
455
|
+
end
|
456
|
+
|
457
|
+
def to_s
|
458
|
+
self.description
|
459
|
+
end
|
460
|
+
end
|
461
|
+
|
450
462
|
# New call_get
|
451
463
|
def self.call_get(url, params = {}, ssl_verify_mode=BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE)
|
452
464
|
uri = URI(url)
|
@@ -501,9 +513,9 @@ module BlackStack
|
|
501
513
|
sError = "Status: #{parsed['status'].to_s}. Description: #{parsed['value'].to_s}."
|
502
514
|
end
|
503
515
|
rescue Errno::ECONNREFUSED => e
|
504
|
-
sError = "Errno::ECONNREFUSED:" + e.
|
516
|
+
sError = "Errno::ECONNREFUSED:" + e.to_console
|
505
517
|
rescue => e2
|
506
|
-
sError = "Exception:" + e2.
|
518
|
+
sError = "Exception:" + e2.to_console
|
507
519
|
end
|
508
520
|
end # while
|
509
521
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blackstack_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: content_spinning
|