sonar-client 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: bfc392531d73c07dc38bdd9c2064d64ced271455
4
- data.tar.gz: c59580c7f121c73586310e04623839cf3e2a0e7a
3
+ metadata.gz: 15839192f17588137b628922b797277e51fe1a4a
4
+ data.tar.gz: 952a6e55b998608df85d565e5d6bda643e09b2dd
5
5
  SHA512:
6
- metadata.gz: a793b6cbe98628a1bf4414bdea5ec24c4f06adcf3d4b4a9066be491b241847b5adbcc0f2b37d8408bd1179cbe47b22e78f27315c99879d8e3422391edc717ccb
7
- data.tar.gz: 8bb3e13a7914179f2a3ce8558419e782492bf84d9d8fe09e0cde218d034dfbc2d73399808ae4769140353331f48bba65c3b1e10908f3e6716a6ca07dd2cf9b6f
6
+ metadata.gz: 367276131352b48040143cd3b7d5894475fda23c2020fd28efa56452a92af79e89b8f84830ae9132d44ca1ea26c3d2f3d3eb6d7f9bec91f6e28d80faebcc41c5
7
+ data.tar.gz: aaf7ac557f0f5622ee9a5c3e46db451b63e3470fd1279b712da2669fea2af75fcab91ac892c43855ad416a86728e1a5e870c2935e50cfed06932c657858c71d1
data/README.md CHANGED
@@ -50,6 +50,19 @@ And then execute:
50
50
  # => responds with a Hashie object
51
51
  ```
52
52
 
53
+ ## Running the specs
54
+
55
+ Until they're mocked, specs are run against a live API, either production, staging, or localhost (development). The config in `spec/spec_helper.rb` requires several credentials to be set as environment variables to make requests. Consider adding this to your `~/.bashrc` or export the variables before running the specs:
56
+
57
+ ```
58
+ # Sonar config
59
+ export SONAR_TOKEN=asldkstokenalskdjf
60
+ export SONAR_API_URL=http://sonar-staging.labs.rapid7.com/
61
+ export SONAR_EMAIL=youremail@example.com
62
+ ```
63
+
64
+ Once you have the variables set, `rspec spec` will run all the specs.
65
+
53
66
  ## CLI dev setup
54
67
 
55
68
  From the project root directory
data/lib/sonar/cli/cli.rb CHANGED
@@ -28,7 +28,7 @@ module Sonar
28
28
 
29
29
  desc 'search [QUERY TYPE] [QUERY TERM]', 'Search anything from Sonars'
30
30
  method_option 'record_limit', type: :numeric, aliases: '-n', desc: 'Maximum number of records to fetch'
31
- method_option 'exact', type: :boolean, aliases: '-e', desc: 'Search for the query string exactly, do not including partial string matches'
31
+ method_option 'exact', type: :boolean, aliases: '-e', desc: 'Search for the query string exactly, do not include partial string matches'
32
32
 
33
33
  def search(type, term)
34
34
  @query = {}
data/lib/sonar/request.rb CHANGED
@@ -58,6 +58,7 @@ module Sonar
58
58
  more = resp['more']
59
59
  yield resp
60
60
  end
61
+ params.delete(:iterator_id)
61
62
  end
62
63
  end
63
64
  end
data/lib/sonar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sonar
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -98,7 +98,7 @@ describe Sonar::Search do
98
98
  let(:resp) { client.search(fdns: '208.118.227.10') }
99
99
 
100
100
  it "finds fdnsip rapid7.com at 208.118.227.10" do
101
- expect(resp['collection'].any? { |x| x['address'] =~ 'rapid7' }).to be(true)
101
+ expect(resp['collection'].any? { |x| x['address'].match('rapid7') }).to be(true)
102
102
  end
103
103
  end
104
104
 
@@ -155,7 +155,7 @@ describe Sonar::Search do
155
155
  context "whois_ip" do
156
156
  let(:resp) { client.search(whois_ip: '208.118.227.10') }
157
157
 
158
- it "should find rapid7.com" do
158
+ xit "should find rapid7.com" do
159
159
  expect(resp['name']).to eq('TWDX-208-118-227-0-1')
160
160
  end
161
161
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Deardorff & HD Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-15 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware