ok_gntpd 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/ok_gntpd +9 -1
  2. data/lib/ok_gntpd/version.rb +1 -1
  3. metadata +2 -2
data/bin/ok_gntpd CHANGED
@@ -1,11 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
  # coding: utf-8
3
+
4
+ require 'optparse'
3
5
  require 'socket'
4
6
 
5
7
  # This code is originated from:
6
8
  # http://d.hatena.ne.jp/snaka72/20090614/1244986772
7
9
 
8
- port = 23053
10
+ args = {}
11
+ OptionParser.new do |op|
12
+ op.on('-p', '--port PORT') { |v| args[:port] = v.to_i }
13
+ op.parse!
14
+ end
15
+
16
+ port = args[:port] || 23053
9
17
  gate = TCPServer.open(port)
10
18
 
11
19
  puts "Start listening GNTP on #{port}."
@@ -1,3 +1,3 @@
1
1
  module OkGntpd
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ok_gntpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-01-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: An GNTPd which always return "OK".
15
15
  email: