From ee3056aad267c324b823eb237acf2bad38d228db Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Mon, 10 Sep 2018 21:50:03 +0900 Subject: [PATCH] refactor: auto-correct by rubocop --- lib/ryo/error.rb | 4 ++-- lib/ryo/plugin/dir.rb | 1 - lib/ryo/plugin/shodan.rb | 8 +++----- lib/ryo/plugin/whois.rb | 4 +++- spec/plugin/shodan_spec.rb | 2 +- spec/plugin/subdomain/dnsdumpster_spec.rb | 1 + spec/plugin/subdomain/subdomain_spec.rb | 2 ++ 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/ryo/error.rb b/lib/ryo/error.rb index cdd0bf6..d21f0b8 100644 --- a/lib/ryo/error.rb +++ b/lib/ryo/error.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Ryo - class NotFoundError < StandardError; end - class InvalidURLError < StandardError; end class InvalidOptionsError < StandardError; end + class InvalidURLError < StandardError; end + class NotFoundError < StandardError; end end diff --git a/lib/ryo/plugin/dir.rb b/lib/ryo/plugin/dir.rb index 86f46d3..826acbc 100644 --- a/lib/ryo/plugin/dir.rb +++ b/lib/ryo/plugin/dir.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require "thread" require "thread/pool" module Ryo diff --git a/lib/ryo/plugin/shodan.rb b/lib/ryo/plugin/shodan.rb index 24919f7..f4311f8 100644 --- a/lib/ryo/plugin/shodan.rb +++ b/lib/ryo/plugin/shodan.rb @@ -16,11 +16,9 @@ def discover(ip) end def self.discover(ip) - begin - new.discover(ip) - rescue ArgumentError => e - { error: e.to_s } - end + new.discover(ip) + rescue ArgumentError => e + { error: e.to_s } end end end diff --git a/lib/ryo/plugin/whois.rb b/lib/ryo/plugin/whois.rb index 4794376..37f755e 100644 --- a/lib/ryo/plugin/whois.rb +++ b/lib/ryo/plugin/whois.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Ryo module Plugin class Whois @@ -61,4 +63,4 @@ def self.discover(domain) end end end -end \ No newline at end of file +end diff --git a/spec/plugin/shodan_spec.rb b/spec/plugin/shodan_spec.rb index eaa0aa7..45126e0 100644 --- a/spec/plugin/shodan_spec.rb +++ b/spec/plugin/shodan_spec.rb @@ -22,4 +22,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/plugin/subdomain/dnsdumpster_spec.rb b/spec/plugin/subdomain/dnsdumpster_spec.rb index e1db09a..0a019ae 100644 --- a/spec/plugin/subdomain/dnsdumpster_spec.rb +++ b/spec/plugin/subdomain/dnsdumpster_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Ryo::Plugin::Subdomain::DNSDumpster, :vcr do subject { Ryo::Plugin::Subdomain::DNSDumpster } diff --git a/spec/plugin/subdomain/subdomain_spec.rb b/spec/plugin/subdomain/subdomain_spec.rb index bd3eee7..73ae847 100644 --- a/spec/plugin/subdomain/subdomain_spec.rb +++ b/spec/plugin/subdomain/subdomain_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe Ryo::Plugin::Subdomain, :vcr do subject { Ryo::Plugin::Subdomain } describe "#discover" do