wor-requests 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 5ed50703665ba94d25a38f3c8ef8a724ca7d4a0d
4
- data.tar.gz: 2b894c7322b3ab4e87735bcb9579704a90693512
3
+ metadata.gz: ab5a51f2877974f836e6c6275f03a461c3b4f707
4
+ data.tar.gz: b06bac7b122ee50d17a3232f99b250000850320f
5
5
  SHA512:
6
- metadata.gz: b25426b8bc4ad40adbcbe342bb82cc174e7436b45622b418f4eb2e2e4100e379b01f836152f3f6eb9b534018d1dfd2233ccc32b18b3d818d432dca75e536893b
7
- data.tar.gz: aa81d67f150c70e1ffd44d56888915ef2868dcaf199bff36b5b207e9b7862a2323d3b81f25f8924bca48b78861cecbafae3d6b632dc893fa3a33ec014af4c881
6
+ metadata.gz: 2c1ea9a833e798677bc1314f5131408fe24a599fdfb353d34c53bf77366ddada243e74ec54e76fb55129fbebc404064b185ad542b81c663d216321c19b2a4c16
7
+ data.tar.gz: 9e0f623dec18850fdb63fafaa732930f0dae07b3ccdec2d9fe81d6097b21468f41867e6b4778bb613ee43b213f073f06457b1b118dee17a0ec7369c3cd1f9944
@@ -0,0 +1,8 @@
1
+
2
+ ## Change log
3
+
4
+ ### [0.1.0]
5
+
6
+ #### Added
7
+
8
+ - `wor-requests` gem first release.
data/README.md CHANGED
@@ -62,6 +62,37 @@ puts GithubService.new.repositories('alebian')
62
62
 
63
63
  Or, even easier, run `rails generate wor:requests:service NAME` in your Rails root
64
64
 
65
+
66
+ If you need to send body parameters in a post request you can write something like this:
67
+
68
+ ```ruby
69
+ require 'wor/requests'
70
+
71
+ class ExternalService < Wor::Requests::Base
72
+ def post_request_example(authorization)
73
+ post(
74
+ attempting_to: 'Make a POST request to an external service.',
75
+ path: '/some_endpoint',
76
+ headers: {
77
+ Authorization: authorization,
78
+ 'Content-type' => 'application/json'
79
+ },
80
+ body: {
81
+ # Some Json
82
+ }
83
+ )
84
+ end
85
+
86
+ protected
87
+
88
+ def base_url
89
+ 'https://external.service.com'
90
+ end
91
+ end
92
+
93
+ ExternalService.new.post_request_example(token)
94
+ ```
95
+
65
96
  ## Contributing
66
97
 
67
98
  1. Fork it
@@ -85,12 +85,12 @@ module Wor
85
85
  end
86
86
 
87
87
  def formatted_base_url
88
- base_url.last != '/' ? "#{base_url}/" : base_url
88
+ base_url[-1] != '/' ? "#{base_url}/" : base_url
89
89
  end
90
90
 
91
91
  def formatted_path(path)
92
92
  return '' if path.nil?
93
- return path if path.first != '/'
93
+ return path if path[0] != '/'
94
94
  path.slice!(0)
95
95
  path
96
96
  end
@@ -1,5 +1,5 @@
1
1
  module Wor
2
2
  module Requests
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.add_dependency 'httparty', '~> 0.13'
25
- spec.add_dependency 'railties', '>= 4.1.0', '< 5.1'
25
+ spec.add_dependency 'railties', '>= 4.1.0', '< 5.2'
26
26
 
27
27
  spec.add_development_dependency 'faker'
28
28
  spec.add_development_dependency 'webmock'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wor-requests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - draffo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-03 00:00:00.000000000 Z
12
+ date: 2017-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: 4.1.0
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '5.1'
37
+ version: '5.2'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 4.1.0
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.1'
47
+ version: '5.2'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: faker
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -198,6 +198,7 @@ files:
198
198
  - ".rspec"
199
199
  - ".rubocop.yml"
200
200
  - ".travis.yml"
201
+ - CHANGELOG.md
201
202
  - Gemfile
202
203
  - LICENSE.md
203
204
  - README.md
@@ -232,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
233
  version: '0'
233
234
  requirements: []
234
235
  rubyforge_project:
235
- rubygems_version: 2.6.7
236
+ rubygems_version: 2.6.11
236
237
  signing_key:
237
238
  specification_version: 4
238
239
  summary: Make external requests in you service objects, with easy logging and error