sloth-snmp 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cea4c07bc9f9ce8c5e8d21f486a58186450aec95d818187ca64d998d641ede9
4
- data.tar.gz: d1b59278de3b73f751ac6b2cfb4510522b09f8c26ed248d90babc43211f71ddf
3
+ metadata.gz: 62191552bea1c596beac67f798984bf16d53ab168649047ab92e6475231496d8
4
+ data.tar.gz: ab19e1d899788e2e2d728c451fb7860dc1ab83d965a23164bff217ae86b4b95e
5
5
  SHA512:
6
- metadata.gz: bb2092ad1507afc77094d4d21e7a1a215d4f96bf2bd6e93ba3e5f4dfb765159532107601b23382ebfdbf9da23525ddfc8c97cf98b4ccd34d0c33628783ac54b0
7
- data.tar.gz: 8ac8f497c635fc6d63dff118dfce4fffd86acceacda57f18164ddd61e484edfc57039246d143d2f0cb7cac76da49c34d851310a66564bac4f2f814b70292a17e
6
+ metadata.gz: 94c7a5de590d02f36da31f944d425bbe319edecfe2c952121d2807477b6a65ecc372ccaf289ad25b4f69102fa08a4eb60dd146a3a8b9d13dba0d047a400211a7
7
+ data.tar.gz: 9b8eabf3493ab570cb0010adc38f05c6ece9b0bc3a9ec176f26c203b1d3c7c267376610eadc0ae66186cc6dd3fafa161b098d4b18bb27d2a43163754dea796b5
@@ -0,0 +1,73 @@
1
+
2
+ AllCops:
3
+ Exclude:
4
+ - '.*'
5
+ - '*'
6
+ - '*.gemspec'
7
+ - 'Gemfile*'
8
+ - 'bin/**'
9
+ - 'exe/**'
10
+ - 'config/**/*'
11
+ - 'spec/**/*'
12
+ - 'tmp/**/*'
13
+ - 'vendor/**/*'
14
+ TargetRubyVersion: 2.7
15
+
16
+ Layout/ExtraSpacing:
17
+ Enabled: false
18
+
19
+ Layout/SpaceAroundOperators:
20
+ Enabled: false
21
+
22
+ Layout/SpaceBeforeFirstArg:
23
+ Enabled: false
24
+
25
+ Layout/SpaceInsideParens:
26
+ Enabled: false
27
+
28
+ Layout/SpaceInsideArrayLiteralBrackets:
29
+ Enabled: false
30
+
31
+ Layout/SpaceInsideRangeLiteral:
32
+ Enabled: false
33
+
34
+ Layout/SpaceInsideReferenceBrackets:
35
+ Enabled: false
36
+
37
+ Layout/SpaceInsideStringInterpolation:
38
+ Enabled: false
39
+
40
+ Lint/AmbiguousBlockAssociation:
41
+ Enabled: false
42
+
43
+ Lint/EmptyWhen:
44
+ Enabled: false
45
+
46
+ Lint/ReturnInVoidContext:
47
+ Enabled: false
48
+
49
+ Lint/UselessAssignment:
50
+ Enabled: false
51
+
52
+ Metrics/BlockLength:
53
+ Enabled: false
54
+
55
+ Metrics/LineLength:
56
+ Enabled: false
57
+ Max: 120
58
+
59
+ Metrics/MethodLength:
60
+ Enabled: false
61
+
62
+ Style/Documentation:
63
+ Enabled: true
64
+
65
+ Style/FrozenStringLiteralComment:
66
+ Enabled: false
67
+
68
+ Style/NumericPredicate:
69
+ Enabled: false
70
+
71
+ Style/StringLiterals:
72
+ Enabled: false
73
+
@@ -29,6 +29,7 @@ Or install it yourself as:
29
29
  == Usage
30
30
 
31
31
  === New
32
+
32
33
  [source,ruby]
33
34
  ----
34
35
  require "sloth/snmp"
@@ -29,6 +29,7 @@ gem 'sloth/snmp'
29
29
  == 使い方
30
30
 
31
31
  === 新規
32
+
32
33
  [source,ruby]
33
34
  ----
34
35
  require "sloth/snmp"
@@ -7,8 +7,7 @@ module Sloth
7
7
 
8
8
  class UDPTransportExt < ::SNMP::UDPTransport
9
9
  def initialize( address_family, bindto: nil, device: nil )
10
- super
11
- @socket = UDPSocket.open( address_family )
10
+ super address_family
12
11
  if bindto
13
12
  host, port = bindto.split(':') rescue nil
14
13
  @socket.bind( host, port.to_i )
@@ -1,5 +1,5 @@
1
1
  module Sloth
2
2
  class Snmp
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -5,8 +5,8 @@
5
5
 
6
6
  require "sloth/snmp"
7
7
 
8
- config = {}
9
8
  mibpath = ARGV.shift
9
+ config = {}
10
10
  if mibpath
11
11
  config.merge!( mibs: mibpath )
12
12
  end
@@ -15,16 +15,15 @@ peer = ARGV.shift || "127.0.0.1:161"
15
15
 
16
16
  [
17
17
  { topic: "sysName.0", type: SNMP::OctetString, value: Time.now.to_s },
18
- ].each do |tuple|
19
- p [:set, tuple]
20
- pp Snmp.set( peer, tuple, **options )
18
+ ].each do |item|
19
+ p [:set, item]
20
+ pp Snmp.set( peer, item, **options )
21
21
 
22
- # topics = [tuple[:topic]]
23
- topics = tuple[:topic]
24
- p [:get, topics]
25
- tuples = Snmp.get( peer, topics, **options )
26
- tuples.each do |_oid, tuple_|
27
- p tuple_
22
+ topic = item[:topic]
23
+ p [:get, topic]
24
+ tuples = Snmp.get( peer, topic, **options )
25
+ tuples.each do |_oid, tuple|
26
+ p tuple
28
27
  end
29
28
  puts
30
29
  end
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "snmp"
22
22
 
23
- spec.add_development_dependency "rake", "~> 12.0"
24
- spec.add_development_dependency "rspec", "~> 3.0"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "rspec"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sloth-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - arimay
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: snmp
@@ -28,30 +28,30 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '12.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '12.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '0'
55
55
  description: " Sloth::Snmp is yet another wrapper library for snmp. "
56
56
  email:
57
57
  - arima.yasuhiro@gmail.com
@@ -61,7 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
- - ".travis.yml"
64
+ - ".rubocop.yml"
65
65
  - Gemfile
66
66
  - README.adoc
67
67
  - README.ja.adoc
@@ -81,7 +81,7 @@ homepage: https://github.com/arimay/sloth-snmp
81
81
  licenses:
82
82
  - MIT
83
83
  metadata: {}
84
- post_install_message:
84
+ post_install_message:
85
85
  rdoc_options: []
86
86
  require_paths:
87
87
  - lib
@@ -96,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.1.4
100
- signing_key:
99
+ rubygems_version: 3.2.3
100
+ signing_key:
101
101
  specification_version: 4
102
102
  summary: Sloth Snmp Library.
103
103
  test_files: []
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.2
6
- before_install: gem install bundler -v 2.1.4