lita-onewheel-cve 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +10 -0
- data/.travis.yml +3 -4
- data/CONTRIBUTING.md +9 -0
- data/Gemfile +1 -1
- data/LICENSE +19 -0
- data/README.rst +32 -12
- data/Rakefile +3 -1
- data/lib/lita/handlers/onewheel_cve.rb +13 -2
- data/lib/lita-onewheel-cve.rb +1 -1
- data/lita-onewheel-cve.gemspec +6 -5
- data/spec/lita/handlers/onewheel_cve_spec.rb +3 -4
- data/spec/spec_helper.rb +17 -2
- metadata +44 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d158aeb9d1b922c42e1968b6ef4c48df35e69f94
|
4
|
+
data.tar.gz: 5bc0cadadd0a0dec07b3793840c355840d152b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8615408c8d014d74e5e3dc25d42e6b7015ad54e885737b141db877f5faca3473bebaf06e7bb172469b0f153276821568e30ce4c74625bf8721f64682666e6c67
|
7
|
+
data.tar.gz: 7dc1b3e3e44cb08a5290fe0c6b4d9c80c9f518d3475bf6c6050c3714da424b9e286ff6aadf63048d295affa0010e1befd882e3de7c9c1cf0aaf9ad0fe53f4e7a
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color --profile 5
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
Pull requests are awesome! Pull requests with tests are even more awesome!
|
2
|
+
|
3
|
+
## Quick steps
|
4
|
+
|
5
|
+
1. Fork the repo.
|
6
|
+
2. Run the tests: `bundle && rake`
|
7
|
+
3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, it needs a test!
|
8
|
+
4. Make the test pass.
|
9
|
+
5. Push to your fork and submit a pull request.
|
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2016 Andrew Kreps
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.rst
CHANGED
@@ -1,21 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
lita-onewheel-cve
|
2
|
+
----
|
3
|
+
|buildstatus|
|
4
|
+
|coveragestatus|
|
5
|
+
|license|
|
6
|
+
|rubygems|
|
7
|
+
|codeclimate|
|
8
|
+
|gemnasium|
|
9
|
+
|
10
|
+
.. |buildstatus| image:: https://travis-ci.org/onewheelskyward/lita-onewheel-cve.svg?branch=master
|
11
|
+
:target: https://travis-ci.org/onewheelskyward/lita-onewheel-cve
|
12
|
+
.. |coveragestatus| image:: https://coveralls.io/repos/github/onewheelskyward/lita-onewheel-cve/badge.svg?branch=master
|
13
|
+
:target: https://coveralls.io/github/onewheelskyward/lita-onewheel-cve?branch=master
|
14
|
+
.. |license| image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
|
15
|
+
:target: https://tldrlegal.com/license/mit-license
|
16
|
+
.. |rubygems| image:: http://img.shields.io/gem/v/lita-onewheel-cve.svg
|
17
|
+
:target: https://rubygems.org/gems/lita-onewheel-cve
|
18
|
+
.. |codeclimate| image:: https://img.shields.io/codeclimate/github/onewheelskyward/lita-onewheel-cve.svg
|
19
|
+
:target: https://codeclimate.com/github/onewheelskyward/lita-onewheel-cve
|
20
|
+
.. |gemnasium| image:: https://img.shields.io/gemnasium/onewheelskyward/lita-onewheel-cve.svg
|
21
|
+
:target: https://gemnasium.com/onewheelskyward/lita-onewheel-cve
|
5
22
|
|
6
23
|
Puts out links to CVEs when they're posted in chat.
|
7
24
|
|
8
|
-
|
25
|
+
Configuration
|
26
|
+
----
|
27
|
+
Optionally, override the default CVE search URL in your Lita configuration:
|
9
28
|
|
10
|
-
|
29
|
+
``config.handlers.onewheel_cve.search_url = 'http://example.com/cve?id='``
|
11
30
|
|
12
|
-
|
13
|
-
|
14
|
-
|
31
|
+
Installation
|
32
|
+
----
|
33
|
+
Add lita-onewheel-cve to your Lita instance's Gemfile:
|
15
34
|
|
16
|
-
|
35
|
+
``gem 'lita-onewheel-cve'``
|
17
36
|
|
18
|
-
|
37
|
+
Usage
|
38
|
+
----
|
39
|
+
When someone mentions 'CVE-1234-1234' it'll post a link to ``http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=1234-1234``.
|
19
40
|
|
20
41
|
That's all, folks!
|
21
|
-
|
data/Rakefile
CHANGED
@@ -1,11 +1,22 @@
|
|
1
1
|
module Lita
|
2
2
|
module Handlers
|
3
3
|
class OnewheelCve < Handler
|
4
|
-
|
4
|
+
config :search_url, default: 'http://www.cve.mitre.org/cgi-bin/cvename.cgi?name='
|
5
|
+
|
6
|
+
route(
|
7
|
+
/(\s|^)cve-(?<id>\d{4}-\d{4})/i,
|
8
|
+
:handle_cve,
|
9
|
+
help: {
|
10
|
+
'text including cve-1234-1234' => 'Will return a link to cve.mitre.org.'
|
11
|
+
}
|
12
|
+
)
|
5
13
|
|
6
14
|
def handle_cve(response)
|
7
|
-
|
15
|
+
id = response.match_data['id']
|
16
|
+
url = config.search_url + id
|
17
|
+
response.reply url
|
8
18
|
end
|
19
|
+
|
9
20
|
Lita.register_handler(self)
|
10
21
|
end
|
11
22
|
end
|
data/lib/lita-onewheel-cve.rb
CHANGED
data/lita-onewheel-cve.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-cve'
|
3
|
-
spec.version = '0.
|
3
|
+
spec.version = '0.1.0'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'CVE decoder to pull the root link from a CVE posted in chat.'
|
7
|
-
spec.summary =
|
7
|
+
spec.summary = spec.description
|
8
8
|
spec.homepage = 'https://github.com/onewheelskyward/lita-onewheel-cve'
|
9
9
|
spec.license = 'MIT'
|
10
10
|
spec.metadata = { 'lita_plugin_type' => 'handler' }
|
11
11
|
|
12
|
-
spec.files = `git ls-files`.split(
|
12
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
13
13
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
14
14
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
15
|
spec.require_paths = ['lib']
|
@@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.add_runtime_dependency 'lita', '~> 4.7'
|
18
18
|
|
19
19
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
20
|
-
|
20
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
21
|
+
spec.add_development_dependency 'pry-byebug'
|
21
22
|
spec.add_development_dependency 'rake', '~> 10.4'
|
22
23
|
spec.add_development_dependency 'rack-test', '~> 0.6'
|
23
24
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
25
|
+
spec.add_development_dependency 'rubocop'
|
24
26
|
spec.add_development_dependency 'simplecov', '~> 0.11'
|
25
|
-
spec.add_development_dependency 'coveralls', '~> 0.8'
|
26
27
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Lita::Handlers::OnewheelCve, lita_handler: true do
|
4
|
-
it { is_expected.to route(' cve-2015-1234 ') }
|
5
|
-
it { is_expected.to_not route(' cve-12-12 ') }
|
6
|
-
it { is_expected.to_not route('
|
4
|
+
it { is_expected.to route(' cve-2015-1234 ').to(:handle_cve) }
|
5
|
+
it { is_expected.to_not route(' cve-12-12 ').to(:handle_cve) }
|
6
|
+
it { is_expected.to_not route('http://example.com/cve-2015-1234').to(:handle_cve) }
|
7
7
|
|
8
8
|
it 'will return a cve link to the thing' do
|
9
9
|
send_message 'oh man cve-2015-1234 is so awesome'
|
10
|
-
puts replies.last
|
11
10
|
expect(replies.last).to eq('http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2015-1234')
|
12
11
|
end
|
13
12
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,6 +9,21 @@ SimpleCov.start { add_filter '/spec/' }
|
|
9
9
|
require 'lita-onewheel-cve'
|
10
10
|
require 'lita/rspec'
|
11
11
|
|
12
|
-
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
|
-
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
12
|
Lita.version_3_compatibility_mode = false
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.expect_with :rspec do |expectations|
|
16
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
17
|
+
end
|
18
|
+
|
19
|
+
config.mock_with :rspec do |mocks|
|
20
|
+
mocks.verify_partial_doubles = true
|
21
|
+
end
|
22
|
+
|
23
|
+
config.filter_run :focus
|
24
|
+
config.run_all_when_everything_filtered = true
|
25
|
+
config.default_formatter = 'doc' if config.files_to_run.one?
|
26
|
+
config.order = :random
|
27
|
+
|
28
|
+
Kernel.srand config.seed
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-cve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: coveralls
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: rake
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,33 +109,33 @@ dependencies:
|
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '3.4'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
112
|
+
name: rubocop
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
|
-
- - "
|
115
|
+
- - ">="
|
88
116
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
117
|
+
version: '0'
|
90
118
|
type: :development
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
93
121
|
requirements:
|
94
|
-
- - "
|
122
|
+
- - ">="
|
95
123
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
124
|
+
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
126
|
+
name: simplecov
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
129
|
- - "~>"
|
102
130
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0.
|
131
|
+
version: '0.11'
|
104
132
|
type: :development
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
136
|
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0.
|
138
|
+
version: '0.11'
|
111
139
|
description: CVE decoder to pull the root link from a CVE posted in chat.
|
112
140
|
email:
|
113
141
|
- andrew.kreps@gmail.com
|
@@ -116,8 +144,12 @@ extensions: []
|
|
116
144
|
extra_rdoc_files: []
|
117
145
|
files:
|
118
146
|
- ".gitignore"
|
147
|
+
- ".rspec"
|
148
|
+
- ".rubocop.yml"
|
119
149
|
- ".travis.yml"
|
150
|
+
- CONTRIBUTING.md
|
120
151
|
- Gemfile
|
152
|
+
- LICENSE
|
121
153
|
- README.rst
|
122
154
|
- Rakefile
|
123
155
|
- lib/lita-onewheel-cve.rb
|
@@ -146,10 +178,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
178
|
version: '0'
|
147
179
|
requirements: []
|
148
180
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.5.1
|
150
182
|
signing_key:
|
151
183
|
specification_version: 4
|
152
|
-
summary:
|
184
|
+
summary: CVE decoder to pull the root link from a CVE posted in chat.
|
153
185
|
test_files:
|
154
186
|
- spec/lita/handlers/onewheel_cve_spec.rb
|
155
187
|
- spec/spec_helper.rb
|