tinc_scanner 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e17323ed935ce6916a9c992c73598f372cdab4ebdc97c6186f9fc491eeb3502e
4
- data.tar.gz: ce64dc8d598bb7d33e3711946897ed36489ea3efe06a5b78611c37a707a5b767
3
+ metadata.gz: 0e4cff159b11e2205e4316a7648e0aacd0906d7897e856dd9bb3b41ccac56c4f
4
+ data.tar.gz: 85a45a000f7460a9d87229b6b3b8aab283f9c786dddd468a460bc7e0ef6245d0
5
5
  SHA512:
6
- metadata.gz: 8ba0d369ac85d2b48265e261468acdab185ae22c43db297ffa5fbc46012855c36536ce20684af84b5e2aa308075ec614d99fc5b949d4990b5d2dc1f731432720
7
- data.tar.gz: bb716431ae238f1bd7edf34b003b91cfe11f88a82b13d72e8c584c40145b86e99845b99823d164eb3db0cc5136f2718018410c4b3688b6ef56f12e33a851d703
6
+ metadata.gz: c81127ed0b23349431d4a4f2bead385ac1704605b5707bb310a1d35ade6fbdab421e18ba11358ae2bfa6b8c0138a3c831971521151dc6fdbf6fe0bbc8a7d3f49
7
+ data.tar.gz: 0d0085f82af0fa0174574fef8f851482e096cc10820446849389f96d5524da32c333c0c78031f6e0f5a89c02a634c97e7822522dfa328673d73d28a9aabd634c
data/bin/tinc_scanner CHANGED
@@ -9,7 +9,7 @@ if ARGV.length < 2
9
9
  puts 'Usage: tinc_scanner nodename host [port]'
10
10
  exit!
11
11
  elsif ARGV.length > 3
12
- puts "Too much arguments."
12
+ puts 'Too much arguments.'
13
13
  puts 'Usage: tinc_scanner nodename host [port]'
14
14
  exit!
15
15
  end
@@ -4,14 +4,12 @@
4
4
  # Provides a Tinc scanner that attempts to determine the protocol version used
5
5
  # and the remote node name via Tinc's legacy authentication protocol.
6
6
  module TincScanner
7
+ # General Tinc Error
8
+ class TincError < StandardError; end
7
9
 
8
- # General Tinc Error
9
- class TincError < Exception; end
10
-
11
- # Error connecting to the Tinc daemon
12
- class TincConnectionError < TincError; end
13
-
14
- # Incorrect or unexpected message received in response
15
- class InvalidTincMessageError < TincError; end
10
+ # Error connecting to the Tinc daemon
11
+ class TincConnectionError < TincError; end
16
12
 
13
+ # Incorrect or unexpected message received in response
14
+ class InvalidTincMessageError < TincError; end
17
15
  end
@@ -4,17 +4,15 @@
4
4
  # Provides a Tinc scanner that attempts to determine the protocol version used
5
5
  # and the remote node name via Tinc's legacy authentication protocol.
6
6
  module TincScanner
7
-
8
7
  # Represents a Tinc Metaconnection that has been set up with the
9
8
  # Legacy Authentication Protocol
10
9
  class TincMetaconnection
11
-
12
10
  require 'socket'
13
11
  require_relative 'errors'
14
12
 
15
13
  # Initializes a Tinc metaconnection
16
14
  #
17
- # @param host [String]
15
+ # @param host [String]
18
16
  # @param port [Integer]
19
17
  def initialize(host, port = 123)
20
18
  raise ArgumentError, 'Host must be a string' unless host.is_a? String
@@ -37,7 +35,7 @@ module TincScanner
37
35
  def receive_id
38
36
  answer = @socket.gets
39
37
  answer.chomp!
40
- request_code, *request = answer.split ' '
38
+ request_code, *request = answer.split
41
39
 
42
40
  raise InvalidTincMessageError, "Request code is not 0: #{request_code}" unless request_code == '0'
43
41
 
@@ -50,7 +48,5 @@ module TincScanner
50
48
 
51
49
  return result
52
50
  end
53
-
54
51
  end
55
-
56
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinc_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Küthe
@@ -27,7 +27,7 @@ files:
27
27
  - lib/tinc_scanner/tinc_metaconnection.rb
28
28
  homepage: https://codeberg.org/mark22k/tinc_scanner
29
29
  licenses:
30
- - WTFPL
30
+ - GPL-3.0-or-later
31
31
  metadata:
32
32
  source_code_uri: https://codeberg.org/mark22k/tinc_scanner
33
33
  bug_tracker_uri: https://codeberg.org/mark22k/tinc_scanner/issues