From 975e14e22188ac0d79e1c288850e5466fa6f52a6 Mon Sep 17 00:00:00 2001 From: Florian Wininger Date: Tue, 12 Dec 2017 15:39:19 +0100 Subject: [PATCH] Update dependencies Signed-off-by: Florian Wininger --- Gemfile.lock | 33 +++++++++------------------------ lib/openvas.rb | 2 +- lib/openvas/client.rb | 8 ++------ lib/openvas/config.rb | 2 +- openvas.gemspec | 12 +++++------- 5 files changed, 18 insertions(+), 39 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 07ce112..1481b86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,13 +2,11 @@ PATH remote: . specs: openvas (0.1.0) - nokogiri + nokogiri (~> 1.8) GEM remote: https://rubygems.org/ specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) ast (2.3.0) coveralls (0.8.21) json (>= 1.8, < 3) @@ -16,11 +14,8 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crack (0.4.3) - safe_yaml (~> 1.0.0) diff-lcs (1.3) docile (1.1.5) - hashdiff (0.3.7) json (2.1.0) mini_portile2 (2.3.0) nokogiri (1.8.1) @@ -29,9 +24,7 @@ GEM parser (2.4.0.2) ast (~> 2.3) powerpack (0.1.1) - public_suffix (3.0.1) - rainbow (2.2.2) - rake + rainbow (3.0.0) rake (12.3.0) rspec (3.7.0) rspec-core (~> 3.7.0) @@ -46,15 +39,14 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-support (3.7.0) - rubocop (0.51.0) + rubocop (0.52.0) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) + parser (>= 2.4.0.2, < 3.0) powerpack (~> 0.1) - rainbow (>= 2.2.2, < 3.0) + rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.9.0) - safe_yaml (1.0.4) simplecov (0.14.1) docile (~> 1.1.0) json (>= 1.8, < 3) @@ -65,24 +57,17 @@ GEM thor (0.19.4) tins (1.16.3) unicode-display_width (1.3.0) - vcr (4.0.0) - webmock (3.1.1) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff PLATFORMS ruby DEPENDENCIES - bundler + bundler (~> 1.16) coveralls openvas! - rake - rspec - rubocop - vcr - webmock + rake (~> 12.3) + rspec (~> 3.7) + rubocop (~> 0.52) BUNDLED WITH 1.16.0 diff --git a/lib/openvas.rb b/lib/openvas.rb index 0d313d9..a31d167 100644 --- a/lib/openvas.rb +++ b/lib/openvas.rb @@ -11,7 +11,7 @@ require 'openvas/results' module Openvas - extend self + module_function def configure block_given? ? yield(Config) : Config diff --git a/lib/openvas/client.rb b/lib/openvas/client.rb index 69ebb6f..bfa4de6 100644 --- a/lib/openvas/client.rb +++ b/lib/openvas/client.rb @@ -15,9 +15,7 @@ class QueryError < StandardError; end # Connect the websocket def self.connect # Retrieve URI - unless Openvas::Config.url - raise InvalidUrlConfigError, 'Please Configure the client before' - end + raise InvalidUrlConfigError, 'Please Configure the client before' unless Openvas::Config.url uri = URI.parse(Openvas::Config.url) @@ -45,9 +43,7 @@ def self.version def self.query(data) res = Nokogiri::XML(send_receive(data.to_xml)) - unless res.at_xpath('//@status')&.value == '200' - raise QueryError 'Unknown query error' - end + raise QueryError 'Unknown query error' unless res.at_xpath('//@status')&.value == '200' res end diff --git a/lib/openvas/config.rb b/lib/openvas/config.rb index 132f779..1476a8d 100644 --- a/lib/openvas/config.rb +++ b/lib/openvas/config.rb @@ -3,7 +3,7 @@ module Openvas module Config class RequiredOptionMissing < RuntimeError; end - extend self + module_function attr_accessor :url, :username, :password, :socket end diff --git a/openvas.gemspec b/openvas.gemspec index b315c51..0e9fc4d 100644 --- a/openvas.gemspec +++ b/openvas.gemspec @@ -21,12 +21,10 @@ Gem::Specification.new do |s| # s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } s.test_files = s.files.grep(%r{^(test|spec|features)/}) - s.add_dependency 'nokogiri' + s.add_dependency 'nokogiri', '~> 1.8' - s.add_development_dependency 'bundler' - s.add_development_dependency 'rake' - s.add_development_dependency 'rspec' - s.add_development_dependency 'rubocop' - s.add_development_dependency 'vcr' - s.add_development_dependency 'webmock' + s.add_development_dependency 'bundler', '~> 1.16' + s.add_development_dependency 'rake', '~> 12.3' + s.add_development_dependency 'rspec', '~> 3.7' + s.add_development_dependency 'rubocop', '~> 0.52' end