blackstack_commons 1.1.28 → 1.1.34
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 +4 -4
 - data/lib/functions.rb +12 -7
 - 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: 1bf323bf87e9ad791105370e7fbd0a41c7fc50ae
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1c7bf646475bb5ab9c1b05080b68c0ded854bced
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7914ab263ca9f5ba3d853212bebeea28298aad8e0626cfca93f1904c3bc52c4ca342277bec7f619af3e8737b8b08e4cf7483cb006e2fcb3ae6b39584505b1b46
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 162f8cb3bfc71412a2ca5e29e9c31c53a09fefa073172c716d014fe4376d35284b67b2ce7b0369119ea93ae875871b2605d316284e013b9324a0a673bb499102
         
     | 
    
        data/lib/functions.rb
    CHANGED
    
    | 
         @@ -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:  
     | 
| 
      
 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( 
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-07-22 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: content_spinning
         
     |