Sha256: 8bef86eaf9a62bdb0ce6eb49f298f12785a93c7f3fbabf56a4ed3381a74c7b8b

Contents?: true

Size: 627 Bytes

Versions: 58

Compression:

Stored size: 627 Bytes

Contents

require_relative 'abstract_command_handler'

class LoadLibraryHandler < AbstractCommandHandler
  def initialize
    @required_parameters_count = 1
  end

  def process(command)
    begin
      if command.payload.length < @required_parameters_count
        raise ArgumentError.new "Load library parameters mismatch"
      end
      if command.payload.length > @required_parameters_count
        assembly_name = command.payload[1]
      else
        assembly_name = command.payload[0]
      end
      #noinspection RubyResolve
      require(assembly_name)
      return 0
    rescue Exception => e
      return e
    end
  end
end

Version data entries

58 entries across 29 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.10 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.10 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.9 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.9 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.8 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.8 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.7 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.7 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.6 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/load_library_handler.rb
javonet-ruby-sdk-2.1.6 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/load_library_handler.rb