dev_orbit 0.0.10 → 0.1.4

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: deba9c4bf14d7d8d11906b6b3e2a15f7e0c4dfc8e65ba5b7fa298e35c2a0877c
4
- data.tar.gz: ab09ace67d86209779ad99df66997e7f35009035b209dd71fd035e581b825b7a
3
+ metadata.gz: 3e05425d9aaf87e29581c96ef6a18602a711427500d424413d1571a077e0268c
4
+ data.tar.gz: 0046a044b881dd69043d17998ef2b42428aff437239952cc43e9a77d3cbc4a0f
5
5
  SHA512:
6
- metadata.gz: ce4ee9e896e5c1f6560e8253230b07456a290016359b5c385d727a520108d3ed8c1e92343687863e00d1b946d233098eeecc794026aa1fe06e24d927b0cb56c7
7
- data.tar.gz: a561ddd4cd678637da62a8a91e4436b8e5df63a0891f46b352606eb88578a60189c52dbe00f5ca620014819aa5cbc37b8d03c0faa607ecc63895dd136567aa1b
6
+ metadata.gz: f567cb12b3077d2aded59d894833bf0b72413c39b1f1ae6e9e27e9d03db02e9c68eb67742231462cfc98775be8abca94f22a6534fa52043149540fdcb57068af
7
+ data.tar.gz: c03024792f967aacf7824ff750c12a65fa528c7581b09546a23256c3adb1dc37c12682f49192e2515a8ffc7ca2f69be566161ea39c833916d99a9dec3e6aa6b5
data/.gitignore CHANGED
@@ -6,4 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- .byebug_history
9
+ .byebug_history
10
+ .env
data/CHANGELOG.md CHANGED
@@ -37,4 +37,8 @@
37
37
 
38
38
  ## [0.0.10] - 2021-04-23
39
39
 
40
- - Fix filter for DEV comments
40
+ - Fix filter for DEV comments
41
+ ## [0.1.0] - 2021-05-06
42
+
43
+ - Correct CLI `CheckFollowers` action
44
+ - Update gem specifications
data/Gemfile CHANGED
@@ -9,4 +9,6 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rubocop", "~> 1.7"
11
11
 
12
+ gem "orbit_activities"
13
+
12
14
  gem "byebug"
data/Gemfile.lock CHANGED
@@ -1,24 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dev_orbit (0.0.8)
4
+ dev_orbit (0.1.3)
5
5
  actionview (~> 6.1)
6
6
  activesupport (~> 6.1)
7
7
  http (~> 4.4)
8
8
  json (~> 2.5)
9
+ orbit_activities (~> 0.1)
9
10
  thor (~> 1.1)
10
11
  zeitwerk (~> 2.4)
11
12
 
12
13
  GEM
13
14
  remote: https://rubygems.org/
14
15
  specs:
15
- actionview (6.1.3)
16
- activesupport (= 6.1.3)
16
+ actionview (6.1.3.2)
17
+ activesupport (= 6.1.3.2)
17
18
  builder (~> 3.1)
18
19
  erubi (~> 1.4)
19
20
  rails-dom-testing (~> 2.0)
20
21
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
21
- activesupport (6.1.3)
22
+ activesupport (6.1.3.2)
22
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
24
  i18n (>= 1.6, < 2)
24
25
  minitest (>= 5.1)
@@ -52,15 +53,28 @@ GEM
52
53
  http-form_data (2.3.0)
53
54
  http-parser (1.2.3)
54
55
  ffi-compiler (>= 1.0, < 2.0)
55
- i18n (1.8.9)
56
+ i18n (1.8.10)
56
57
  concurrent-ruby (~> 1.0)
57
58
  json (2.5.1)
58
- loofah (2.9.0)
59
+ loofah (2.9.1)
59
60
  crass (~> 1.0.2)
60
61
  nokogiri (>= 1.5.9)
61
62
  minitest (5.14.4)
62
- nokogiri (1.11.2-x86_64-darwin)
63
+ nokogiri (1.11.5-arm64-darwin)
63
64
  racc (~> 1.4)
65
+ nokogiri (1.11.5-x86_64-darwin)
66
+ racc (~> 1.4)
67
+ nokogiri (1.11.5-x86_64-linux)
68
+ racc (~> 1.4)
69
+ nokogiri (1.11.3-x86_64-darwin)
70
+ racc (~> 1.4)
71
+ nokogiri (1.11.3-x86_64-linux)
72
+ racc (~> 1.4)
73
+ orbit_activities (0.1.0)
74
+ http (~> 4.4)
75
+ json (~> 2.5)
76
+ rake (~> 13.0)
77
+ zeitwerk (~> 2.4)
64
78
  parallel (1.20.1)
65
79
  parser (3.0.0.0)
66
80
  ast (~> 2.4.1)
@@ -74,7 +88,7 @@ GEM
74
88
  rainbow (3.0.0)
75
89
  rake (13.0.3)
76
90
  regexp_parser (2.1.1)
77
- rexml (3.2.4)
91
+ rexml (3.2.5)
78
92
  rspec (3.10.0)
79
93
  rspec-core (~> 3.10.0)
80
94
  rspec-expectations (~> 3.10.0)
@@ -114,15 +128,18 @@ GEM
114
128
  zeitwerk (2.4.2)
115
129
 
116
130
  PLATFORMS
131
+ arm64-darwin-20
117
132
  x86_64-darwin-19
133
+ x86_64-linux
118
134
 
119
135
  DEPENDENCIES
120
136
  byebug
121
137
  dev_orbit!
138
+ orbit_activities
122
139
  rake (~> 13.0)
123
140
  rspec (~> 3.4)
124
141
  rubocop (~> 1.7)
125
142
  webmock (~> 3.12)
126
143
 
127
144
  BUNDLED WITH
128
- 2.2.13
145
+ 2.2.16
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # DEV.to Interactions to Orbit Workspace
2
2
 
3
- ![Build Status](https://github.com/bencgreenberg/dev_orbit/workflows/CI/badge.svg)
3
+ ![Build Status](https://github.com/orbit-love/community-ruby-dev-orbit/workflows/CI/badge.svg)
4
4
  [![Gem Version](https://badge.fury.io/rb/dev_orbit.svg)](https://badge.fury.io/rb/dev_orbit)
5
5
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)
6
6
 
7
7
  This is a Ruby gem that can be used to integrate your DEV interactions, like DEV comments on blog posts, into your organization's Orbit workspace.
8
8
 
9
+ |<p align="left">:sparkles:</p> This is a *community project*. The Orbit team does its best to maintain it and keep it up to date with any recent API changes.<br/><br/>We welcome community contributions to make sure that it stays current. <p align="right">:sparkles:</p>|
10
+ |-----------------------------------------|
11
+
9
12
  ## Installation
10
13
 
11
14
  Add this line to your application's Gemfile:
@@ -85,7 +88,7 @@ $ ORBIT_API_KEY='...' ORBIT_WORKSPACE='...' DEV_API_KEY='...' DEV_USERNAME='...'
85
88
 
86
89
  ## Contributing
87
90
 
88
- Bug reports and pull requests are welcome on GitHub at https://github.com/bencgreenberg/dev_orbit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bencgreenberg/dev_orbit/blob/master/CODE_OF_CONDUCT.md).
91
+ Bug reports and pull requests are welcome on GitHub at https://github.com/orbit-love/community-ruby-dev-orbit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/orbit-love/community-ruby-dev-orbit/blob/main/CODE_OF_CONDUCT.md).
89
92
 
90
93
  ## License
91
94
 
@@ -93,4 +96,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
93
96
 
94
97
  ## Code of Conduct
95
98
 
96
- Everyone interacting in the project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bencgreenberg/dev_orbit/blob/master/CODE_OF_CONDUCT.md).
99
+ Everyone interacting in the project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/orbit-love/community-ruby-dev-orbit/blob/main/CODE_OF_CONDUCT.md).
data/bin/dev_orbit CHANGED
@@ -23,6 +23,7 @@ $LOAD_PATH.unshift(File.expand_path('../lib/dev_orbit', __dir__))
23
23
 
24
24
  require_relative '../lib/dev_orbit'
25
25
  require_relative '../scripts/check_comments'
26
+ require_relative '../scripts/check_followers'
26
27
 
27
28
  if check_comments
28
29
  puts "Checking for new DEV comments within the past day and posting them to your Orbit workspace..."
@@ -33,5 +34,5 @@ end
33
34
  if check_followers
34
35
  puts "Checking for new DEV followers posting them to your Orbit workspace..."
35
36
  ARGV[0] = 'render'
36
- DevOrbit::Scripts::CheckComments.start(ARGV)
37
+ DevOrbit::Scripts::CheckFollowers.start(ARGV)
37
38
  end
data/dev_orbit.gemspec CHANGED
@@ -5,18 +5,18 @@ require_relative "lib/dev_orbit/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "dev_orbit"
7
7
  spec.version = DevOrbit::VERSION
8
- spec.authors = ["Ben Greenberg"]
9
- spec.email = ["ben.greenberg@hey.com"]
8
+ spec.authors = ["Orbit DevRel", "Ben Greenberg"]
9
+ spec.email = ["devrel@orbit.love"]
10
10
 
11
11
  spec.summary = "Integrate DEV interactions into your Orbit workspace"
12
12
  spec.description = "This gem integrates DEV blog interactions like comments, etc. into your Orbit workspace"
13
- spec.homepage = "https://github.com/bencgreenberg/dev_orbit"
13
+ spec.homepage = "https://github.com/orbit-love/community-ruby-dev-orbit"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://github.com/bencgreenberg/dev_orbit"
19
- spec.metadata["changelog_uri"] = "https://github.com/bencgreenberg/dev_orbit/blob/master/CHANGELOG.md"
18
+ spec.metadata["source_code_uri"] = "https://github.com/orbit-love/community-ruby-dev-orbit"
19
+ spec.metadata["changelog_uri"] = "https://github.com/orbit-love/community-ruby-dev-orbit/blob/main/CHANGELOG.md"
20
20
 
21
21
  # Specify which files should be added to the gem when it is released.
22
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "json", "~> 2.5"
36
36
  spec.add_dependency "zeitwerk", "~> 2.4"
37
37
  spec.add_dependency "thor", "~> 1.1"
38
+ spec.add_dependency "orbit_activities", "~> 0.1"
38
39
  spec.add_development_dependency "rspec", "~> 3.4"
39
40
  spec.add_development_dependency "webmock", "~> 3.12"
40
41
 
data/lib/dev_orbit.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "zeitwerk"
4
+ require "orbit_activities"
5
+ require_relative "dev_orbit/version"
4
6
 
5
7
  module DevOrbit
6
8
  loader = Zeitwerk::Loader.new
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "net/http"
4
3
  require "json"
5
4
  require "action_view"
6
5
  require_relative "../utils"
@@ -22,28 +21,20 @@ module DevOrbit
22
21
  end
23
22
 
24
23
  def after_initialize!
25
- url = URI("https://app.orbit.love/api/v1/#{@workspace_id}/activities")
26
-
27
- http = Net::HTTP.new(url.host, url.port)
28
- http.use_ssl = true
29
- req = Net::HTTP::Post.new(url)
30
- req["Accept"] = "application/json"
31
- req["Content-Type"] = "application/json"
32
- req["Authorization"] = "Bearer #{@api_key}"
33
-
34
- req.body = construct_body
35
-
36
- req.body = req.body.to_json
37
-
38
- response = http.request(req)
39
-
40
- JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
24
+ OrbitActivities::Request.new(
25
+ api_key: @api_key,
26
+ workspace_id: @workspace_id,
27
+ user_agent: "community-ruby-dev-orbit/#{DevOrbit::VERSION}",
28
+ action: "new_activity",
29
+ body: construct_body.to_json
30
+ )
41
31
  end
42
32
 
43
33
  def construct_body
44
34
  hash = {
45
35
  activity: {
46
36
  activity_type: "dev:comment",
37
+ tags: ["channel:dev"],
47
38
  key: "dev-comment-#{@id}",
48
39
  title: "Commented on the DEV blog post: #{@article_title}",
49
40
  description: @body,
@@ -28,6 +28,7 @@ module DevOrbit
28
28
  req["Accept"] = "application/json"
29
29
  req["Content-Type"] = "application/json"
30
30
  req["Authorization"] = "Bearer #{@api_key}"
31
+ req["User-Agent"] = "community-ruby-dev-orbit/#{DevOrbit::VERSION}"
31
32
 
32
33
  req.body = construct_body
33
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DevOrbit
4
- VERSION = "0.0.10"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_orbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
+ - Orbit DevRel
7
8
  - Ben Greenberg
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
12
+ date: 2021-05-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activesupport
@@ -94,6 +95,20 @@ dependencies:
94
95
  - - "~>"
95
96
  - !ruby/object:Gem::Version
96
97
  version: '1.1'
98
+ - !ruby/object:Gem::Dependency
99
+ name: orbit_activities
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '0.1'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '0.1'
97
112
  - !ruby/object:Gem::Dependency
98
113
  name: rspec
99
114
  requirement: !ruby/object:Gem::Requirement
@@ -125,7 +140,7 @@ dependencies:
125
140
  description: This gem integrates DEV blog interactions like comments, etc. into your
126
141
  Orbit workspace
127
142
  email:
128
- - ben.greenberg@hey.com
143
+ - devrel@orbit.love
129
144
  executables:
130
145
  - console
131
146
  - dev_orbit
@@ -159,13 +174,13 @@ files:
159
174
  - lib/dev_orbit/version.rb
160
175
  - scripts/check_comments.rb
161
176
  - scripts/check_followers.rb
162
- homepage: https://github.com/bencgreenberg/dev_orbit
177
+ homepage: https://github.com/orbit-love/community-ruby-dev-orbit
163
178
  licenses:
164
179
  - MIT
165
180
  metadata:
166
- homepage_uri: https://github.com/bencgreenberg/dev_orbit
167
- source_code_uri: https://github.com/bencgreenberg/dev_orbit
168
- changelog_uri: https://github.com/bencgreenberg/dev_orbit/blob/master/CHANGELOG.md
181
+ homepage_uri: https://github.com/orbit-love/community-ruby-dev-orbit
182
+ source_code_uri: https://github.com/orbit-love/community-ruby-dev-orbit
183
+ changelog_uri: https://github.com/orbit-love/community-ruby-dev-orbit/blob/main/CHANGELOG.md
169
184
  post_install_message:
170
185
  rdoc_options: []
171
186
  require_paths: