mt 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mt +11 -2
  3. data/mt.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd369684f5f1ac2f44c5e3176378a5607a61bf62
4
- data.tar.gz: 24d8cc0d16b7e4f4280d3dff6676945e4f785f70
3
+ metadata.gz: a23473fb977675b5914cef0a509bcb651c36640b
4
+ data.tar.gz: 5e77ffee6b7d25fd3fc72d8989f55087e5769fca
5
5
  SHA512:
6
- metadata.gz: 90353be27ce04bd369118e1f3dde03163773e737043be2948bdf0925fb67daf36a22208665785f35cb95e3986abffb9adc40785494943c9dbb55dfe20f43c745
7
- data.tar.gz: 0f6c3673e2d129e38ecbc46f41326188dbe655b1ffa5c722e66b597ea9904a0ad954d4da1e7cfa9feb9d8c16524799c037b761461225f9b0aaff602da70bde18
6
+ metadata.gz: 18276e7a8fe8583ce6e6e6f81716405391fecfc400f33877fb4de98ad319eecf33b562d5d5d659a1ae7a8e9196b45483d43960a5472a852eba225d0cbe00d20f
7
+ data.tar.gz: e01488b7c93fee68396039a17c1c28c39a7c44b57263e9aff5d8816d46e146b1b334dcfd4b8b4c377a2a7ab39340d752a77cc73c5881f12564ca1c359cf5a239
data/bin/mt CHANGED
@@ -2,7 +2,17 @@
2
2
 
3
3
  require 'socket'
4
4
 
5
- server = TCPServer.open(ARGV.fetch(0, 25))
5
+ port = ARGV.fetch(0, 25)
6
+
7
+ begin
8
+ server = TCPServer.open(port)
9
+ puts "Listening on port #{port}"
10
+ rescue Errno::EACCES
11
+ puts "Couldn't bind to port #{port}."
12
+ exit 1
13
+ end
14
+
15
+ Signal.trap("INT") { exit 0 }
6
16
 
7
17
  loop do
8
18
  client = server.accept
@@ -27,7 +37,6 @@ loop do
27
37
 
28
38
  puts '---'
29
39
  puts res.join
30
- puts '---'
31
40
 
32
41
  client.puts "250 OK"
33
42
  client.gets
data/mt.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "mt"
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
  s.summary = "Mail tester daemon"
7
7
  s.description = "Fake a SMTP server and print email to stdout."
8
8
  s.authors = ["Michel Martens"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-19 00:00:00.000000000 Z
11
+ date: 2013-10-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fake a SMTP server and print email to stdout.
14
14
  email: