snmpjr 0.1.5-java → 0.1.7-java
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.
- checksums.yaml +8 -8
- data/.rspec +0 -1
- data/.rubocop.yml +3 -0
- data/.travis.yml +9 -0
- data/Gemfile +3 -0
- data/README.md +5 -3
- data/Rakefile +6 -3
- data/history.rdoc +8 -0
- data/lib/snmpjr/session.rb +2 -2
- data/lib/snmpjr/target.rb +2 -0
- data/lib/snmpjr/version.rb +1 -1
- data/lib/snmpjr.rb +11 -5
- data/snmpjr.gemspec +9 -10
- data/spec/integration/snmpjr_spec.rb +11 -11
- data/spec/snmpjr/getter_spec.rb +3 -3
- data/spec/snmpjr/pdu_spec.rb +3 -3
- data/spec/snmpjr/response_spec.rb +10 -10
- data/spec/snmpjr/session_spec.rb +7 -7
- data/spec/snmpjr/target_spec.rb +8 -6
- data/spec/snmpjr_spec.rb +3 -3
- data/spec/spec_helper.rb +20 -3
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGVjMjA0ZTY4YTdmN2Q3YWZkYzJlNTAzM2NjN2RjZDhjYmVjYWEwNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTI3OTIwODllMTgzMDhmNzk5NmFmYTFjZjIyOWJiMGNlYWQ3NmMyZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmIzZDU5ZTE3MWUyMWQzZThlYWQwZmJjNDExZmMwYmE2ZGM1MjI1YjQ2YzJm
|
10
|
+
NjllOTUwNDI3MTYxZDYzM2YxZjQzMzU5MjA4ZTU2YzUxOWFhMzk4YWMyYWVi
|
11
|
+
YTllZjJlMjg1ZDZkMTIxM2JmNzJkZjNjNzcyZmEyOTRhMjM5MDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTZiYTc5NzBhZjFhODE5YjdkN2U4ZWFkMWU3ZTljZmViYzEwYWRhNjA2OTdj
|
14
|
+
YjFmMDBiYTZjYjAzOWI2NDM1ZmQzNmMyNzRmNTQ3NGFlNTUzNzRmZGU3ZDk2
|
15
|
+
MmU5ZDAwZDhiZTRkN2JjMWZmNjVlNzIxMzI4M2MxNDhjN2EzZjE=
|
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
language: ruby
|
2
|
+
branches:
|
3
|
+
only:
|
4
|
+
- master
|
5
|
+
- /^[0-9]+\.[0-9]+\.[0-9]+/
|
6
|
+
env:
|
7
|
+
global:
|
8
|
+
- CODECLIMATE_REPO_TOKEN=151e29085225a0d503821bd67ad8d5dadddb7352fe0d585512c325990c85492b
|
2
9
|
rvm:
|
3
10
|
- jruby-1.7.0
|
4
11
|
- jruby-1.7.16
|
12
|
+
script:
|
13
|
+
- bundle exec rake
|
5
14
|
deploy:
|
6
15
|
provider: rubygems
|
7
16
|
api_key:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
Snmpjr
|
2
|
+
======
|
3
|
+
|
4
|
+
[](http://badge.fury.io/rb/snmpjr) [](https://travis-ci.org/zenonas/snmpjr) [](https://coveralls.io/r/zenonas/snmpjr?branch=master) [](https://codeclimate.com/github/zenonas/snmpjr) [](https://gemnasium.com/zenonas/snmpjr) [](http://inch-ci.org/github/zenonas/snmpjr)
|
2
5
|
|
3
|
-
[](https://travis-ci.org/zenonas/snmpjr)
|
4
6
|
Snmpjr aims to provide a clean and simple interface to use SNMP in your ruby code. It will wrap the popular SNMP4J library in Java.
|
5
7
|
|
6
8
|
Please note the gem is still in early develpment. Do not use as of yet!
|
@@ -34,7 +36,7 @@ Or install it yourself as:
|
|
34
36
|
|
35
37
|
```ruby
|
36
38
|
# Initialize Snmpjr with host, port and a community
|
37
|
-
snmp = Snmpjr.new(:
|
39
|
+
snmp = Snmpjr.new(host: '127.0.0.1', port: 161, community: 'public')
|
38
40
|
|
39
41
|
# Call get on any single Oid
|
40
42
|
snmp.get '1.3.6.1.2.1.1.1.0'
|
data/Rakefile
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
require 'rake/clean'
|
2
2
|
require 'rake_rack'
|
3
|
+
require 'rubocop/rake_task'
|
3
4
|
|
4
|
-
@external_dependencies = %w
|
5
|
+
@external_dependencies = %w( jruby java )
|
5
6
|
|
6
|
-
|
7
|
+
RuboCop::RakeTask.new
|
8
|
+
|
9
|
+
task default: [
|
7
10
|
:clean,
|
8
11
|
:"rake_rack:check_external_dependencies",
|
9
12
|
:"rake_rack:code_quality:all",
|
10
13
|
:"rake_rack:rspec",
|
11
14
|
:"rake_rack:coverage:check_specs",
|
12
|
-
:"rake_rack:ok"
|
15
|
+
:"rake_rack:ok"
|
13
16
|
]
|
data/history.rdoc
CHANGED
data/lib/snmpjr/session.rb
CHANGED
@@ -36,9 +36,9 @@ class Snmpjr
|
|
36
36
|
|
37
37
|
def construct_response variable_binding
|
38
38
|
if variable_binding.is_exception
|
39
|
-
Snmpjr::Response.new(:
|
39
|
+
Snmpjr::Response.new(error: variable_binding.variable.to_s)
|
40
40
|
else
|
41
|
-
Snmpjr::Response.new(:
|
41
|
+
Snmpjr::Response.new(value: variable_binding.variable.to_s)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
data/lib/snmpjr/target.rb
CHANGED
@@ -8,8 +8,10 @@ class Snmpjr
|
|
8
8
|
target.community = Snmpjr::Wrappers::SMI::OctetString.new(options.fetch(:community))
|
9
9
|
target.address = Snmpjr::Wrappers::SMI::GenericAddress.parse("udp:#{options.fetch(:host)}/#{options.fetch(:port)}")
|
10
10
|
target.version = 1
|
11
|
+
target.retries = options.fetch(:retries)
|
11
12
|
target.timeout = options.fetch(:timeout)
|
12
13
|
target
|
13
14
|
end
|
15
|
+
|
14
16
|
end
|
15
17
|
end
|
data/lib/snmpjr/version.rb
CHANGED
data/lib/snmpjr.rb
CHANGED
@@ -6,15 +6,21 @@ class Snmpjr
|
|
6
6
|
|
7
7
|
def initialize options = {}
|
8
8
|
@host = options.fetch(:host)
|
9
|
-
@port = options.fetch(:port)
|
9
|
+
@port = options.fetch(:port) { 161 }
|
10
10
|
@community = options.fetch(:community)
|
11
|
-
@timeout = options
|
12
|
-
@max_oids_per_request = options
|
11
|
+
@timeout = options.fetch(:timeout) { 5000 }
|
12
|
+
@max_oids_per_request = options.fetch(:max_oids_per_request) { 30 }
|
13
|
+
@retries = options.fetch(:retries) { 0 }
|
13
14
|
end
|
14
15
|
|
15
16
|
def get oids
|
16
|
-
target = Snmpjr::Target.new.create(:
|
17
|
-
|
17
|
+
target = Snmpjr::Target.new.create(host: @host,
|
18
|
+
port: @port,
|
19
|
+
community: @community,
|
20
|
+
timeout: @timeout,
|
21
|
+
retries: @retries
|
22
|
+
)
|
23
|
+
getter = Snmpjr::Getter.new(target: target, max_oids_per_request: @max_oids_per_request)
|
18
24
|
|
19
25
|
case oids.class.to_s
|
20
26
|
when 'String'
|
data/snmpjr.gemspec
CHANGED
@@ -4,20 +4,19 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'snmpjr/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'snmpjr'
|
8
8
|
spec.version = Snmpjr::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
|
14
|
-
spec.
|
15
|
-
spec.license = "MIT"
|
9
|
+
spec.authors = ['Zen Kyprianou']
|
10
|
+
spec.email = ['zen@kyprianou.eu']
|
11
|
+
spec.summary = 'Simple SNMP interface for JRuby'
|
12
|
+
spec.description = 'Snmpjr aims to provide a clean and simple interface to use SNMP in your ruby code. It will wrap the popular SNMP4J library in Java.'
|
13
|
+
spec.homepage = 'https://github.com/zenonas/snmpjr'
|
14
|
+
spec.license = 'MIT'
|
16
15
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0")
|
18
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
21
20
|
|
22
|
-
spec.platform =
|
21
|
+
spec.platform = 'java'
|
23
22
|
end
|
@@ -6,33 +6,33 @@ describe "snmpjr" do
|
|
6
6
|
|
7
7
|
describe 'GET' do
|
8
8
|
context 'when the host is reachable' do
|
9
|
-
subject { Snmpjr.new(:
|
9
|
+
subject { Snmpjr.new(host: 'demo.snmplabs.com', port: 161, community: 'public') }
|
10
10
|
|
11
|
-
it
|
12
|
-
expect(subject.get '1.3.6.1.2.1.1.1.0').to eq Snmpjr::Response.new(:
|
11
|
+
it 'can perform a simple synchronous get request on an snmp agent' do
|
12
|
+
expect(subject.get '1.3.6.1.2.1.1.1.0').to eq Snmpjr::Response.new(value: 'SunOS zeus.snmplabs.com 4.1.3_U1 1 sun4m')
|
13
13
|
end
|
14
14
|
|
15
|
-
let(:expected) { [Snmpjr::Response.new(:
|
16
|
-
Snmpjr::Response.new(:
|
17
|
-
it
|
15
|
+
let(:expected) { [Snmpjr::Response.new(value: 'SunOS zeus.snmplabs.com 4.1.3_U1 1 sun4m'),
|
16
|
+
Snmpjr::Response.new(value: 'zeus.snmplabs.com')] }
|
17
|
+
it 'can perform a series of gets if passed an array of oids' do
|
18
18
|
expect(subject.get ['1.3.6.1.2.1.1.1.0', '1.3.6.1.2.1.1.5.0']).to eq expected
|
19
19
|
end
|
20
20
|
|
21
21
|
context "when an invalid oid is requested" do
|
22
22
|
|
23
|
-
let(:expected) { [Snmpjr::Response.new(:
|
24
|
-
Snmpjr::Response.new(:
|
23
|
+
let(:expected) { [Snmpjr::Response.new(error: 'noSuchInstance'),
|
24
|
+
Snmpjr::Response.new(value: 'zeus.snmplabs.com')] }
|
25
25
|
|
26
|
-
it
|
26
|
+
it 'returns an error' do
|
27
27
|
expect(subject.get ['1.3.6.1.2.1.1.5', '1.3.6.1.2.1.1.5.0']).to eq expected
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context 'when the host is unreachable' do
|
33
|
-
subject { Snmpjr.new(:
|
33
|
+
subject { Snmpjr.new(host: 'example.com', port: 161, community: 'public', timeout: 50) }
|
34
34
|
|
35
|
-
it
|
35
|
+
it 'the request times out after 5 seconds' do
|
36
36
|
expect{
|
37
37
|
subject.get '1.3.6.1.2.1.1.1.0'
|
38
38
|
}.to raise_error(Snmpjr::TargetTimeoutError)
|
data/spec/snmpjr/getter_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Snmpjr::Getter do
|
|
6
6
|
let(:pdu) { double Snmpjr::Pdu }
|
7
7
|
let(:created_pdu_single) { double :created_pdu_single }
|
8
8
|
|
9
|
-
subject { described_class.new(:
|
9
|
+
subject { described_class.new(target: target, max_oids_per_request: 1) }
|
10
10
|
|
11
11
|
before do
|
12
12
|
allow(Snmpjr::Pdu).to receive(:new).and_return pdu
|
@@ -17,7 +17,7 @@ describe Snmpjr::Getter do
|
|
17
17
|
allow(session).to receive(:close)
|
18
18
|
end
|
19
19
|
|
20
|
-
describe
|
20
|
+
describe '#get_multiple' do
|
21
21
|
let(:created_pdu_multiple_1) { double :created_pdu_multiple_1 }
|
22
22
|
let(:created_pdu_multiple_2) { double :created_pdu_multiple_2 }
|
23
23
|
|
@@ -45,7 +45,7 @@ describe Snmpjr::Getter do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe
|
48
|
+
describe '#get' do
|
49
49
|
it 'starts an snmp session' do
|
50
50
|
subject.get '1.2.3.4.5.6'
|
51
51
|
expect(session).to have_received(:start)
|
data/spec/snmpjr/pdu_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require production_code
|
2
2
|
|
3
3
|
describe Snmpjr::Pdu do
|
4
|
-
describe
|
4
|
+
describe '#create' do
|
5
5
|
|
6
6
|
let(:pdu) { double Snmpjr::Wrappers::PDU }
|
7
7
|
let(:oid_1) { double Snmpjr::Wrappers::SMI::OID }
|
@@ -18,12 +18,12 @@ describe Snmpjr::Pdu do
|
|
18
18
|
allow(pdu).to receive(:type=)
|
19
19
|
allow(pdu).to receive(:add)
|
20
20
|
end
|
21
|
-
it
|
21
|
+
it 'creates a GET Pdu' do
|
22
22
|
expect(pdu).to receive(:type=).with(Snmpjr::Pdu::Constants::GET)
|
23
23
|
subject.create ['1.2.3.4']
|
24
24
|
end
|
25
25
|
|
26
|
-
it
|
26
|
+
it 'adds an SMI variable binding containing an oid to the pdu' do
|
27
27
|
expect(pdu).to receive(:add).with variable_binding_1
|
28
28
|
expect(pdu).to receive(:add).with variable_binding_2
|
29
29
|
subject.create ['1.2.3.4', '5.6.7.8']
|
@@ -5,24 +5,24 @@ describe Snmpjr::Response do
|
|
5
5
|
describe '.new' do
|
6
6
|
context 'when initialized with a value' do
|
7
7
|
it 'assigns that value' do
|
8
|
-
response = described_class.new(:
|
8
|
+
response = described_class.new(value: 'Some value')
|
9
9
|
expect(response.to_s).to eq 'Some value'
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'sets the error to an empty string' do
|
13
|
-
response = described_class.new(:
|
13
|
+
response = described_class.new(value: 'Some value')
|
14
14
|
expect(response.error).to eq ''
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'when initialized with an error' do
|
19
19
|
it 'assigns that error' do
|
20
|
-
response = described_class.new(:
|
20
|
+
response = described_class.new(error: 'Some error')
|
21
21
|
expect(response.error).to eq 'Some error'
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'sets the value to an empty string' do
|
25
|
-
response = described_class.new(:
|
25
|
+
response = described_class.new(error: 'Some error')
|
26
26
|
expect(response.to_s).to eq ''
|
27
27
|
end
|
28
28
|
end
|
@@ -30,28 +30,28 @@ describe Snmpjr::Response do
|
|
30
30
|
|
31
31
|
describe '#error?' do
|
32
32
|
it 'returns true if there is an error' do
|
33
|
-
response = described_class.new(:
|
33
|
+
response = described_class.new(error: 'Some error')
|
34
34
|
expect(response.error?).to be_truthy
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'returns false if there isnt an error' do
|
38
|
-
response = described_class.new(:
|
38
|
+
response = described_class.new(value: 'Some value')
|
39
39
|
expect(response.error?).to be_falsey
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
describe '#==' do
|
44
44
|
context 'when the objects are equal' do
|
45
|
-
let(:other) { Snmpjr::Response.new(:
|
45
|
+
let(:other) { Snmpjr::Response.new(value: 'some value') }
|
46
46
|
it 'returns true' do
|
47
|
-
expect(described_class.new(:
|
47
|
+
expect(described_class.new(value: 'some value')).to eq other
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
context 'when the objects are not equal' do
|
52
|
-
let(:other) { Snmpjr::Response.new(:
|
52
|
+
let(:other) { Snmpjr::Response.new(error: 'some value') }
|
53
53
|
it 'returns true' do
|
54
|
-
expect(described_class.new(:
|
54
|
+
expect(described_class.new(error: 'some error')).to_not eq other
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
data/spec/snmpjr/session_spec.rb
CHANGED
@@ -13,21 +13,21 @@ describe Snmpjr::Session do
|
|
13
13
|
allow(snmp_session).to receive(:close)
|
14
14
|
end
|
15
15
|
|
16
|
-
describe
|
16
|
+
describe '#start' do
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'opens a new SNMP4J session with Udp transport mapping' do
|
19
19
|
subject.start
|
20
20
|
expect(Snmpjr::Wrappers::Snmp).to have_received(:new).with(transport_mapping)
|
21
21
|
end
|
22
22
|
|
23
|
-
it
|
23
|
+
it 'calls the listen method on the Snmp session' do
|
24
24
|
subject.start
|
25
25
|
expect(snmp_session).to have_received(:listen)
|
26
26
|
end
|
27
27
|
|
28
28
|
end
|
29
29
|
|
30
|
-
describe
|
30
|
+
describe '#send' do
|
31
31
|
let(:vb1) { double :vb1 }
|
32
32
|
let(:vb2) { double :vb2 }
|
33
33
|
let(:results) { [vb1, vb2] }
|
@@ -44,7 +44,7 @@ describe Snmpjr::Session do
|
|
44
44
|
allow(response).to receive_message_chain('response.variable_bindings').and_return(results)
|
45
45
|
end
|
46
46
|
|
47
|
-
it
|
47
|
+
it 'sends the pdu to the target' do
|
48
48
|
expect(snmp_session).to receive(:send).with(pdu, target)
|
49
49
|
subject.send(pdu, target)
|
50
50
|
end
|
@@ -74,8 +74,8 @@ describe Snmpjr::Session do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
describe
|
78
|
-
it
|
77
|
+
describe '#close' do
|
78
|
+
it 'closes the snmp session' do
|
79
79
|
subject.close
|
80
80
|
expect(snmp_session).to have_received(:close)
|
81
81
|
end
|
data/spec/snmpjr/target_spec.rb
CHANGED
@@ -2,15 +2,15 @@ require production_code
|
|
2
2
|
|
3
3
|
describe Snmpjr::Target do
|
4
4
|
|
5
|
-
describe
|
6
|
-
let(:options) { { :
|
5
|
+
describe '#create' do
|
6
|
+
let(:options) { { host: '127.0.0.1', port: 161, community: 'some_community', timeout: 50, retries: 2 } }
|
7
7
|
|
8
|
-
it
|
8
|
+
it 'creates an octet string for the community string' do
|
9
9
|
expect(Snmpjr::Wrappers::SMI::OctetString).to receive(:new).with(options[:community])
|
10
10
|
subject.create(options)
|
11
11
|
end
|
12
12
|
|
13
|
-
it
|
13
|
+
it 'creates an smi address based on the ip and port name' do
|
14
14
|
expect(Snmpjr::Wrappers::SMI::GenericAddress).to receive(:parse).with("udp:127.0.0.1/161")
|
15
15
|
subject.create(options)
|
16
16
|
end
|
@@ -23,15 +23,17 @@ describe Snmpjr::Target do
|
|
23
23
|
allow(community_target).to receive(:timeout=)
|
24
24
|
allow(community_target).to receive(:community=)
|
25
25
|
allow(community_target).to receive(:address=)
|
26
|
+
allow(community_target).to receive(:retries=)
|
26
27
|
end
|
27
28
|
|
28
|
-
it
|
29
|
+
it 'sets the snmp version to v2c and the timeout to 50ms' do
|
29
30
|
expect(community_target).to receive(:version=).with(1)
|
30
31
|
expect(community_target).to receive(:timeout=).with(50)
|
32
|
+
expect(community_target).to receive(:retries=).with(2)
|
31
33
|
subject.create(options)
|
32
34
|
end
|
33
35
|
|
34
|
-
it
|
36
|
+
it 'returns the SNMP4J community target' do
|
35
37
|
expect(subject.create(options).class).to eq community_target.class
|
36
38
|
end
|
37
39
|
end
|
data/spec/snmpjr_spec.rb
CHANGED
@@ -11,12 +11,12 @@ describe Snmpjr do
|
|
11
11
|
before do
|
12
12
|
allow(Snmpjr::Target).to receive(:new).and_return target
|
13
13
|
allow(target).to receive(:create).with(agent_details).and_return community_target
|
14
|
-
allow(Snmpjr::Getter).to receive(:new).with(:
|
14
|
+
allow(Snmpjr::Getter).to receive(:new).with(target: community_target, max_oids_per_request: 20).and_return getter
|
15
15
|
end
|
16
16
|
|
17
|
-
let(:agent_details) { { :
|
17
|
+
let(:agent_details) { { host: '127.0.0.1', port: 161, community: 'some_community', timeout: 50, retries: 50 } }
|
18
18
|
|
19
|
-
subject { described_class.new(agent_details.merge({:
|
19
|
+
subject { described_class.new(agent_details.merge({max_oids_per_request: 20})) }
|
20
20
|
|
21
21
|
context 'when passed a single oid' do
|
22
22
|
it 'performs a synchronous get' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,27 @@
|
|
1
1
|
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
require 'codeclimate-test-reporter'
|
2
4
|
require 'pry'
|
3
5
|
|
6
|
+
CodeClimate::TestReporter.configure do |config|
|
7
|
+
config.logger.level = Logger::WARN
|
8
|
+
end
|
9
|
+
|
10
|
+
formatters = [
|
11
|
+
SimpleCov::Formatter::HTMLFormatter,
|
12
|
+
Coveralls::SimpleCov::Formatter
|
13
|
+
]
|
14
|
+
|
15
|
+
if ENV['CODECLIMATE_REPO_TOKEN']
|
16
|
+
formatters << CodeClimate::TestReporter::Formatter
|
17
|
+
end
|
18
|
+
|
19
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
|
4
20
|
SimpleCov.coverage_dir 'log/coverage/rspec'
|
5
|
-
SimpleCov.
|
6
|
-
|
7
|
-
|
21
|
+
SimpleCov.start do
|
22
|
+
add_filter 'vendor'
|
23
|
+
add_filter 'spec'
|
24
|
+
end
|
8
25
|
|
9
26
|
def production_code
|
10
27
|
spec = caller[0][/spec.+\.rb/]
|
metadata
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snmpjr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Zen Kyprianou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
|
16
|
-
'
|
13
|
+
description: Snmpjr aims to provide a clean and simple interface to use SNMP in your
|
14
|
+
ruby code. It will wrap the popular SNMP4J library in Java.
|
17
15
|
email:
|
18
16
|
- zen@kyprianou.eu
|
19
17
|
executables: []
|
@@ -22,6 +20,7 @@ extra_rdoc_files: []
|
|
22
20
|
files:
|
23
21
|
- .gitignore
|
24
22
|
- .rspec
|
23
|
+
- .rubocop.yml
|
25
24
|
- .rvmrc
|
26
25
|
- .travis.yml
|
27
26
|
- Gemfile
|