sockd 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: bbba093ffbc8962d151f715d579043d0ad84c9c3
4
- data.tar.gz: 433ef664dc0ce7a7c5607dd54bd131c25b8db5d6
3
+ metadata.gz: d25ce828b55583f286558554e0fa7606403bdce4
4
+ data.tar.gz: c2d8410fe27052b5632652d89eb6076c3246e261
5
5
  SHA512:
6
- metadata.gz: 5724116c5a2f1d859dd9ab1d6532d73ffe5272ccf107f09e56aa74329ca9151fc0615407eec5d307a2052b393a02f59f2e67ad787f19701a478d864a8dd95c34
7
- data.tar.gz: dcf9c51370d19e3af1cea9d37d4c9bd1d6be504b3395c73e72633b80cfef552a013c18218960d414b5a2121abaf83af9f4a6cd0d905968b946cd47233323b56e
6
+ metadata.gz: b030f1bd71ad93b5bb32ba1de2fd2d23e095a9c0e73b260bc8558e7c700f1b14508407750162082b17a55c06045d052e4a2dece1afd4b02c104053c019dfd148
7
+ data.tar.gz: 58ce09e8c91b0fc8d269315cf29d6aeed1e896cc03e13e41df6cfbc63f3466b52621ee80d62d7051de6e4bbdcf4b4767a32bb269e51f5ec6644f4e04c3428003
data/examples/listd.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
4
3
  require 'sockd'
5
4
 
6
5
  Sockd.run 'listd' do |sockd|
data/lib/sockd/runner.rb CHANGED
@@ -86,14 +86,15 @@ module Sockd
86
86
 
87
87
  # start our service
88
88
  def start
89
- if options[:daemonize]
90
- pid = daemon_running?
91
- raise ProcError, "#{name} process already running (#{pid})" if pid
92
- puts "starting #{name} process..."
93
- return self unless daemonize
94
- end
95
-
96
89
  server do |server|
90
+
91
+ if options[:daemonize]
92
+ pid = daemon_running?
93
+ raise ProcError, "#{name} process already running (#{pid})" if pid
94
+ puts "starting #{name} process..."
95
+ return self unless daemonize
96
+ end
97
+
97
98
  drop_privileges options[:user], options[:group]
98
99
 
99
100
  setup
@@ -105,6 +106,7 @@ module Sockd
105
106
  exit 130
106
107
  end
107
108
 
109
+ log "listening on " + server.local_address.inspect_sockaddr
108
110
  while true
109
111
  sock = server.accept
110
112
  begin
@@ -211,7 +213,6 @@ module Sockd
211
213
  TCPServer.new(options[:host], options[:port])
212
214
  end
213
215
  begin
214
- log "listening on " + server.local_address.inspect_sockaddr
215
216
  yield(server)
216
217
  ensure
217
218
  server.close
data/lib/sockd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sockd
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sockd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Greiling