libraries/algosec_helper.rb
def load_sdk
      gem 'algosec-sdk', node['algosec']['ruby_sdk_version']
      require 'algosec-sdk'
      Chef::Log.debug("Found gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']})")
    rescue LoadError
      Chef::Log.info("Did not find gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']}). Installing now")
      chef_gem 'algosec-sdk' do
        version node['algosec']['ruby_sdk_version']
        compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time)
      end
      require 'algosec-sdk'
    end
# Load (and install if necessary) the algosec-sdk
Load (and install if necessary) the algosec-sdk
Load ( and install if necessary ) the algosec - sdk
def load_sdk
      gem 'algosec-sdk', node['algosec']['ruby_sdk_version']
      require 'algosec-sdk'
      Chef::Log.debug("Found gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']})")
    rescue LoadError
      Chef::Log.info("Did not find gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']}). Installing now")
      chef_gem 'algosec-sdk' do
        version node['algosec']['ruby_sdk_version']
        compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time)
      end
      require 'algosec-sdk'
    end
def load_sdk gem 'algosec-sdk' , node [ 'algosec' ] [ 'ruby_sdk_version' ] require 'algosec-sdk' Chef :: Log . debug ( "Found gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']})" ) rescue LoadError Chef :: Log . info ( "Did not find gem algosec-sdk (version #{node['algosec']['ruby_sdk_version']}). Installing now" ) chef_gem 'algosec-sdk' do version node [ 'algosec' ] [ 'ruby_sdk_version' ] compile_time true if Chef :: Resource :: ChefGem . method_defined? ( :compile_time ) end require 'algosec-sdk' end
Load (and install if necessary) the algosec-sdk
Load ( and install if necessary ) the algosec - sdk