rest_api_builder 0.0.5 → 0.1.3

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: 7ca6b82ae8dc6fab46c1804dfe8b7a48a5082fada32c6aad18ec4834953e1b06
4
- data.tar.gz: c9f328a5da83137dc49772eed5e37e5b8647e26195488279d105891fed5c1704
3
+ metadata.gz: 7044c0a51394cd9997b23d7c1189e32a3342cdc63c5b2d15faff2050857d8114
4
+ data.tar.gz: 77684c0bc571a4b424f9e5624bbc25eafd45246b954c0ad1b7f2a2ba20535649
5
5
  SHA512:
6
- metadata.gz: '07918f30ca0bfa5303987f446d0022099084a1cf3ebf47a202aa573b517fa230dbef62502d4645a813a9d174d5647b404c0687a388141c214b6c1ae6aee13b91'
7
- data.tar.gz: adf81df2acb76b6b81673a833ebb813ff6715d5ec3bfcef4c6d5237ace09f465cd4c1231425faff0ea8c4d20a9ca6815b27a22d0dd0a5eec7c074d75a6f51c78
6
+ metadata.gz: e4efb71298656b1703b9b147dfdb9901cb94ab70bc74c013224439270211d9ad92357d7886d0355491eea22bf9b368e33db1a111096da1e643a6dd7807c067c1
7
+ data.tar.gz: 5562e548abb6dc0c8798e6fbe238d07110f41a9bcf8953c31286178dc26d3b6170f22fef14140241e1a47ae43d4482765f9b473db6aee1640432ae347ce38908
data/README.md CHANGED
@@ -8,7 +8,7 @@ RestClient is great, but after building a few API clients with it you will almos
8
8
  - Handling and extracting details from non-200 responses
9
9
  - Creating testing interfaces for your API clients
10
10
 
11
- This library's tries to solve these and similar issues by providing a thin wrapper around [rest-client](https://github.com/rest-client/rest-client) and an optional [webmock](https://github.com/bblimke/webmock) testing interface for it.
11
+ This library's tries to solve these and similar issues by providing a set of helper methods to improve on [rest-client](https://github.com/rest-client/rest-client) features and an optional [webmock](https://github.com/bblimke/webmock) testing interface for it.
12
12
 
13
13
  ## Installation
14
14
  ```
@@ -30,7 +30,7 @@ Simply require webmock interface before your test, for example in your `test_hel
30
30
  describe 'my test' do
31
31
  it 'performs a request' do
32
32
  RestAPIBuilder::WebMockRequestExpectations.expect_execute(...).to_return(body: "hi!")
33
- result = RestAPIBuilder::Request.execute(...)
33
+ result = RestClient::Request.execute(...)
34
34
 
35
35
  # some assertions
36
36
  end
@@ -43,23 +43,39 @@ Simply require webmock interface before your test, for example in your `test_hel
43
43
  ```rb
44
44
  require "rest_api_builder"
45
45
 
46
- Request = RestAPIBuilder::Request
46
+ class MyRequest
47
+ include RestAPIBuilder
48
+
49
+ def execute(options)
50
+ handle_response do
51
+ RestClient::Request.execute(compose_request_options(**options))
52
+ end
53
+ end
54
+
55
+ def json_execute(options)
56
+ handle_json_response do
57
+ RestClient::Request.execute(compose_json_request_options(**options))
58
+ end
59
+ end
60
+ end
61
+
62
+ my_request = MyRequest.new
47
63
 
48
64
  # Simple request:
49
- response = Request.execute(base_url: "example.com", method: :get)
65
+ response = my_request.execute(base_url: "example.com", method: :get)
50
66
  response[:success] #=> true
51
67
  response[:status] #=> 200
52
68
  response[:body] #=> "<!doctype html>\n<html>..."
53
69
  response[:headers] #=> {:accept_ranges=>"bytes", ...}
54
70
 
55
71
  # Non-200 responses:
56
- response = Request.execute(base_url: "example.com", path: "/foo", method: :get)
72
+ response = my_request.execute(base_url: "example.com", path: "/foo", method: :get)
57
73
  response[:success] #=> false
58
74
  response[:status] #=> 404
59
75
  response[:body] #=> "<!doctype html>\n<html>..."
60
76
 
61
77
  # JSON requests:
62
- response = Request.json_execute(base_url: "api.github.com", path: "/users/octocat/orgs", method: :get)
78
+ response = my_request.json_execute(base_url: "api.github.com", path: "/users/octocat/orgs", method: :get)
63
79
  response[:success] #=> true
64
80
  response[:body] #=> []
65
81
  ```
@@ -72,12 +88,29 @@ require "rest_api_builder/webmock_request_expectations"
72
88
 
73
89
  WebMock.disable_net_connect!
74
90
 
75
- Request = RestAPIBuilder::Request
91
+ class MyRequest
92
+ include RestAPIBuilder
93
+
94
+ def execute(options)
95
+ handle_response do
96
+ RestClient::Request.execute(compose_request_options(**options))
97
+ end
98
+ end
99
+
100
+ def json_execute(options)
101
+ handle_json_response do
102
+ RestClient::Request.execute(compose_json_request_options(**options))
103
+ end
104
+ end
105
+ end
106
+
107
+ my_request = MyRequest.new
108
+
76
109
  Expectations = RestAPIBuilder::WebMockRequestExpectations
77
110
 
78
111
  # Simple expectation
79
112
  Expectations.expect_execute(base_url: "test.com", method: :get)
80
- response = Request.execute(base_url: "test.com", method: :get)
113
+ response = my_request.execute(base_url: "test.com", method: :get)
81
114
 
82
115
  response[:success] #=> true
83
116
  response[:status] #=> 200
@@ -88,7 +121,7 @@ response[:headers] #=> {}
88
121
  Expectations
89
122
  .expect_execute(base_url: "test.com", method: :get)
90
123
  .to_return(status: 404, body: "not found")
91
- response = Request.execute(base_url: "test.com", method: :get)
124
+ response = my_request.execute(base_url: "test.com", method: :get)
92
125
 
93
126
  response[:success] #=> false
94
127
  response[:status] #=> 404
@@ -99,13 +132,13 @@ Expectations.expect_execute(
99
132
  base_url: "test.com",
100
133
  method: :post,
101
134
  response: { body: 'hello' },
102
- request: { body: WebMock::API.hash_including({foo: "bar"}) }
135
+ request: { body: { foo: "bar" } } # body will be matched partially using hash_including matcher
103
136
  )
104
- response = Request.json_execute(base_url: "test.com", method: :post, body: {foo: "bar"})
137
+ response = my_request.json_execute(base_url: "test.com", method: :post, body: { foo: "bar", bar: "baz" })
105
138
  response[:success] #=> true
106
139
  response[:body] #=> 'hello'
107
140
 
108
- Request.json_execute(base_url: "test.com", method: :post, body: {bar: "baz"}) # => Raises WebMock::NetConnectNotAllowedError
141
+ my_request.json_execute(base_url: "test.com", method: :post, body: {bar: "baz"}) # => Raises WebMock::NetConnectNotAllowedError
109
142
 
110
143
  # Using #expect_json_execute
111
144
  Expectations.expect_json_execute(
@@ -113,17 +146,14 @@ Expectations.expect_json_execute(
113
146
  method: :get,
114
147
  response: { body: {hi: 'hello'} }
115
148
  )
116
- response = Request.execute(base_url: "test.com", method: :get)
149
+ response = my_request.execute(base_url: "test.com", method: :get)
117
150
  response[:success] #=> true
118
151
  response[:body] #=> "{\"hi\":\"hello\"}"
119
152
  ```
120
153
 
121
154
  ## Request API
122
- ### RestAPIBuilder::Request.execute(options)
123
- Performs a HTTP request via `RestClient::Request.execute`.\
124
- Returns ruby hash with following keys: `:success`, `:status`, `:body`, `:headers`\
125
- Does not throw on non-200 responses like RestClient does, but will throw on any error without defined response(e.g server timeout)
126
-
155
+ ### RestAPIBuilder#compose_request_options(options)
156
+ Composes request options that can be passed to `RestClient::Request.execute`.
127
157
  #### Options:
128
158
  * **base_url**: Base URL of the request. Required.
129
159
  * **method**: HTTP method of the request(e.g :get, :post, :patch). Required.
@@ -131,31 +161,40 @@ Does not throw on non-200 responses like RestClient does, but will throw on any
131
161
  * **body**: Request Body. Optional.
132
162
  * **headers**: Request Headers. Optional.
133
163
  * **query**: Query hash to be appended to the resulting url. Optional.
134
- * **logger**: A `Logger` instance to be passed to RestClient in `log` option. Will also log response details as RestClient does not do this by default. Optional
135
- * **parse_json**: Boolean. If `true`, will attempt to parse the response body as JSON. Will return the response body unchanged if it does not contain valid JSON. `false` by default.
136
- * **raw_response**: Boolean. If `true`, the response returned by RestClient will not be parsed into {:status, :body, :headers}, but instead returned as {:raw_response}. `false` by default.
137
- * **rest_client_options**: Any additional options to be passed to `RestClient::Request.execute` unchanged. **Any option set here will completely overwrite all custom options**. For example, if you call `RestAPIBuilder::Request.execute(method: :post, rest_client_options: {method: :get})`, the resulting request will be sent as GET. Optional.
138
164
 
139
- ### RestAPIBuilder::Request.json_execute(options)
140
- A convenience shortcut for `#execute` which will also:
165
+ ### RestAPIBuilder#compose_json_request_options(options)
166
+ Accepts same options as `compose_request_options` but will also:
141
167
  - Add `Content-Type: 'application/json'` to request `headers`
142
- - Convert request `body` to JSON
143
- - Set `parse_json` option to `true`
168
+ - Convert request `body` to JSON if it's present
169
+
170
+ ### RestAPIBuilder#handle_response(options, &block)
171
+ Executes given block, expecting to receive `RestClient::Response` as a result.\
172
+ Returns **plain ruby hash** with following keys: `:success`, `:status`, `:body`, `:headers`\
173
+ This will also gracefully handle non-200 responses, but will throw on any error without defined response(e.g server timeout)
174
+
175
+ #### Options:
176
+ * **logger**: A `Logger` instance. If provided, will log response details as RestClient wont do this by default. Optional
177
+
178
+ ### RestAPIBuilder#handle_json_response(options, &block)
179
+ Same as `#handle_response` but will also attempt to decode response `:body`, returning it as is if a parsing error occurrs
144
180
 
181
+ ### RestAPIBuilder#handle_response_error(options, &block)
182
+ Low-level API, you can use this method if you want to work with the RestClient's responses directly without any conversions(e.g when using `block_response` or `raw_response` options of RestClient). This will handle errors in the same way as `#handle_response` does, but will not do anything else.\
183
+ Returns ruby hash with `:success` and `:raw_response` keys.
145
184
 
146
185
  ## WebMockRequestExpectations API
147
186
  ### RestAPIBuilder::WebMockRequestExpectations.expect_execute(options)
148
- Defines a request expectation using WebMock's `stub_request`. Returns an instance of `WebMock::RequestStub` on which methods such as `with`, `to_return`, `to_timeout` can be called
187
+ Defines a request expectation using WebMock's `stub_request`. Returns an instance of `WebMock::RequestStub` on which methods such as `with`, `to_return`, `to_timeout` can be called.
149
188
 
150
189
  #### Options:
151
190
  * **base_url**: Base URL of the request. Required.
152
191
  * **method**: HTTP method of the request(e.g :get, :post, :patch). Required.
153
192
  * **path**: Path to be appended to the :base_url. Optional.
154
- * **request**: request details which will be passed to `WebMock::RequestStub#with` if provided. Optional
193
+ * **request**: request details which will be passed to `WebMock::RequestStub#with` if provided. If `query` or `body` keys are present and are hashes, they will be converted into WebMock's `hash_including` matcher. Optional
155
194
  * **response**: response details which will be passed to `WebMock::RequestStub#to_return` if provided. Optional
156
195
 
157
196
  ### RestAPIBuilder::WebMockRequestExpectations.expect_json_execute(options)
158
- A convenience shortcut for `#json_execute` which will convert `request[:body]` to JSON if it's provided
197
+ A convenience shortcut for `#json_execute` which will convert `request[:body]` to JSON if it's present
159
198
 
160
199
  ## License
161
200
  MIT
@@ -1,21 +1,7 @@
1
1
  require 'forwardable'
2
2
  require 'rest_api_builder/request'
3
- require 'rest_api_builder/request_options'
4
- require 'rest_api_builder/response_handler'
3
+ require 'rest_api_builder/api_client'
5
4
 
6
5
  module RestAPIBuilder
7
- extend Forwardable
8
-
9
- def_delegator :request_options, :compose, :compose_request_options
10
- def_delegator :request_options, :compose_json, :compose_json_request_options
11
-
12
- def_delegators :response_handler, :handle_response, :handle_json_response, :handle_response_error
13
-
14
- def request_options
15
- RequestOptions.new
16
- end
17
-
18
- def response_handler
19
- ResponseHandler.new
20
- end
6
+ include RestAPIBuilder::Request
21
7
  end
@@ -0,0 +1,16 @@
1
+ require 'rest_api_builder/helpers/string_helper'
2
+
3
+ module RestAPIBuilder
4
+ module APIClient
5
+ def define_resource_shortcuts(resources, resources_scope:, init_with:)
6
+ resources.each do |name|
7
+ class_name = RestAPIBuilder::Helpers::StringHelper.camelize(name.to_s)
8
+ resource_class = Object.const_get("#{resources_scope}::#{class_name}")
9
+
10
+ define_singleton_method(name) do
11
+ init_with.call(resource_class)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module RestAPIBuilder
2
+ module Helpers
3
+ module StringHelper
4
+ module_function
5
+
6
+ # From https://apidock.com/rails/String/camelize
7
+ def camelize(string)
8
+ string
9
+ .sub(/^[a-z\d]*/, &:capitalize)
10
+ .gsub(/(?:_|(\/))([a-z\d]*)/) { "#{Regexp.last_match(1)}#{Regexp.last_match(2).capitalize}" }
11
+ .gsub("/", "::")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module RestAPIBuilder
2
+ module Helpers
3
+ module UrlHelper
4
+ module_function
5
+
6
+ def full_url(url, path)
7
+ if path
8
+ File.join(url, path)
9
+ else
10
+ url
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,46 +1,18 @@
1
- require 'rest-client'
1
+ require 'forwardable'
2
+ require 'rest_api_builder/request/request_options'
3
+ require 'rest_api_builder/request/response_handler'
2
4
 
3
5
  module RestAPIBuilder
4
- class RequestSingleton
5
- def json_execute(headers: {}, body: nil, **options)
6
- headers = headers.merge(content_type: :json)
7
- body &&= JSON.generate(body)
8
- execute(**options, parse_json: true, headers: headers, body: body)
9
- end
6
+ module Request
7
+ extend Forwardable
10
8
 
11
- def execute(
12
- base_url:,
13
- method:,
14
- body: nil,
15
- headers: {},
16
- query: nil,
17
- path: nil,
18
- logger: nil,
19
- parse_json: false,
20
- raw_response: false,
21
- rest_client_options: {}
22
- )
23
- options = RequestOptions.new.compose(
24
- base_url: base_url,
25
- method: method,
26
- body: body,
27
- headers: headers,
28
- query: query,
29
- path: path
30
- )
9
+ def_delegators RestAPIBuilder::Request::RequestOptions,
10
+ :compose_request_options,
11
+ :compose_json_request_options
31
12
 
32
- response_handler = ResponseHandler.new
33
- execute_request = proc { RestClient::Request.execute(**options, log: logger, **rest_client_options) }
34
-
35
- if parse_json
36
- response_handler.handle_json_response(logger: logger, &execute_request)
37
- elsif raw_response
38
- response_handler.handle_response_error(&execute_request)
39
- else
40
- response_handler.handle_response(logger: logger, &execute_request)
41
- end
42
- end
13
+ def_delegators RestAPIBuilder::Request::ResponseHandler,
14
+ :handle_response,
15
+ :handle_json_response,
16
+ :handle_response_error
43
17
  end
44
-
45
- Request = RequestSingleton.new
46
18
  end
@@ -0,0 +1,37 @@
1
+ require 'rest_api_builder/helpers/url_helper'
2
+
3
+ module RestAPIBuilder
4
+ module Request
5
+ module RequestOptions
6
+ extend RestAPIBuilder::Helpers::UrlHelper
7
+
8
+ module_function
9
+
10
+ def compose_request_options(base_url:, method:, path: nil, body: nil, headers: {}, query: nil)
11
+ if method == :get && body
12
+ raise ArgumentError, 'GET requests do not support body'
13
+ end
14
+
15
+ headers = headers.merge(params: query) if query
16
+
17
+ {
18
+ method: method,
19
+ url: full_url(base_url, path),
20
+ payload: body,
21
+ headers: headers
22
+ }
23
+ end
24
+
25
+ def compose_json_request_options(**options)
26
+ result = compose_request_options(**options)
27
+ headers = result[:headers]
28
+ payload = result[:payload]
29
+
30
+ result.merge(
31
+ headers: headers.merge(content_type: :json),
32
+ payload: payload && JSON.generate(payload)
33
+ )
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,48 @@
1
+ require 'rest-client'
2
+
3
+ module RestAPIBuilder
4
+ module Request
5
+ module ResponseHandler
6
+ module_function
7
+
8
+ def handle_json_response(**options, &block)
9
+ result = handle_response(**options, &block)
10
+ result.merge(body: parse_json(result[:body]))
11
+ end
12
+
13
+ def handle_response(logger: nil, &block)
14
+ result = parse_response(**handle_response_error(&block))
15
+ maybe_log_result(result, logger: logger)
16
+ result
17
+ end
18
+
19
+ def handle_response_error
20
+ response = yield
21
+ { raw_response: response, success: true }
22
+ rescue RestClient::RequestFailed => e
23
+ raise e unless e.response
24
+
25
+ { raw_response: e.response, success: false }
26
+ end
27
+
28
+ def parse_response(raw_response:, success:)
29
+ {
30
+ success: success,
31
+ status: raw_response.code,
32
+ body: raw_response.body,
33
+ headers: raw_response.headers
34
+ }
35
+ end
36
+
37
+ def maybe_log_result(result, logger:)
38
+ logger && logger << "# => Response: #{result}\n"
39
+ end
40
+
41
+ def parse_json(json)
42
+ JSON.parse(json)
43
+ rescue JSON::ParserError
44
+ json
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,10 +1,10 @@
1
1
  require 'webmock'
2
- require 'rest_api_builder/url_helper'
2
+ require 'rest_api_builder/helpers/url_helper'
3
3
 
4
4
  module RestAPIBuilder
5
5
  class WebMockRequestExpectationsSingleton
6
6
  include WebMock::API
7
- include RestAPIBuilder::UrlHelper
7
+ include RestAPIBuilder::Helpers::UrlHelper
8
8
 
9
9
  def expect_json_execute(response: nil, **options)
10
10
  if response && response[:body]
@@ -15,13 +15,30 @@ module RestAPIBuilder
15
15
  end
16
16
 
17
17
  def expect_execute(base_url:, method:, path: nil, request: nil, response: nil)
18
- expectation = stub_request(method, full_url(base_url, path))
18
+ url = path.is_a?(Regexp) ? /#{base_url}#{path}/ : full_url(base_url, path)
19
+ expectation = stub_request(method, url)
20
+
21
+ if !request.nil? && request.any?
22
+ add_request_expectations(expectation, request)
23
+ end
19
24
 
20
- expectation.with(request) if request
21
25
  expectation.to_return(response) if response
22
26
 
23
27
  expectation
24
28
  end
29
+
30
+ def add_request_expectations(expectation, request)
31
+ if request[:body].is_a?(Hash)
32
+ request = request.merge(body: hash_including(request[:body]))
33
+ end
34
+
35
+ if request[:query].is_a?(Hash)
36
+ query = request[:query].transform_values(&:to_s)
37
+ request = request.merge(query: hash_including(query))
38
+ end
39
+
40
+ expectation.with(request)
41
+ end
25
42
  end
26
43
 
27
44
  WebMockRequestExpectations = WebMockRequestExpectationsSingleton.new
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rest_api_builder'
3
- s.version = '0.0.5'
3
+ s.version = '0.1.3'
4
4
  s.summary = "A simple wrapper for rest-client"
5
5
  s.description = "A simple wrapper for rest-client aiming to make creation and testing of API clients easier."
6
6
  s.authors = ["Alexey D"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_api_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey D
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-28 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -62,10 +62,12 @@ files:
62
62
  - LICENSE
63
63
  - README.md
64
64
  - lib/rest_api_builder.rb
65
+ - lib/rest_api_builder/api_client.rb
66
+ - lib/rest_api_builder/helpers/string_helper.rb
67
+ - lib/rest_api_builder/helpers/url_helper.rb
65
68
  - lib/rest_api_builder/request.rb
66
- - lib/rest_api_builder/request_options.rb
67
- - lib/rest_api_builder/response_handler.rb
68
- - lib/rest_api_builder/url_helper.rb
69
+ - lib/rest_api_builder/request/request_options.rb
70
+ - lib/rest_api_builder/request/response_handler.rb
69
71
  - lib/rest_api_builder/webmock_request_expectations.rb
70
72
  - rest_api_builder.gemspec
71
73
  homepage: https://github.com/alexeyds/rest_api_builder
@@ -1,33 +0,0 @@
1
- require 'rest_api_builder/url_helper'
2
-
3
- module RestAPIBuilder
4
- class RequestOptions
5
- include RestAPIBuilder::UrlHelper
6
-
7
- def compose(base_url:, method:, path: nil, body: nil, headers: {}, query: nil)
8
- if method == :get && body
9
- raise ArgumentError, 'GET requests do not support body'
10
- end
11
-
12
- headers = headers.merge(params: query) if query
13
-
14
- {
15
- method: method,
16
- url: full_url(base_url, path),
17
- payload: body,
18
- headers: headers
19
- }
20
- end
21
-
22
- def compose_json(**options)
23
- result = compose(**options)
24
- headers = result[:headers]
25
- payload = result[:payload]
26
-
27
- result.merge(
28
- headers: headers.merge(content_type: :json),
29
- payload: payload && JSON.generate(payload)
30
- )
31
- end
32
- end
33
- end
@@ -1,44 +0,0 @@
1
- module RestAPIBuilder
2
- class ResponseHandler
3
- def handle_json_response(**options, &block)
4
- result = handle_response(**options, &block)
5
- result.merge(body: parse_json(result[:body]))
6
- end
7
-
8
- def handle_response(logger: nil, &block)
9
- result = parse_response(**handle_response_error(&block))
10
- maybe_log_result(result, logger: logger)
11
- result
12
- end
13
-
14
- def handle_response_error
15
- response = yield
16
- { raw_response: response, success: true }
17
- rescue RestClient::RequestFailed => e
18
- raise e unless e.response
19
-
20
- { raw_response: e.response, success: false }
21
- end
22
-
23
- private
24
-
25
- def parse_response(raw_response:, success:)
26
- {
27
- success: success,
28
- status: raw_response.code,
29
- body: raw_response.body,
30
- headers: raw_response.headers
31
- }
32
- end
33
-
34
- def maybe_log_result(result, logger:)
35
- logger && logger << "# => Response: #{result}\n"
36
- end
37
-
38
- def parse_json(json)
39
- JSON.parse(json)
40
- rescue JSON::ParserError
41
- json
42
- end
43
- end
44
- end
@@ -1,11 +0,0 @@
1
- module RestAPIBuilder
2
- module UrlHelper
3
- def full_url(url, path)
4
- if path
5
- File.join(url, path)
6
- else
7
- url
8
- end
9
- end
10
- end
11
- end