dev_orbit 0.1.0 → 0.1.5

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: add9a71f83902b74177d6f18be9244a6046ddfce66d9bee7faa7441508521e70
4
- data.tar.gz: dca028c4a584988d396397eb9ce128efe4689d97e8a1ee3cf033b95d4a6c31aa
3
+ metadata.gz: d171db649e66e6a5c982a44e8188b40526f0d0714c2bc1910587ba892d44e2b7
4
+ data.tar.gz: dccbdb226266f0cad7551aa765cad38f75cc21b226de4dfd13f2ee4b07dc27fa
5
5
  SHA512:
6
- metadata.gz: 1e8a1075c03b2210ed34c00b6ca5be13feefd2ca0d6b520b4b5d6a6f9b6279a46c69114b5506c5251f4c7b9e3b7c1e74e286e0ec676da2d26a748d503c0caf6b
7
- data.tar.gz: 63e19fc5970490fc262b431937afdda818295a1506732b6286b17889b4fac5aac9c158420cd3a5633842c79e82763a5b84353d2b2a89f4c1f83b1bd280f2cf29
6
+ metadata.gz: e3479322756252837970a5fd3baaf07d7dbc55333a640969fa8f814a320f10763497df0b673fe811dfe420b5f7f2c11447ec435d6d590f3cede3bf729e4756fb
7
+ data.tar.gz: 294b99070ad389f7abe9f031a4a52c8f6c3e4d52b2b0beec29b742767fe53830f203cd51827c3f08d976e9a4774faad4ae4ca2576ba515ee4f33e7fa3e86b05b
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,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
@@ -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,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.1.0"
4
+ VERSION = "0.1.5"
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.0
4
+ version: 0.1.5
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-06 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,7 +142,6 @@ 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
146
  - setup
134
147
  extensions: []
@@ -146,7 +159,6 @@ files:
146
159
  - LICENSE.txt
147
160
  - README.md
148
161
  - Rakefile
149
- - bin/console
150
162
  - bin/dev_orbit
151
163
  - bin/setup
152
164
  - dev_orbit.gemspec
@@ -158,6 +170,8 @@ files:
158
170
  - lib/dev_orbit/orbit.rb
159
171
  - lib/dev_orbit/utils.rb
160
172
  - lib/dev_orbit/version.rb
173
+ - readme-images/new-comment-screenshot.png
174
+ - readme-images/ways-to-use.png
161
175
  - scripts/check_comments.rb
162
176
  - scripts/check_followers.rb
163
177
  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__)