corona 0.0.1 → 0.0.2

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/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.0.0'
2
+ #ruby '2.0.0'
3
3
 
4
4
  gem 'sequel'
5
5
  gem 'sqlite3'
data/Gemfile.lock CHANGED
@@ -3,22 +3,22 @@ GEM
3
3
  specs:
4
4
  coderay (1.0.9)
5
5
  diff-lcs (1.2.3)
6
- method_source (0.8.1)
7
- pry (0.9.12)
6
+ method_source (0.8.2)
7
+ pry (0.9.10)
8
8
  coderay (~> 1.0.5)
9
9
  method_source (~> 0.8)
10
- slop (~> 3.4)
11
- rspec (2.13.0)
12
- rspec-core (~> 2.13.0)
13
- rspec-expectations (~> 2.13.0)
14
- rspec-mocks (~> 2.13.0)
15
- rspec-core (2.13.1)
16
- rspec-expectations (2.13.0)
10
+ slop (~> 3.3.1)
11
+ rspec (2.14.1)
12
+ rspec-core (~> 2.14.0)
13
+ rspec-expectations (~> 2.14.0)
14
+ rspec-mocks (~> 2.14.0)
15
+ rspec-core (2.14.5)
16
+ rspec-expectations (2.14.2)
17
17
  diff-lcs (>= 1.1.3, < 2.0)
18
- rspec-mocks (2.13.1)
19
- sequel (3.46.0)
20
- slop (3.4.4)
21
- snmp (1.1.1)
18
+ rspec-mocks (2.14.3)
19
+ sequel (3.42.0)
20
+ slop (3.3.2)
21
+ snmp (1.1.0)
22
22
  sqlite3 (1.3.7)
23
23
 
24
24
  PLATFORMS
data/Rakefile CHANGED
@@ -4,6 +4,7 @@ begin
4
4
  Bundler.setup
5
5
  rescue LoadError
6
6
  warn 'missing dependencies'
7
+ raise
7
8
  exit 42
8
9
  end
9
10
 
data/corona.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'corona'
3
- s.version = '0.0.1'
3
+ s.version = '0.0.2'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = [ 'Saku Ytti' ]
6
6
  s.email = %w( saku@ytti.fi )
@@ -7,6 +7,8 @@ module Corona
7
7
  CFG.ignore = %w( 10.10.10.42/32 10.10.20.42/32 )
8
8
  CFG.mgmt = %w( lo0.0 loopback0 vlan2 )
9
9
  CFG.threads = 50
10
+ CFG.timeout = 0.25
11
+ CFG.retries = 2
10
12
  CFG.log = File.join Config::Root, 'log'
11
13
  CFG.debug = false
12
14
  CFG.save
data/lib/corona/core.rb CHANGED
@@ -49,6 +49,7 @@ module Corona
49
49
  Log.warn "no ifIndex for #{ip}"
50
50
  end
51
51
  end
52
+ snmp.close
52
53
  end
53
54
 
54
55
  def process opt
data/lib/corona/snmp.rb CHANGED
@@ -18,7 +18,10 @@ module Corona
18
18
  require 'snmp'
19
19
  def initialize host, community=CFG.community
20
20
  @snmp = ::SNMP::Manager.new :Host => host, :Community => community,
21
- :Timeout => 1, :Retries => 3, :MibModules => false
21
+ :Timeout => CFG.timeout, :Retries => CFG.retries, :MibModules => []
22
+ end
23
+ def close
24
+ @snmp.close
22
25
  end
23
26
  def get *oid
24
27
  oid = [oid].flatten.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corona
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-05-01 00:00:00.000000000 Z
12
+ date: 2013-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sequel
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 1454207244225852473
99
+ hash: 1830848294566328575
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements: