net-proto 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +7 -0
- data/MANIFEST +1 -1
- data/Rakefile +79 -0
- data/examples/example_net_proto.rb +25 -0
- data/net-proto.gemspec +30 -0
- metadata +17 -16
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 1.0.5 - 12-Sep-2009
|
2
|
+
* Changed license to Artistic 2.0.
|
3
|
+
* Added a build_binary_gem task.
|
4
|
+
* Cleaned up and refactored the gemspec a bit, including the addition of
|
5
|
+
a license and an updated description.
|
6
|
+
* Switched test-unit from a runtime dependency to a dev dependency.
|
7
|
+
|
1
8
|
== 1.0.4 - 6-Jan-2008
|
2
9
|
* The struct returned by Net::Proto.getprotoent is now frozen. This is
|
3
10
|
strictly read-only data.
|
data/MANIFEST
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rbconfig'
|
5
|
+
include Config
|
6
|
+
|
7
|
+
desc 'Clean the build files for the net-proto source'
|
8
|
+
task :clean do
|
9
|
+
make = RUBY_PLATFORM.match('mswin') ? 'nmake' : 'make'
|
10
|
+
Dir.chdir('ext') do
|
11
|
+
proto_file = 'proto.' + Config::CONFIG['DLEXT']
|
12
|
+
if File.exists?('proto.o') || File.exists?(proto_file)
|
13
|
+
sh "#{make} distclean"
|
14
|
+
end
|
15
|
+
FileUtils.rm_rf('proto.c') if File.exists?('proto.c')
|
16
|
+
FileUtils.rm_rf('net') if File.exists?('net')
|
17
|
+
end
|
18
|
+
FileUtils.rm_rf('net') if File.exists?('net')
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'Build the net-proto library'
|
22
|
+
task :build => [:clean] do
|
23
|
+
make = RUBY_PLATFORM.match('mswin') ? 'nmake' : 'make'
|
24
|
+
Dir.chdir('ext') do
|
25
|
+
ruby 'extconf.rb'
|
26
|
+
sh make
|
27
|
+
build_file = 'proto.' + Config::CONFIG['DLEXT']
|
28
|
+
Dir.mkdir('net') unless File.exists?('net')
|
29
|
+
FileUtils.cp(build_file, 'net')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Install the net-proto library (non-gem)'
|
34
|
+
task :install => [:build] do
|
35
|
+
Dir.chdir('ext') do
|
36
|
+
sh 'make install'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Install the net-proto library (gem)'
|
41
|
+
task :install_gem do
|
42
|
+
ruby 'net-proto.gemspec'
|
43
|
+
file = Dir["net-proto*.gem"].last
|
44
|
+
sh "gem install #{file}"
|
45
|
+
end
|
46
|
+
|
47
|
+
desc 'Run the example net-proto program'
|
48
|
+
task :example => [:build] do
|
49
|
+
Dir.mkdir('net') unless File.exists?('net')
|
50
|
+
ruby '-Iext examples/example_net_proto.rb'
|
51
|
+
end
|
52
|
+
|
53
|
+
Rake::TestTask.new do |t|
|
54
|
+
task :test => :build
|
55
|
+
t.libs << 'ext'
|
56
|
+
t.warning = true
|
57
|
+
t.verbose = true
|
58
|
+
end
|
59
|
+
|
60
|
+
desc 'Build a standard gem'
|
61
|
+
task :build_gem => :clean do
|
62
|
+
rm_rf('lib') if File.exists?('lib')
|
63
|
+
spec = eval(IO.read('net-proto.gemspec'))
|
64
|
+
Gem::Builder.new(spec).build
|
65
|
+
end
|
66
|
+
|
67
|
+
desc 'Build a binary gem'
|
68
|
+
task :build_binary_gem => [:build] do
|
69
|
+
file = 'ext/net/proto.' + CONFIG['DLEXT']
|
70
|
+
mkdir_p('lib/net')
|
71
|
+
mv(file, 'lib/net')
|
72
|
+
|
73
|
+
spec = eval(IO.read('net-proto.gemspec'))
|
74
|
+
spec.extensions = nil
|
75
|
+
spec.files = spec.files.reject{ |f| f.include?('ext/') }
|
76
|
+
spec.platform = Gem::Platform::CURRENT
|
77
|
+
|
78
|
+
Gem::Builder.new(spec).build
|
79
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#########################################################################
|
2
|
+
# example_net_proto.rb
|
3
|
+
#
|
4
|
+
# A generic test program for general futzing. You cna run this example
|
5
|
+
# code via the 'rake example' task.
|
6
|
+
#########################################################################
|
7
|
+
require 'net/proto''
|
8
|
+
include Net
|
9
|
+
|
10
|
+
puts "VERSION: " + Proto::VERSION
|
11
|
+
|
12
|
+
puts "UDP port: " + Proto.getprotobyname("udp").to_s
|
13
|
+
|
14
|
+
unless File::ALT_SEPARATOR
|
15
|
+
puts "Name\t\tProto\tAliases"
|
16
|
+
puts "=========================="
|
17
|
+
|
18
|
+
Proto.getprotoent.each{ |s|
|
19
|
+
if s.name.length > 7
|
20
|
+
puts s.name + "\t" + s.proto.to_s + "\t" + s.aliases.join(", ")
|
21
|
+
else
|
22
|
+
puts s.name + "\t\t" + s.proto.to_s + "\t" + s.aliases.join(", ")
|
23
|
+
end
|
24
|
+
}
|
25
|
+
end
|
data/net-proto.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
# To build a regular gem => rake build_gem
|
4
|
+
# To build a binary gem => rake build_binary_gem
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = 'net-proto'
|
8
|
+
gem.version = '1.0.5'
|
9
|
+
gem.author = 'Daniel J. Berger'
|
10
|
+
gem.license = 'Artistic 2.0'
|
11
|
+
gem.email = 'djberg96@gmail.com'
|
12
|
+
gem.homepage = 'http://www.rubyforge.org/projects/sysutils'
|
13
|
+
gem.platform = Gem::Platform::RUBY
|
14
|
+
gem.summary = 'A Ruby interface for determining protocol information'
|
15
|
+
gem.test_file = 'test/test_net_proto.rb'
|
16
|
+
gem.has_rdoc = true
|
17
|
+
gem.extensions = ['ext/extconf.rb']
|
18
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
19
|
+
|
20
|
+
gem.rubyforge_project = 'sysutils'
|
21
|
+
gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/netproto.txt']
|
22
|
+
|
23
|
+
gem.add_development_dependency('test-unit', '>= 2.0.3')
|
24
|
+
|
25
|
+
gem.description = <<-EOF
|
26
|
+
The net-proto library provides an interface for get protocol information
|
27
|
+
by name or by number. It can also iterate over the list of protocol
|
28
|
+
entries defined on your system.
|
29
|
+
EOF
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-proto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,20 +9,20 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-12 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: test-unit
|
17
|
-
type: :
|
17
|
+
type: :development
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.0.
|
23
|
+
version: 2.0.3
|
24
24
|
version:
|
25
|
-
description: The net-proto
|
25
|
+
description: " The net-proto library provides an interface for get protocol information\n by name or by number. It can also iterate over the list of protocol\n entries defined on your system.\n"
|
26
26
|
email: djberg96@gmail.com
|
27
27
|
executables: []
|
28
28
|
|
@@ -34,23 +34,24 @@ extra_rdoc_files:
|
|
34
34
|
- MANIFEST
|
35
35
|
- doc/netproto.txt
|
36
36
|
files:
|
37
|
+
- CHANGES
|
37
38
|
- doc/netproto.txt
|
38
|
-
-
|
39
|
+
- examples/example_net_proto.rb
|
39
40
|
- ext/extconf.rb
|
40
|
-
- ext/generic
|
41
41
|
- ext/generic/generic.c
|
42
|
-
- ext/linux
|
43
42
|
- ext/linux/linux.c
|
44
|
-
- ext/sunos
|
45
43
|
- ext/sunos/sunos.c
|
46
44
|
- ext/version.h
|
47
|
-
- ext/windows
|
48
45
|
- ext/windows/windows.c
|
49
|
-
- CHANGES
|
50
|
-
- README
|
51
46
|
- MANIFEST
|
47
|
+
- net-proto.gemspec
|
48
|
+
- Rakefile
|
49
|
+
- README
|
50
|
+
- test/test_net_proto.rb
|
52
51
|
has_rdoc: true
|
53
52
|
homepage: http://www.rubyforge.org/projects/sysutils
|
53
|
+
licenses:
|
54
|
+
- Artistic 2.0
|
54
55
|
post_install_message:
|
55
56
|
rdoc_options: []
|
56
57
|
|
@@ -60,7 +61,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
61
|
requirements:
|
61
62
|
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
+
version: "0"
|
64
65
|
version:
|
65
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
67
|
requirements:
|
@@ -71,9 +72,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
requirements: []
|
72
73
|
|
73
74
|
rubyforge_project: sysutils
|
74
|
-
rubygems_version: 1.
|
75
|
+
rubygems_version: 1.3.5
|
75
76
|
signing_key:
|
76
|
-
specification_version:
|
77
|
-
summary:
|
77
|
+
specification_version: 3
|
78
|
+
summary: A Ruby interface for determining protocol information
|
78
79
|
test_files:
|
79
80
|
- test/test_net_proto.rb
|