nserver 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -2
- data/README.txt +9 -3
- data/Rakefile +1 -1
- data/lib/nserver.rb +14 -6
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
== 1.1.
|
1
|
+
== 1.1.2 / 2007-11-09
|
2
|
+
|
3
|
+
* Bugfix in RNotify require (server won't work for anybody. Ooops)
|
4
|
+
* Support for multi-message lines (end message on a sole . like SMTP)
|
5
|
+
|
6
|
+
|
7
|
+
== 1.1.1 / 2007-11-08
|
2
8
|
|
3
9
|
* Fixes to incoming IP address checks
|
4
10
|
* Read defaults from config file ($HOME/.nserverrc)
|
@@ -7,7 +13,7 @@
|
|
7
13
|
to be instanciated. This lets the 'nclient' work on any machine.
|
8
14
|
|
9
15
|
|
10
|
-
== 1.1.0 / 2007-11
|
16
|
+
== 1.1.0 / 2007-11-07
|
11
17
|
|
12
18
|
* Major feature - accept connections from any host
|
13
19
|
* Bind to any address on machine
|
data/README.txt
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
nserver
|
2
|
-
|
3
|
-
|
2
|
+
by Jon Moses
|
3
|
+
|
4
|
+
http://burningbush.rubyforge.org/nserver/
|
4
5
|
|
5
6
|
== DESCRIPTION:
|
6
7
|
|
7
|
-
|
8
|
+
NServer is a set of classes that provide a flexible notification system for
|
9
|
+
Linux based systems. It sits in the systray, waiting for messages to be
|
10
|
+
submitted for display. X.org standards (via Gtk) and libnotify are used.
|
11
|
+
|
12
|
+
Messages can be submitted from the localhost, or via remote hosts, depending
|
13
|
+
on settings.
|
8
14
|
|
9
15
|
== FEATURES/PROBLEMS:
|
10
16
|
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ Hoe.new('nserver', NServer::VERSION) do |p|
|
|
12
12
|
p.email = 'jon@burningbush.us'
|
13
13
|
p.summary = 'Notification server for ruby using libnotify'
|
14
14
|
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
15
|
-
p.url = p.paragraphs_of('README.txt',
|
15
|
+
p.url = p.paragraphs_of('README.txt', 1).first.split(/\n/)[0]
|
16
16
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
17
17
|
p.rubyforge_name = 'burningbush'
|
18
18
|
end
|
data/lib/nserver.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
1
|
begin
|
3
|
-
require '
|
2
|
+
require 'RNotify'
|
4
3
|
RNOTIFY_FOUND = true
|
5
4
|
rescue LoadError
|
6
5
|
RNOTIFY_FOUND = false
|
@@ -11,7 +10,7 @@ require 'socket'
|
|
11
10
|
require 'ipaddr'
|
12
11
|
|
13
12
|
module NServer
|
14
|
-
VERSION = '1.1.
|
13
|
+
VERSION = '1.1.2'
|
15
14
|
class Server < GServer
|
16
15
|
# Create a NServer::Server instance
|
17
16
|
#
|
@@ -99,8 +98,17 @@ module NServer
|
|
99
98
|
io.puts "#{io.peeraddr.last} is not allowed."
|
100
99
|
return
|
101
100
|
end
|
102
|
-
io.puts("Enter message, terminate with line
|
103
|
-
|
101
|
+
io.puts("Enter message, terminate with . on it's own line (like SMTP)")
|
102
|
+
## Get message loop
|
103
|
+
msg = []
|
104
|
+
loop do
|
105
|
+
line = io.gets.strip
|
106
|
+
break if line == '.' or ! line
|
107
|
+
|
108
|
+
msg << line
|
109
|
+
end
|
110
|
+
|
111
|
+
msg = msg.join("\n")
|
104
112
|
|
105
113
|
if msg == "EXITNOW"
|
106
114
|
notify("Shutting down.")
|
@@ -147,7 +155,7 @@ module NServer
|
|
147
155
|
begin
|
148
156
|
sock = TCPSocket.new(@host_ip, @host_port)
|
149
157
|
sleep(0.1) ## Needs delay, or wait until prompt.
|
150
|
-
sock.write("#{priority.to_s.upcase}:#{msg}\n")
|
158
|
+
sock.write("#{priority.to_s.upcase}:#{msg}\n.\n")
|
151
159
|
sock.close
|
152
160
|
rescue Errno::ECONNREFUSED
|
153
161
|
raise NoServerAvailable.new
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4.5
|
|
3
3
|
specification_version: 2
|
4
4
|
name: nserver
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 1.1.2
|
7
|
+
date: 2007-11-09 00:00:00 -05:00
|
8
8
|
summary: Notification server for ruby using libnotify
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: jon@burningbush.us
|
12
|
-
homepage:
|
12
|
+
homepage: http://burningbush.rubyforge.org/nserver/
|
13
13
|
rubyforge_project: burningbush
|
14
|
-
description: "== FEATURES/PROBLEMS: * Persistent server with notification queueing * Uses X.org SYSTRAY specification (via gtk2) == SYNOPSIS:
|
14
|
+
description: "== DESCRIPTION: NServer is a set of classes that provide a flexible notification system for Linux based systems. It sits in the systray, waiting for messages to be submitted for display. X.org standards (via Gtk) and libnotify are used. Messages can be submitted from the localhost, or via remote hosts, depending on settings. == FEATURES/PROBLEMS: * Persistent server with notification queueing * Uses X.org SYSTRAY specification (via gtk2) == SYNOPSIS:"
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|