snmp 1.0.0 → 1.0.1

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/README CHANGED
@@ -25,6 +25,11 @@ examples below for more details.
25
25
 
26
26
  == Changes
27
27
 
28
+ Changes for version 1.0.1:
29
+
30
+ * Made the host configurable for the TrapListener. Previously defaulted
31
+ to 'localhost'.
32
+
28
33
  Changes for version 1.0.0:
29
34
 
30
35
  * Added to_s method to TimeTicks. Displays time in human-readable form
data/Rakefile CHANGED
@@ -2,6 +2,7 @@ require 'rake'
2
2
  require 'rake/testtask'
3
3
  require 'rake/gempackagetask'
4
4
  require 'rake/rdoctask'
5
+ require 'rake/clean'
5
6
 
6
7
  # test target
7
8
  Rake::TestTask.new do |test|
@@ -9,7 +10,7 @@ Rake::TestTask.new do |test|
9
10
  end
10
11
 
11
12
  # package target
12
- PKG_VERSION = '1.0.0'
13
+ PKG_VERSION = '1.0.1'
13
14
  PKG_FILES = FileList[
14
15
  'Rakefile',
15
16
  'README',
@@ -20,6 +21,10 @@ PKG_FILES = FileList[
20
21
  'examples/*.rb',
21
22
  'data/**/*.yaml']
22
23
 
24
+ CLEAN.include 'pkg'
25
+ CLEAN.include 'doc'
26
+ CLEAN.include 'web/web'
27
+
23
28
  spec = Gem::Specification.new do |s|
24
29
  s.platform = Gem::Platform::RUBY
25
30
  s.summary = "A Ruby implementation of SNMP (the Simple Network Management Protocol)."
@@ -49,5 +54,9 @@ Rake::RDocTask.new do |doc|
49
54
  doc.main = "README"
50
55
  doc.rdoc_files.include('README', 'lib/**/*.rb')
51
56
  doc.title = "SNMP Library for Ruby"
57
+ end
58
+
59
+ task :web => :rdoc do
60
+ require 'web/generate'
52
61
  end
53
62
 
@@ -494,9 +494,9 @@ class Manager
494
494
  end
495
495
 
496
496
  class UDPServerTransport
497
- def initialize(port)
497
+ def initialize(host, port)
498
498
  @socket = UDPSocket.open
499
- @socket.bind('localhost', port)
499
+ @socket.bind(host, port)
500
500
  end
501
501
 
502
502
  def close
@@ -531,6 +531,7 @@ end
531
531
  #
532
532
  class TrapListener
533
533
  DefaultConfig = {
534
+ :Host => 'localhost',
534
535
  :Port => 162,
535
536
  :Community => 'public',
536
537
  :ServerTransport => UDPServerTransport,
@@ -554,7 +555,7 @@ class TrapListener
554
555
  #
555
556
  def initialize(config={}, &block)
556
557
  @config = DefaultConfig.dup.update(config)
557
- @transport = @config[:ServerTransport].new(@config[:Port])
558
+ @transport = @config[:ServerTransport].new(@config[:Host], @config[:Port])
558
559
  @max_bytes = @config[:MaxReceiveBytes]
559
560
  @handler_init = block
560
561
  @oid_handler = {}
@@ -173,7 +173,7 @@ end
173
173
 
174
174
  class TrapTestTransport
175
175
  include SNMP
176
- def initialize(port)
176
+ def initialize(host, port)
177
177
  @count = 0
178
178
  sys_up_varbind = VarBind.new(ObjectId.new("1.3.6.1.2.1.1.3.0"),
179
179
  TimeTicks.new(1234))
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: snmp
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2006-03-02 00:00:00 -05:00
6
+ version: 1.0.1
7
+ date: 2006-05-04 00:00:00 -04:00
8
8
  summary: A Ruby implementation of SNMP (the Simple Network Management Protocol).
9
9
  require_paths:
10
10
  - lib