Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace the Request class with the SimpleRequest lib #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ gem 'net-smtp'
gem 'pg', '~> 1.2'
gem 'puma', '~> 4.1'
gem 'sidekiq'
gem 'simple_request', git: 'https://github.com/kaiomagalhaes/simple_request.git'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.7'

Expand Down
57 changes: 33 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
GIT
remote: https://github.com/kaiomagalhaes/simple_request.git
revision: 4327b20134f481dae9914d296bbbd2cd649e4432
specs:
simple_request (0.1.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -75,7 +81,7 @@ GEM
concurrent-ruby (1.1.10)
connection_pool (2.3.0)
crass (1.0.6)
data_migrate (8.1.1)
data_migrate (8.2.0)
activerecord (>= 5.0)
railties (>= 5.0)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -161,17 +167,17 @@ GEM
net-protocol
net-protocol (0.1.3)
timeout
net-smtp (0.3.2)
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.13.8-aarch64-linux)
nokogiri (1.13.9-aarch64-linux)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
pg (1.4.3)
pg (1.4.4)
puma (4.3.12)
nio4r (~> 2.0)
racc (1.6.0)
Expand Down Expand Up @@ -224,18 +230,19 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.8.0)
redis-client (0.10.0)
connection_pool
regexp_parser (2.6.0)
remotipart (1.4.4)
rexml (3.2.5)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.1)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (~> 3.12.0)
rspec-rails (4.0.2)
actionpack (>= 4.2)
activesupport (>= 4.2)
Expand All @@ -244,20 +251,20 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.1)
rubocop (1.36.0)
rspec-support (3.12.0)
rubocop (1.37.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.20.1, < 2.0)
rubocop-ast (>= 1.23.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
rubocop-rails (2.16.1)
rubocop-rails (2.17.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand All @@ -273,10 +280,11 @@ GEM
tilt
shoulda-matchers (5.2.0)
activesupport (>= 5.2.0)
sidekiq (6.5.7)
connection_pool (>= 2.2.5)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq (7.0.0)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.9.0)
slack-ruby-client (1.0.0)
faraday (>= 1.0)
faraday_middleware
Expand All @@ -294,7 +302,7 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
temple (0.8.2)
temple (0.9.1)
thor (1.2.1)
tilt (2.0.11)
timeout (0.3.0)
Expand All @@ -304,7 +312,7 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.1)
zeitwerk (2.6.2)

PLATFORMS
aarch64-linux
Expand All @@ -330,9 +338,10 @@ DEPENDENCIES
rubocop-rails
shoulda-matchers
sidekiq
simple_request!
slack-ruby-client (= 1.0.0)
spring
spring-watcher-listen (~> 2.0.0)

BUNDLED WITH
2.3.19
2.3.24
2 changes: 1 addition & 1 deletion app/controllers/channel_messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def target_type
end

def target
"\##{params[:channel]}"
"##{params[:channel]}"
end

def content
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/oauth/slack_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def create

credentials = save_credentials!(data)

response = Request.post(organizations_url, '', organizations_body(credentials))
organizations_id = JSON.parse(response.body)['id']
response = SimpleRequest.post(organizations_url, body: organizations_body(credentials))
organizations_id = response['id']

organizations_path = URI.parse("#{roadrunner_url}/organizations/#{organizations_id}").to_s

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/reactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def target_type
end

def target
"\##{params[:channel]}"
"##{params[:channel]}"
end
end
4 changes: 1 addition & 3 deletions app/services/clients/slack/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ class User < Client
def list
response = client.users_list
members = response['members']
members.map do |member|
member['name']
end
members.pluck('name')
end
end
end
Expand Down
49 changes: 0 additions & 49 deletions app/services/request.rb

This file was deleted.