crtsh-rb 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 20e1011ca10e2d2097d84f74c840e9b79f6ba8d0cf200a4692be6741e35ae280
4
- data.tar.gz: 501a854121373a81c240f26a3b825a6b1c29f0ce7ee180d76ab6757728383132
3
+ metadata.gz: 851220e9259aba8b67dcfe938576be29696f3b14fc10df074017bd31d7db030c
4
+ data.tar.gz: eadf856be0b928cc1eb7f119017e28bfe83206fd0ecdb35cd43ef4de9c04ff78
5
5
  SHA512:
6
- metadata.gz: d5b76ad996acd0ddbab11b281409c6abe7676336726a5efd7a8872d47c95d0c08673d13caeb2d7206785a589980edf063a774a227aafc64a20fdb57b18614221
7
- data.tar.gz: 29c0713417bd170f91b458911599ab0cb466a21d5592f3adc127fb63118497ae74ece4941e1813118b93f0aecbb5acfb8e001a721a45aa3528455d4df4d72a4d
6
+ metadata.gz: 91f8029021e4c63b2aea186d21645563d51211ed7c1aebf34f9e197c54cd53dcc3532ab39117926e9471b5bf71823a04dc6f357f3614fedc8a77ba98ac165824
7
+ data.tar.gz: 2d625457a6048deb60bdd9a9b95890a713b8c4064a262023ca8f1292a61b348866aa19de7015cad6000719fca9ae956ba2b94f22b28196d12a896e08012d3f37
@@ -4,4 +4,4 @@ language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
6
  - 2.6
7
- before_install: gem install bundler -v 2.0.2
7
+ before_install: gem install bundler -v 2.1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # crtsh
2
2
 
3
- [![Build Status](https://travis-ci.org/ninoseki/crtsh.svg?branch=master)](https://travis-ci.org/ninoseki/crtsh)
3
+ [![Build Status](https://travis-ci.com/ninoseki/crtsh.svg?branch=master)](https://travis-ci.com/ninoseki/crtsh)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/ninoseki/crtsh/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/crtsh?branch=master)
5
5
  [![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/crtsh/badge)](https://www.codefactor.io/repository/github/ninoseki/crtsh)
6
6
 
@@ -18,7 +18,10 @@ gem install crtsh-rb
18
18
  require "crtsh"
19
19
 
20
20
  api = Crtsh::API.new
21
- res = api.search("crt.sh")
21
+ api.search("crt.sh")
22
+ api.search("crt.sh", match: "LIKE")
23
+ api.search("crt.sh", exclude: "expired")
24
+ api.search("crt.sh", match: "LIKE", exclude: "expired")
22
25
  ```
23
26
 
24
27
  ## Contributing
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ["Manabu Niseki"]
11
11
  spec.email = ["manabu.niseki@gmail.com"]
12
12
 
13
- spec.summary = "crt.sh API client for Ruby"
14
- spec.description = "crt.sh API client for Ruby"
13
+ spec.summary = "crt.sh API wrapper for Ruby"
14
+ spec.description = "crt.sh API wrapper for Ruby"
15
15
  spec.homepage = "https://github.com/ninoseki/crtsh"
16
16
  spec.license = "MIT"
17
17
 
@@ -24,10 +24,10 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
26
 
27
- spec.add_development_dependency "bundler", "~> 2.0"
27
+ spec.add_development_dependency "bundler", "~> 2.1"
28
28
  spec.add_development_dependency "coveralls", "~> 0.8"
29
- spec.add_development_dependency "rake", "~> 12.3"
30
- spec.add_development_dependency "rspec", "~> 3.8"
29
+ spec.add_development_dependency "rake", "~> 13.0"
30
+ spec.add_development_dependency "rspec", "~> 3.9"
31
31
  spec.add_development_dependency "vcr", "~> 5.0"
32
32
  spec.add_development_dependency "webmock", "~> 3.7"
33
33
  end
@@ -9,8 +9,23 @@ module Crtsh
9
9
  HOST = "crt.sh"
10
10
  BASE_URL = "https://#{HOST}"
11
11
 
12
- def search(query)
13
- get("/", q: query, output: "json") { |json| json }
12
+ #
13
+ # Search crt.sh by a given identity
14
+ #
15
+ # @param [String] identity
16
+ # @param [String, nil] match "=", "ILIKE", "LIKE", "single", "any" or nil
17
+ # @param [String, nil] exclude "expired" or nil
18
+ #
19
+ # @return [Hash]
20
+ #
21
+ def search(identity, match: nil, exclude: nil)
22
+ params = {
23
+ identity: identity,
24
+ match: match,
25
+ exclude: exclude,
26
+ output: "json",
27
+ }.compact
28
+ get("/", params) { |json| json }
14
29
  end
15
30
 
16
31
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crtsh
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crtsh-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.3'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '12.3'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.8'
61
+ version: '3.9'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.8'
68
+ version: '3.9'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: vcr
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.7'
97
- description: crt.sh API client for Ruby
97
+ description: crt.sh API wrapper for Ruby
98
98
  email:
99
99
  - manabu.niseki@gmail.com
100
100
  executables: []
@@ -131,8 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.0.4
134
+ rubygems_version: 3.0.3
135
135
  signing_key:
136
136
  specification_version: 4
137
- summary: crt.sh API client for Ruby
137
+ summary: crt.sh API wrapper for Ruby
138
138
  test_files: []