tcpfiletransfer 0.0.3 → 0.0.4

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: 100f377c1c4e71b9b9fcd6ca3f236077c78e036770f99c003f6d8d35e220b84b
4
- data.tar.gz: c8ce3c868a83dec7c853579cda99c1733f43f5c33ab1d80c25a23b50e15aabcd
3
+ metadata.gz: 62044c0e19afeac843809c334b214195b733a0f86117340612b4d456ea2c640a
4
+ data.tar.gz: 748c80bd45a384b162c4cd426eb4b37b29d60a26381497540406328eba0f23d2
5
5
  SHA512:
6
- metadata.gz: bdeaca3253f4325db1140e6602ff295690b7d87bd1373c4c013376748f190cb63ac5e01d26b023dbb8550dae120e243ee92bb1c363592facb094fd6f6d62cd74
7
- data.tar.gz: c0f28980e0bdb5596db428462cf3da10306c9473f990f4d0dd5eae87d3d8272b9f94a8b60475c2716d1d519c74a40b67751235de9619c4791a82bc1793929870
6
+ metadata.gz: bd0732e8a55145e4786b88984b1de03f4fe689538bae699d58dccd8b0326a0b57bda1798b3a40550786fe86a09534f81f58d44e6b2b30314714a6935a88d77a6
7
+ data.tar.gz: 52fa15820ad722d1f472bfa0eb8fe3dff7b66e284fae7e2715e31c601177bc57cb0d7b60d4beecb838ef5cce2e7f37168a4431ef751fc805afbfa86b58c1a612
data/bin/sendfile CHANGED
@@ -3,11 +3,24 @@ require "filetransfer"
3
3
  require "socket"
4
4
 
5
5
  originalpath = ARGV[0] || `zenity --file-selection --title='Send File'`.chomp
6
+ exit(1) if (!ARGV[0] && $?.exitstatus == 1)
6
7
 
7
8
  path = originalpath.gsub(" ", "`")
8
9
  name = originalpath.split("/").last.gsub(" ", "_")
9
10
 
10
- recipient = ARGV[1] || `zenity --text='Recipient' --entry --title='Send File'`.chomp
11
+ recipient = ""
12
+ loop do
13
+ recipient = ARGV[1] || `zenity --text="Recipient\\n(Leave blank to discover available recipients)" --entry --title='Send File'`.chomp
14
+ exit(1) if $?.exitstatus == 1
15
+
16
+ if recipient == ""
17
+ `notify-send 'Please wait, searching for recipients'`
18
+ hosts = `nmap -Pn -p8021 --open 192.168.0.0/24 | grep -oP '([\\w-]+\\s\\(((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}\\)|((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4})'`
19
+ `zenity --info --no-wrap --title="Avalable recipients" --text="#{hosts}"`
20
+ else
21
+ break
22
+ end
23
+ end
11
24
 
12
25
  server = TCPSocket.new("127.0.0.1", 8021)
13
26
  server.puts "FTSUBMIT #{name} #{path}"
@@ -7,7 +7,7 @@ module FileTransfer
7
7
  notification_command = "notify-send '#{notification_title}' \"#{notification_body}\""
8
8
  #system(notification_command)
9
9
 
10
- x=system("zenity --question --no-wrap --text=\"#{notification_body}\" --title='#{notification_title}'")
10
+ x=system("zenity --question --icon-name=document-save-symbolic.symbolic --no-wrap --text=\"#{notification_body}\" --title='#{notification_title}'")
11
11
  if x
12
12
  file_location = `zenity --file-selection --save --filename=#{filename}`
13
13
  if file_location == ""
data/lib/filetransfer.rb CHANGED
@@ -5,7 +5,7 @@ module FileTransfer
5
5
  @@files = ['server.rb', 'notifier.rb', 'httpserver.rb', 'ftserver.rb']
6
6
 
7
7
  def self.version
8
- "0.0.3"
8
+ "0.0.4"
9
9
  end
10
10
 
11
11
  def self.file_paths(relative:false)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcpfiletransfer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-25 00:00:00.000000000 Z
11
+ date: 2023-03-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An easy way to transfer files over TCP between linux computers
14
14
  email: matthias@matthiasclee.com