blackstack_commons 1.1.28 → 1.1.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/functions.rb +12 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b57115faaf3a00b4a0cc954244de3d33fa9b00fa
4
- data.tar.gz: 58107d6e5250b684e336d02bac25e8790599ac60
3
+ metadata.gz: 1bf323bf87e9ad791105370e7fbd0a41c7fc50ae
4
+ data.tar.gz: 1c7bf646475bb5ab9c1b05080b68c0ded854bced
5
5
  SHA512:
6
- metadata.gz: ecc986a230a3bd4bc56c59c5240349ecb887cf4ed84656dab07b4cc2196a859eccf66f5bdb513727bc806627f63cb515f345aa42a53c369c4d3f95087f385993
7
- data.tar.gz: 1f9ddbcc4429c33a55643a8379f60f169379343b2841f06c3b1abfa634b5ea2496ea28a8458c88e0e7fd988e6658c4b626fef9e5ef88eee143fb5aa4167938ad
6
+ metadata.gz: 7914ab263ca9f5ba3d853212bebeea28298aad8e0626cfca93f1904c3bc52c4ca342277bec7f619af3e8737b8b08e4cf7483cb006e2fcb3ae6b39584505b1b46
7
+ data.tar.gz: 162f8cb3bfc71412a2ca5e29e9c31c53a09fefa073172c716d014fe4376d35284b67b2ce7b0369119ea93ae875871b2605d316284e013b9324a0a673bb499102
@@ -11,11 +11,15 @@ module BlackStack
11
11
  # script is running inside an OCRA temp folder, since the local folder
12
12
  # of the running command is not the filder where the exe file is hosted.
13
13
  #
14
- # More information: https://stackoverflow.com/questions/1937743/how-to-get-the-current-working-directorys-absolute-path-from-irb
14
+ # More information:
15
+ # * https://stackoverflow.com/questions/1937743/how-to-get-the-current-working-directorys-absolute-path-from-irb
16
+ # * https://stackoverflow.com/questions/8577223/ruby-get-the-file-being-executed
17
+ # * https://stackoverflow.com/questions/7399882/ruby-getting-path-from-pathfilename/7400057
15
18
  #
16
- def self.require_in_working_path(filename, show_path_info=false)
19
+ def self.require_in_working_path(filename, path, show_path_info=false)
17
20
  puts '' if show_path_info
18
- path = File.expand_path File.dirname(__FILE__)
21
+ path = File.expand_path File.dirname(path)
22
+ #path = Dir.pwd
19
23
  puts "require_in_working_path.path:#{path}:." if show_path_info
20
24
  file = "#{path}/#{filename}"
21
25
  puts "require_in_working_path.file:#{file}:." if show_path_info
@@ -531,6 +535,7 @@ module BlackStack
531
535
  # max_channels: this method use lockfiles to prevent an excesive number of API calls from each datacenter. There is not allowed more simultaneous calls than max_channels.
532
536
  # TODO: setup max_simultaneus_calls in the configurtion file.
533
537
  def self.call_post(url, params = {}, ssl_verify_mode=BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE, use_lockfile=true)
538
+ =begin
534
539
  # build the lockfile name
535
540
  x = 0
536
541
  if BlackStack::Netting.max_api_call_channels.to_i > 0
@@ -539,7 +544,7 @@ module BlackStack
539
544
  # lock the file
540
545
  BlackStack::Netting.lockfiles[x].flock(File::LOCK_EX) if use_lockfile
541
546
  end
542
-
547
+ =end
543
548
  begin
544
549
 
545
550
  # do the call
@@ -559,16 +564,16 @@ module BlackStack
559
564
  end
560
565
 
561
566
  # release the file
562
- BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
567
+ # BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
563
568
  rescue => e
564
569
  # release the file
565
- BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
570
+ # BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
566
571
 
567
572
  # elevo la excepcion
568
573
  raise e
569
574
  ensure
570
575
  # release the file
571
- BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
576
+ # BlackStack::Netting.lockfiles[x].flock(File::LOCK_UN) if use_lockfile && BlackStack::Netting.max_api_call_channels.to_i > 0
572
577
  end
573
578
 
574
579
  # return
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: 1.1.28
4
+ version: 1.1.34
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: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: content_spinning