dev_orbit 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +25 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/dev_orbit/dev.rb +5 -2
- data/lib/dev_orbit/interactions/comment.rb +2 -1
- data/lib/dev_orbit/utils.rb +11 -0
- data/lib/dev_orbit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c02ba74434acb5637a4d93ecd37dc4883969ba36128bb001130d0b6dfbf087
|
4
|
+
data.tar.gz: 6c9eca9384cdb84eb9049d45acf25da3c05a421a75f083a2883f14fb8bef1a7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9870c95fc0e32a818528f2f0ceec830f781cf9193a63056760e30a71e94e6caa509953dfa9408cd27a3dff34003f02f5c1d030a79043d4c47cb2bd4d9606ca7
|
7
|
+
data.tar.gz: fde99905baf0e7a7faad0041c4256ad55713c2dc648e58af4590e18c25c16cf11739321176c36aee75049a249c3bf2ac423df6461a09e4541972198597facb79
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
os: [ubuntu-latest, macos-latest]
|
14
|
+
ruby: [2.7, 3.0]
|
15
|
+
runs-on: ${{ matrix.os }}
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
- name: Install dependencies
|
23
|
+
run: bundle install
|
24
|
+
- name: Run tests
|
25
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dev_orbit (0.0.
|
4
|
+
dev_orbit (0.0.6)
|
5
5
|
actionview (~> 6.1)
|
6
6
|
activesupport (~> 6.1)
|
7
7
|
http (~> 4.4)
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
crass (~> 1.0.2)
|
60
60
|
nokogiri (>= 1.5.9)
|
61
61
|
minitest (5.14.4)
|
62
|
-
nokogiri (1.11.
|
62
|
+
nokogiri (1.11.2-x86_64-darwin)
|
63
63
|
racc (~> 1.4)
|
64
64
|
parallel (1.20.1)
|
65
65
|
parser (3.0.0.0)
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# DEV.to Interactions to Orbit Workspace
|
2
2
|
|
3
|
+

|
3
4
|
[](https://badge.fury.io/rb/dev_orbit)
|
4
5
|
[](code_of_conduct.md)
|
5
6
|
|
data/lib/dev_orbit/dev.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "net/http"
|
4
4
|
require "json"
|
5
5
|
require "active_support/time"
|
6
|
+
require_relative "utils"
|
6
7
|
|
7
8
|
module DevOrbit
|
8
9
|
class Dev
|
@@ -18,6 +19,7 @@ module DevOrbit
|
|
18
19
|
|
19
20
|
articles.each do |article|
|
20
21
|
comments = get_article_comments(article["id"])
|
22
|
+
|
21
23
|
next if comments.empty?
|
22
24
|
|
23
25
|
DevOrbit::Orbit.call(
|
@@ -44,7 +46,7 @@ module DevOrbit
|
|
44
46
|
|
45
47
|
response = https.request(request)
|
46
48
|
|
47
|
-
JSON.parse(response.body)
|
49
|
+
JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
|
48
50
|
end
|
49
51
|
|
50
52
|
def get_article_comments(id)
|
@@ -55,7 +57,8 @@ module DevOrbit
|
|
55
57
|
request = Net::HTTP::Get.new(url)
|
56
58
|
|
57
59
|
response = https.request(request)
|
58
|
-
|
60
|
+
|
61
|
+
comments = JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
|
59
62
|
|
60
63
|
filter_comments(comments)
|
61
64
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "net/http"
|
4
4
|
require "json"
|
5
5
|
require "action_view"
|
6
|
+
require_relative "../utils"
|
6
7
|
|
7
8
|
module DevOrbit
|
8
9
|
module Interactions
|
@@ -36,7 +37,7 @@ module DevOrbit
|
|
36
37
|
|
37
38
|
response = http.request(req)
|
38
39
|
|
39
|
-
|
40
|
+
JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
|
40
41
|
end
|
41
42
|
|
42
43
|
def construct_body
|
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.7
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -134,6 +134,7 @@ extensions: []
|
|
134
134
|
extra_rdoc_files: []
|
135
135
|
files:
|
136
136
|
- ".env.sample"
|
137
|
+
- ".github/workflows/ci.yml"
|
137
138
|
- ".gitignore"
|
138
139
|
- ".rspec"
|
139
140
|
- ".rubocop.yml"
|
@@ -153,6 +154,7 @@ files:
|
|
153
154
|
- lib/dev_orbit/dev.rb
|
154
155
|
- lib/dev_orbit/interactions/comment.rb
|
155
156
|
- lib/dev_orbit/orbit.rb
|
157
|
+
- lib/dev_orbit/utils.rb
|
156
158
|
- lib/dev_orbit/version.rb
|
157
159
|
- scripts/check_comments.rb
|
158
160
|
homepage: https://github.com/bencgreenberg/dev_orbit
|