dev_orbit 0.1.1 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5be040bbce86eea38887b56250025c6834f84b1cd049c442ef0acff79c8fb9ac
4
- data.tar.gz: 6e1da63c12b9c4f3f9cbccae6e0eda973e7564f2ef0ff3e15f715ad2874fc6ea
3
+ metadata.gz: face683978f5efcfc0e63902fc6acfb0f3b60d016344acc950aa049645d8585c
4
+ data.tar.gz: 0d620594f0a1b64c7e00605204139fea78fa493f91f4c7e2fdb87587ab1f03fe
5
5
  SHA512:
6
- metadata.gz: 9ac862022a6f56a6810ab15db8a6b16fb41dbf26152169af2a476a38afe9718fec80897ed586609d16646b7456c87a05c94e4d3e565a16ce951a9dd27d31fca8
7
- data.tar.gz: c8a31b552748c6a4cc88a3f3e2332db3c6219163a366e747dadde4baa63f7cb08bafb097a1a03263c4b684c9e31c3153b511069072e422fb1c564c6d3595a87d
6
+ metadata.gz: 527049e721b0248e7e57d13c8ffbd64fc25656493a8e25aa77865b18cc4f97a33e65c41084f8f9238157e3ff2f106b08eb10588761a1a56e9dcbff77e9d42173
7
+ data.tar.gz: 1dac710ead8d771ccf4092bc3fa83343c989311a4e53121165f8e57b601ba46c098268e69912cf3c76f36450d75c67c30676c77800c44860eebf3ab0cc2547c9
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/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,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dev_orbit (0.1.0)
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
 
@@ -59,12 +60,21 @@ GEM
59
60
  crass (~> 1.0.2)
60
61
  nokogiri (>= 1.5.9)
61
62
  minitest (5.14.4)
62
- nokogiri (1.11.3-arm64-darwin)
63
+ nokogiri (1.11.5-arm64-darwin)
64
+ racc (~> 1.4)
65
+ nokogiri (1.11.5-x86_64-darwin)
66
+ racc (~> 1.4)
67
+ nokogiri (1.11.5-x86_64-linux)
63
68
  racc (~> 1.4)
64
69
  nokogiri (1.11.3-x86_64-darwin)
65
70
  racc (~> 1.4)
66
- nokogiri (1.11.2-x86_64-linux)
71
+ nokogiri (1.11.3-x86_64-linux)
67
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)
68
78
  parallel (1.20.1)
69
79
  parser (3.0.0.0)
70
80
  ast (~> 2.4.1)
@@ -125,6 +135,7 @@ PLATFORMS
125
135
  DEPENDENCIES
126
136
  byebug
127
137
  dev_orbit!
138
+ orbit_activities
128
139
  rake (~> 13.0)
129
140
  rspec (~> 3.4)
130
141
  rubocop (~> 1.7)
data/README.md CHANGED
@@ -4,11 +4,14 @@
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
- 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.
7
+ Add your DEV interactions into your Orbit workspace with this community-built integration.
8
+
9
+ ![New DEV blog post comment in Orbit screenshot](readme-images/new-comment-screenshot.png)
8
10
 
9
11
  |<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
12
  |-----------------------------------------|
11
13
 
14
+ ![There are three ways to use this integration. Install package - build and run your own applications. Run the CLI - run on-demand directly from your terminal. Schedule an automation with GitHub - get started in minutes - no coding required](readme-images/ways-to-use.png)
12
15
  ## Installation
13
16
 
14
17
  Add this line to your application's Gemfile:
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..."
data/dev_orbit.gemspec CHANGED
@@ -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,22 +21,13 @@ 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
@@ -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.1.1"
4
+ VERSION = "0.1.6"
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_orbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orbit DevRel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-11 00:00:00.000000000 Z
12
+ date: 2021-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -95,6 +95,20 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
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'
98
112
  - !ruby/object:Gem::Dependency
99
113
  name: rspec
100
114
  requirement: !ruby/object:Gem::Requirement
@@ -128,9 +142,7 @@ description: This gem integrates DEV blog interactions like comments, etc. into
128
142
  email:
129
143
  - devrel@orbit.love
130
144
  executables:
131
- - console
132
145
  - dev_orbit
133
- - setup
134
146
  extensions: []
135
147
  extra_rdoc_files: []
136
148
  files:
@@ -146,9 +158,7 @@ files:
146
158
  - LICENSE.txt
147
159
  - README.md
148
160
  - Rakefile
149
- - bin/console
150
161
  - bin/dev_orbit
151
- - bin/setup
152
162
  - dev_orbit.gemspec
153
163
  - lib/dev_orbit.rb
154
164
  - lib/dev_orbit/client.rb
@@ -158,6 +168,8 @@ files:
158
168
  - lib/dev_orbit/orbit.rb
159
169
  - lib/dev_orbit/utils.rb
160
170
  - lib/dev_orbit/version.rb
171
+ - readme-images/new-comment-screenshot.png
172
+ - readme-images/ways-to-use.png
161
173
  - scripts/check_comments.rb
162
174
  - scripts/check_followers.rb
163
175
  homepage: https://github.com/orbit-love/community-ruby-dev-orbit
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "dev_orbit"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here