lxi_rb 0.9.0 → 0.10.0
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/.tool-versions +1 -1
 - data/CHANGELOG.md +7 -0
 - data/Gemfile.lock +2 -1
 - data/lib/lxi/constants.rb +2 -18
 - data/lib/lxi/functions.rb +1 -1
 - data/lib/lxi/net_finder.rb +26 -11
 - data/lib/lxi/version.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7283b02860c4482c2eb260bb784a6f86d18852bc5df24dfdd2b0e0ec2b878393
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 29ba50fe2386ad91be3f5f7a891a354b0234fa0ec988db2c242e28215c921444
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e89829c886e7df3271eb647d3a70566eb3da5d56786c848a68feebafac5d8993cc46ad017c9d9c372e2dcda7a6f6e71eac2f202cef3aed53b1421668e76eaaf1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2962ef69f5523a261794211eba4443cbe8ce503d38f3e9da69e62021380a4543c6cc7aeee09ced35cb8d1d8279205a2a9f065cedccc248640121cd2a8872b7c5
         
     | 
    
        data/.tool-versions
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ruby 3. 
     | 
| 
      
 1 
     | 
    
         
            +
            ruby 3.2.2
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -4,6 +4,13 @@ 
     | 
|
| 
       4 
4 
     | 
    
         
             
            All notable changes to this project will be documented in this file.
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            - - -
         
     | 
| 
      
 7 
     | 
    
         
            +
            ## [v0.10.0](https://github.com/robcarruthers/lxi_rb/compare/v0.9.0..v0.10.0) - 2023-05-24
         
     | 
| 
      
 8 
     | 
    
         
            +
            #### Refactoring
         
     | 
| 
      
 9 
     | 
    
         
            +
            - **(libchecker)** Add linux lib names and library paths - ([f19c674](https://github.com/robcarruthers/lxi_rb/commit/f19c67461fc76c8fcfd20ab95b86978af6e109ba)) - [@robcarruthers](https://github.com/robcarruthers)
         
     | 
| 
      
 10 
     | 
    
         
            +
            - **(netfinder)** Refine NetFinder search. Upgrade to ruby 3.2.2 +yjit - ([b26ef17](https://github.com/robcarruthers/lxi_rb/commit/b26ef179b6ba392bbfab9e1a33c239a933229cd6)) - [@robcarruthers](https://github.com/robcarruthers)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            - - -
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
       7 
14 
     | 
    
         
             
            ## [v0.9.0](https://github.com/robcarruthers/lxi_rb/compare/v0.8.1..v0.9.0) - 2023-05-22
         
     | 
| 
       8 
15 
     | 
    
         
             
            #### Features
         
     | 
| 
       9 
16 
     | 
    
         
             
            - **(net_finder)** Add NetFinder class - ([079cef5](https://github.com/robcarruthers/lxi_rb/commit/079cef504cb37bb238b50b8fc06edf9b441ffe95)) - [@robcarruthers](https://github.com/robcarruthers)
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/lxi/constants.rb
    CHANGED
    
    | 
         @@ -4,23 +4,7 @@ module Lxi 
     | 
|
| 
       4 
4 
     | 
    
         
             
              LXI_OK = 0
         
     | 
| 
       5 
5 
     | 
    
         
             
              LXI_ERROR = -1
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
              LIBLXI_PATHS = %w[
         
     | 
| 
       8 
     | 
    
         
            -
                liblxi
         
     | 
| 
       9 
     | 
    
         
            -
                liblxi.so.1
         
     | 
| 
       10 
     | 
    
         
            -
                /home/linuxbrew/.linuxbrew/lib/liblxi.so.1
         
     | 
| 
       11 
     | 
    
         
            -
                /usr/local/lib/liblxi.dylib
         
     | 
| 
       12 
     | 
    
         
            -
                /usr/local/lib/liblxi.so
         
     | 
| 
       13 
     | 
    
         
            -
                /usr/lib/liblxi.dylib
         
     | 
| 
       14 
     | 
    
         
            -
                /usr/lib/liblxi.so
         
     | 
| 
       15 
     | 
    
         
            -
              ].freeze
         
     | 
| 
      
 7 
     | 
    
         
            +
              LIBLXI_PATHS = %w[liblxi liblxi.so.1].freeze
         
     | 
| 
       16 
8 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
               
     | 
| 
       18 
     | 
    
         
            -
                mdns
         
     | 
| 
       19 
     | 
    
         
            -
                avahi-client
         
     | 
| 
       20 
     | 
    
         
            -
                libavahi-client
         
     | 
| 
       21 
     | 
    
         
            -
                avahi-client.so.1
         
     | 
| 
       22 
     | 
    
         
            -
                /home/linuxbrew/.linuxbrew/lib/avahi-client.so.1
         
     | 
| 
       23 
     | 
    
         
            -
                /usr/local/lib/libavahi-client.so
         
     | 
| 
       24 
     | 
    
         
            -
                /usr/lib/libavahi-client.so
         
     | 
| 
       25 
     | 
    
         
            -
              ].freeze
         
     | 
| 
      
 9 
     | 
    
         
            +
              MDNS_LIBS = %w[mdns avahi-client].freeze
         
     | 
| 
       26 
10 
     | 
    
         
             
            end
         
     | 
    
        data/lib/lxi/functions.rb
    CHANGED
    
    
    
        data/lib/lxi/net_finder.rb
    CHANGED
    
    | 
         @@ -9,11 +9,28 @@ module Lxi 
     | 
|
| 
       9 
9 
     | 
    
         
             
                  Lxi.init_session
         
     | 
| 
       10 
10 
     | 
    
         
             
                end
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
                def search( 
     | 
| 
       13 
     | 
    
         
            -
                  if type == : 
     | 
| 
       14 
     | 
    
         
            -
                     
     | 
| 
      
 12 
     | 
    
         
            +
                def search(type = :vxi11, timeout: 1000)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  if type == :vxi11
         
     | 
| 
      
 14 
     | 
    
         
            +
                    search_vxi11(timeout)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  elsif type == :mdns
         
     | 
| 
      
 16 
     | 
    
         
            +
                    search_mdns(timeout)
         
     | 
| 
      
 17 
     | 
    
         
            +
                  else
         
     | 
| 
      
 18 
     | 
    
         
            +
                    raise Error, 'Invalid search type'
         
     | 
| 
       15 
19 
     | 
    
         
             
                  end
         
     | 
| 
      
 20 
     | 
    
         
            +
                end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                private
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                def search_vxi11(timeout)
         
     | 
| 
      
 25 
     | 
    
         
            +
                  net_search(timeout, :vxi11)
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
       16 
27 
     | 
    
         | 
| 
      
 28 
     | 
    
         
            +
                def search_mdns(timeout)
         
     | 
| 
      
 29 
     | 
    
         
            +
                  raise Error, 'mDNS library not found' unless mdns_lib_found?
         
     | 
| 
      
 30 
     | 
    
         
            +
                  net_search(timeout, :mdns)
         
     | 
| 
      
 31 
     | 
    
         
            +
                end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                def net_search(timeout, type)
         
     | 
| 
       17 
34 
     | 
    
         
             
                  @devices = []
         
     | 
| 
       18 
35 
     | 
    
         
             
                  info = FFIFunctions::LxiInfo.new
         
     | 
| 
       19 
36 
     | 
    
         
             
                  info[:broadcast] = broadcast_callback
         
     | 
| 
         @@ -27,17 +44,15 @@ module Lxi 
     | 
|
| 
       27 
44 
     | 
    
         
             
                  @devices
         
     | 
| 
       28 
45 
     | 
    
         
             
                end
         
     | 
| 
       29 
46 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                 
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
                def check_mdns_lib?
         
     | 
| 
       33 
     | 
    
         
            -
                  Lxi::LibChecker.installed?(Lxi::MDNS_PATHS)
         
     | 
| 
      
 47 
     | 
    
         
            +
                def mdns_lib_found?
         
     | 
| 
      
 48 
     | 
    
         
            +
                  Lxi::LibChecker.installed?(Lxi::MDNS_LIBS)
         
     | 
| 
       34 
49 
     | 
    
         
             
                end
         
     | 
| 
       35 
50 
     | 
    
         | 
| 
       36 
51 
     | 
    
         
             
                def broadcast_callback
         
     | 
| 
       37 
     | 
    
         
            -
                   
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                   
     | 
| 
      
 52 
     | 
    
         
            +
                  FFI::Function.new(:void, %i[pointer pointer]) do |service, interface|
         
     | 
| 
      
 53 
     | 
    
         
            +
                    # puts("Broadcast: #{service.read_string} on #{interface.read_string}\n\n")
         
     | 
| 
      
 54 
     | 
    
         
            +
                    # @devices << { service: service.read_string, interface: interface.read_string }
         
     | 
| 
      
 55 
     | 
    
         
            +
                  end
         
     | 
| 
       41 
56 
     | 
    
         
             
                end
         
     | 
| 
       42 
57 
     | 
    
         | 
| 
       43 
58 
     | 
    
         
             
                def device_callback
         
     | 
    
        data/lib/lxi/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: lxi_rb
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.10.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Rob Carruthers
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-05-24 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: ffi
         
     | 
| 
         @@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       75 
75 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       76 
76 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       77 
77 
     | 
    
         
             
            requirements: []
         
     | 
| 
       78 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 78 
     | 
    
         
            +
            rubygems_version: 3.4.10
         
     | 
| 
       79 
79 
     | 
    
         
             
            signing_key:
         
     | 
| 
       80 
80 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       81 
81 
     | 
    
         
             
            summary: Ruby wrapper for the liblxi library.
         
     |