dev_orbit 0.1.3 → 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: 1cf2cb11061773667c041e7d8110d0d80526f40fdb7451d6ae2d05a8b526a530
4
- data.tar.gz: 2d8744c9b9649c84891f0e44b10c78e3476b5bc92085574918bf923dc7430c39
3
+ metadata.gz: 3e05425d9aaf87e29581c96ef6a18602a711427500d424413d1571a077e0268c
4
+ data.tar.gz: 0046a044b881dd69043d17998ef2b42428aff437239952cc43e9a77d3cbc4a0f
5
5
  SHA512:
6
- metadata.gz: a320ab09b535655f3f6fca9a54e59d35405f749b33fb483f926321f1493b6f9b845a62afc621f683bba7709b1fa681d6350f01d814ab6d8f968271d8967ef6a6
7
- data.tar.gz: 24c6cde04ef951e77be279d890a98794fb16a735a2920338f8425192af3a47f07a4de58b8cf6da2237fec7ff2c5bcdc2e95469e6318e0265cddf42be99233b03
6
+ metadata.gz: f567cb12b3077d2aded59d894833bf0b72413c39b1f1ae6e9e27e9d03db02e9c68eb67742231462cfc98775be8abca94f22a6534fa52043149540fdcb57068af
7
+ data.tar.gz: c03024792f967aacf7824ff750c12a65fa528c7581b09546a23256c3adb1dc37c12682f49192e2515a8ffc7ca2f69be566161ea39c833916d99a9dec3e6aa6b5
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.2)
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,8 +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)
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)
@@ -121,6 +135,7 @@ PLATFORMS
121
135
  DEPENDENCIES
122
136
  byebug
123
137
  dev_orbit!
138
+ orbit_activities
124
139
  rake (~> 13.0)
125
140
  rspec (~> 3.4)
126
141
  rubocop (~> 1.7)
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,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "zeitwerk"
4
+ require "orbit_activities"
4
5
  require_relative "dev_orbit/version"
5
6
 
6
7
  module DevOrbit
@@ -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,23 +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
- req["User-Agent"] = "community-ruby-dev-orbit/#{DevOrbit::VERSION}"
34
-
35
- req.body = construct_body
36
-
37
- req.body = req.body.to_json
38
-
39
- response = http.request(req)
40
-
41
- 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
+ )
42
31
  end
43
32
 
44
33
  def construct_body
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DevOrbit
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
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.3
4
+ version: 0.1.4
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-24 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