Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some stuff #84

Merged
merged 5 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@ updates:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: async-http
versions:
- 0.55.0
- dependency-name: pry
versions:
- 0.14.0
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.2'
bundler-cache: true
- name: RSpec
env:
Expand Down
4 changes: 2 additions & 2 deletions lib/shodanz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

require 'json'
require 'async'
require 'console'
require 'async/http/internet'
require 'shodanz/version'
require 'shodanz/errors'
require 'shodanz/api'
require 'shodanz/client'

# disable async logs by default
Async.logger.level = 4
Console.logger.level = 4

# Shodanz is a modern Ruby gem for Shodan, the world's
# first search engine for Internet-connected devices.
Expand Down
12 changes: 6 additions & 6 deletions shodanz.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ['lib']

spec.add_dependency 'async-http', '>= 0.38.1', '< 0.57.0'
spec.add_dependency 'async', '>= 1.17.1', '< 2.1.0'
spec.add_dependency 'async-http', '>= 0.38.1', '< 0.62.0'
spec.add_dependency 'async', '>= 1.17.1', '< 2.7.0'

spec.add_development_dependency 'async-rspec', '~> 1.16.1'
spec.add_development_dependency 'bundler', '~> 2.2.0'
spec.add_development_dependency 'async-rspec', '~> 1.17.0'
spec.add_development_dependency 'bundler', '~> 2.4.0'
spec.add_development_dependency 'pry', '~> 0.14.1'
spec.add_development_dependency 'rake', '~> 13.0.0'
spec.add_development_dependency 'rake', '~> 13.1.0'
spec.add_development_dependency 'rb-readline', '~> 0.5.5'
spec.add_development_dependency 'rspec', '~> 3.11.0'
spec.add_development_dependency 'rspec', '~> 3.12.0'
end
22 changes: 5 additions & 17 deletions spec/exploits_api_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require "spec_helper"

RSpec.describe Shodanz::API::Exploits do
include_context Async::RSpec::Reactor

before do
@client = Shodanz.api.exploits.new
end
Expand All @@ -11,24 +13,10 @@
end

describe '#search' do
def check
if Async::Task.current?
it 'should search across a variety of data sources for exploits' do
reactor.async do
resp = @client.search("SQL", port: 443).wait
else
resp = @client.search("SQL", port: 443)
end
expect(resp).to be_a(Hash)
end

describe 'search across a variety of data sources for exploits' do
it 'works synchronously' do
check
end

it 'works asynchronously' do
Async do
check
end
expect(resp).to be_a(Hash)
end
end
end
Expand Down
Loading