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: e3d2576b744b3dafd66aff8fca6d991f709fa10d
4
- data.tar.gz: b32d6edb8af70dccdfe2b83cf4da340969b7f8b9
3
+ metadata.gz: f35784393790ebf350ef35b54603bb614377dff0
4
+ data.tar.gz: c76505446def63c7885faff3af1b0691405d2014
5
5
  SHA512:
6
- metadata.gz: 3934a8a1d740a88e3cae6e8dc726c6af2bbb99bc35c4d8a25faf8ac6993fedcf5cdf67cf9093c9f6cf299b14eba9be50feb89a3527418720b0a8dc5f6e5f264f
7
- data.tar.gz: 99b67f28cb4284c6100d69340e3f68020f4e13e3a5abedc99d62242858864b4846e9b207b6c1e79fc0834781e5e04a782cc6372bda5558aa06e29ee7a07d601e
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
- warn '[DEPRECATION] `.base_url` is deprecated. Please use the connection_options[:base_url] when querying instead.'
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?
@@ -1,3 +1,3 @@
1
1
  module RemoteResource
2
- VERSION = '1.0.0.rc1'.freeze
2
+ VERSION = '1.0.0.rc2'.freeze
3
3
  end
@@ -42,9 +42,14 @@ RSpec.describe RemoteResource::UrlNaming do
42
42
  end
43
43
 
44
44
  describe '.base_url' do
45
- it 'warns that the method is deprecated' do
46
- expect(dummy_class).to receive(:warn).with('[DEPRECATION] `.base_url` is deprecated. Please use the connection_options[:base_url] when querying instead.')
47
- dummy_class.base_url
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
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe RemoteResource::VERSION do
4
- it { is_expected.to eql '1.0.0.rc1' }
4
+ it { is_expected.to eql '1.0.0.rc2' }
5
5
  end
6
6
 
7
7
 
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.rc1
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-09-16 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler