ddy_remote_resource 1.0.0.rc1 → 1.0.0.rc2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f35784393790ebf350ef35b54603bb614377dff0
|
4
|
+
data.tar.gz: c76505446def63c7885faff3af1b0691405d2014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb631e61a3730f260c44dec931ea1da7a97eda48c5dd4f4f56be1456a0d697183083c646cfe8c9210d827fd7bdd5c89594d9285ee28a1beb3f8740169c1b2f0f
|
7
|
+
data.tar.gz: 609cc90d3de1c59bff32be7809df7eb24292d7806a0df1e35f9dbe38c2b7ab77d60608e41abacfd17f96260f17dc8d0e2f712668bbe21ed0ef3163d3e9df4ce1
|
@@ -14,8 +14,8 @@ module RemoteResource
|
|
14
14
|
warn '[DEPRECATION] `.app_host` is deprecated. Please use a different method to determine the site.'
|
15
15
|
end
|
16
16
|
|
17
|
-
def base_url
|
18
|
-
|
17
|
+
def base_url(connection_options = {})
|
18
|
+
RemoteResource::UrlNamingDetermination.new(self, self.connection_options.to_hash.merge(connection_options)).base_url(connection_options[:id], check_collection_options: false)
|
19
19
|
end
|
20
20
|
|
21
21
|
def use_relative_model_naming?
|
@@ -42,9 +42,14 @@ RSpec.describe RemoteResource::UrlNaming do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
describe '.base_url' do
|
45
|
-
it '
|
46
|
-
|
47
|
-
|
45
|
+
it 'returns the base URL which will be used to make the request URL' do
|
46
|
+
aggregate_failures do
|
47
|
+
expect(dummy_class.base_url).to eql 'https://foobar.com/url_naming_dummy'
|
48
|
+
expect(dummy_class.base_url(version: '/api/v2')).to eql 'https://foobar.com/api/v2/url_naming_dummy'
|
49
|
+
expect(dummy_class.base_url(id: 10, collection: true)).to eql 'https://foobar.com/url_naming_dummies/10'
|
50
|
+
expect(dummy_class.base_url(id: 10, collection: true, collection_prefix: '/parent/:parent_id' )).to eql 'https://foobar.com/parent/:parent_id/url_naming_dummies/10'
|
51
|
+
expect(dummy_class.base_url(id: 10, collection: true, collection_prefix: '/parent/:parent_id', collection_options: { parent_id: 18 } )).to eql 'https://foobar.com/parent/18/url_naming_dummies/10'
|
52
|
+
end
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddy_remote_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan van der Pas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|