dev_orbit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +22 -1
- data/dev_orbit.gemspec +1 -0
- data/lib/dev_orbit/interactions/comment.rb +18 -9
- data/lib/dev_orbit/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44b1844cc0404a82182eb33f1a103b57d2b9be7577c1975e0c2e1755b44357f3
|
4
|
+
data.tar.gz: b2c48ee968464e77bf86088969fa35075da57239917274940b1112f4c6cf196a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58e4425e99158a5e35b7aa0b2c3063c3bf12587339b4fd11b7e2ebee93b8d950e93abcb4285f61bd6e3dbddefba822bb0e41819890191c855cffde806cb7c69
|
7
|
+
data.tar.gz: ac4ddd1cd9e03cb6cab47cac12973f17e48fb8c2245c05679fb14685419041d8e91841243a53255f28b42fc814a7b92928a7b27dbd12e3fa9e1cde254c7f5f3b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dev_orbit (0.0.
|
4
|
+
dev_orbit (0.0.3)
|
5
|
+
actionview (~> 6.1)
|
5
6
|
activesupport (~> 6.1)
|
6
7
|
http (~> 4.4)
|
7
8
|
json (~> 2.5)
|
@@ -11,6 +12,12 @@ PATH
|
|
11
12
|
GEM
|
12
13
|
remote: https://rubygems.org/
|
13
14
|
specs:
|
15
|
+
actionview (6.1.3)
|
16
|
+
activesupport (= 6.1.3)
|
17
|
+
builder (~> 3.1)
|
18
|
+
erubi (~> 1.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
14
21
|
activesupport (6.1.3)
|
15
22
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
23
|
i18n (>= 1.6, < 2)
|
@@ -20,13 +27,16 @@ GEM
|
|
20
27
|
addressable (2.7.0)
|
21
28
|
public_suffix (>= 2.0.2, < 5.0)
|
22
29
|
ast (2.4.2)
|
30
|
+
builder (3.2.4)
|
23
31
|
byebug (11.1.3)
|
24
32
|
concurrent-ruby (1.1.8)
|
25
33
|
crack (0.4.5)
|
26
34
|
rexml
|
35
|
+
crass (1.0.6)
|
27
36
|
diff-lcs (1.4.4)
|
28
37
|
domain_name (0.5.20190701)
|
29
38
|
unf (>= 0.0.5, < 1.0.0)
|
39
|
+
erubi (1.10.0)
|
30
40
|
ffi (1.15.0)
|
31
41
|
ffi-compiler (1.0.1)
|
32
42
|
ffi (>= 1.0.0)
|
@@ -45,11 +55,22 @@ GEM
|
|
45
55
|
i18n (1.8.9)
|
46
56
|
concurrent-ruby (~> 1.0)
|
47
57
|
json (2.5.1)
|
58
|
+
loofah (2.9.0)
|
59
|
+
crass (~> 1.0.2)
|
60
|
+
nokogiri (>= 1.5.9)
|
48
61
|
minitest (5.14.4)
|
62
|
+
nokogiri (1.11.1-x86_64-darwin)
|
63
|
+
racc (~> 1.4)
|
49
64
|
parallel (1.20.1)
|
50
65
|
parser (3.0.0.0)
|
51
66
|
ast (~> 2.4.1)
|
52
67
|
public_suffix (4.0.6)
|
68
|
+
racc (1.5.2)
|
69
|
+
rails-dom-testing (2.0.3)
|
70
|
+
activesupport (>= 4.2.0)
|
71
|
+
nokogiri (>= 1.6)
|
72
|
+
rails-html-sanitizer (1.3.0)
|
73
|
+
loofah (~> 2.3)
|
53
74
|
rainbow (3.0.0)
|
54
75
|
rake (13.0.3)
|
55
76
|
regexp_parser (2.1.1)
|
data/dev_orbit.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
# Uncomment to register a new dependency of your gem
|
31
31
|
# spec.add_dependency "example-gem", "~> 1.0"
|
32
32
|
spec.add_dependency "activesupport", "~> 6.1"
|
33
|
+
spec.add_dependency "actionview", "~> 6.1"
|
33
34
|
spec.add_dependency "http", "~> 4.4"
|
34
35
|
spec.add_dependency "json", "~> 2.5"
|
35
36
|
spec.add_dependency "zeitwerk", "~> 2.4"
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "net/http"
|
4
4
|
require "json"
|
5
|
+
require "action_view"
|
5
6
|
|
6
7
|
module DevOrbit
|
7
8
|
module Interactions
|
@@ -29,7 +30,17 @@ module DevOrbit
|
|
29
30
|
req["Content-Type"] = "application/json"
|
30
31
|
req["Authorization"] = "Bearer #{@api_key}"
|
31
32
|
|
32
|
-
req.body =
|
33
|
+
req.body = construct_body
|
34
|
+
|
35
|
+
req.body = req.body.to_json
|
36
|
+
|
37
|
+
response = http.request(req)
|
38
|
+
|
39
|
+
JSON.parse(response.body)
|
40
|
+
end
|
41
|
+
|
42
|
+
def construct_body
|
43
|
+
hash = {
|
33
44
|
activity: {
|
34
45
|
activity_type: "dev:comment",
|
35
46
|
key: "dev-comment-#{@id}",
|
@@ -48,17 +59,15 @@ module DevOrbit
|
|
48
59
|
}
|
49
60
|
}
|
50
61
|
|
51
|
-
|
52
|
-
|
53
|
-
req.body[:activity][:member].merge!(github: @commenter[:github]) if @commenter[:github]
|
54
|
-
|
55
|
-
req.body = req.body.to_json
|
62
|
+
hash[:activity][:member].merge!(twitter: @commenter[:twitter]) if @commenter[:twitter]
|
56
63
|
|
57
|
-
|
64
|
+
hash[:activity][:member].merge!(github: @commenter[:github]) if @commenter[:github]
|
58
65
|
|
59
|
-
|
66
|
+
hash
|
60
67
|
end
|
61
68
|
|
69
|
+
private
|
70
|
+
|
62
71
|
def construct_commenter(commenter)
|
63
72
|
hash = {
|
64
73
|
'name': commenter[:name],
|
@@ -77,7 +86,7 @@ module DevOrbit
|
|
77
86
|
end
|
78
87
|
|
79
88
|
def sanitize_comment(comment)
|
80
|
-
|
89
|
+
ActionView::Base.full_sanitizer.sanitize(comment)
|
81
90
|
end
|
82
91
|
end
|
83
92
|
end
|
data/lib/dev_orbit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev_orbit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Greenberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: actionview
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '6.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '6.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: http
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|