distant 0.1.4 → 0.1.5

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: 11000ca2e279a5ab60f8848ad83ff73a9e412752
4
- data.tar.gz: 74f397589688443544dc0dc61c5a073bc8035f4b
3
+ metadata.gz: 4cc4ec26a4a9e4bdd296eec969e32c67415ebc70
4
+ data.tar.gz: d227f3cf38b58bbca5f38af2985a80872d2274ad
5
5
  SHA512:
6
- metadata.gz: de50b26f9fe809c513c168a9877b6ef097a01b37b0e96ca1f164e353c84d673e41fef56e9658f6e5e5daddea45bbf0e2ac4ccaaa7cc4f017b623679349e26aba
7
- data.tar.gz: 7ce0dc782fc5d42b1b09dc12840cb272a1573365230c346e6b7f74082a01867fca12f2a62568179b97ad04de9e5fa368a20d2d33b8834dfc954ab39763597f19
6
+ metadata.gz: b739b2e08643cc241c71720e6a57446518ea1f2f16da2c40ed5c701018d14019d29fd1c8c2acc2a2a71c6cadf1fc1d559ba7ea9af27d7fab7f6d1166700626b4
7
+ data.tar.gz: 593f74678551b439653706f448748f6d265653ff8d1b543aebe0d6beb104f095ea9adf3f437778997bfdd42af8a6cc3807db7976fd5057eeef331ca2fd02841a
data/distant.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'distant'
3
- spec.version = '0.1.4'
3
+ spec.version = '0.1.5'
4
4
  spec.authors = ['John Drago']
5
5
  spec.email = 'jdrago.999@gmail.com'
6
6
  spec.homepage = 'https://github.com/distant/distant'
data/lib/distant/base.rb CHANGED
@@ -53,7 +53,7 @@ module Distant
53
53
  path = path_closure_generator(route).call(*args)
54
54
  headers = Distant.config.default_headers('')
55
55
  .merge(Distant.config.auth_headers(''))
56
- response_data = preprocess_response connection.get(path, headers)
56
+ response_data = preprocess_response connection.get(path, headers: headers)
57
57
  if response_data.is_a? Array
58
58
  response_data.map{ |item| marshal(item) }
59
59
  else
@@ -68,7 +68,7 @@ module Distant
68
68
  path = self.class.path_closure_generator(route).call(id: self.id)
69
69
  headers = Distant.config.default_headers('')
70
70
  .merge(Distant.config.auth_headers(''))
71
- response_data = self.class.preprocess_response connection.get(path, headers)
71
+ response_data = self.class.preprocess_response connection.get(path, headers: headers)
72
72
  class_ref = Kernel.const_get self.class.to_s.deconstantize + '::' + plural.to_s.singularize.classify
73
73
  response_data.map{ |item| class_ref.marshal(item) }
74
74
  end
@@ -82,7 +82,7 @@ module Distant
82
82
  path = self.class.path_closure_generator(route).call(id: foreign_key_value)
83
83
  headers = Distant.config.default_headers('')
84
84
  .merge(Distant.config.auth_headers(''))
85
- response_data = self.class.preprocess_response connection.get(path, headers)
85
+ response_data = self.class.preprocess_response connection.get(path, headers: headers)
86
86
  class_ref = Kernel.const_get self.class.to_s.deconstantize + '::' + singular.to_s.classify
87
87
  class_ref.marshal(response_data)
88
88
  end
@@ -121,7 +121,7 @@ describe Distant::Base do
121
121
  expect(Distant::BaseTest).to receive(:preprocess_response){ [{id: 123}] }
122
122
  end
123
123
  it 'makes a GET request with the correct route' do
124
- expect(Distant::Connection).to receive(:get).with(@route, {})
124
+ expect(Distant::Connection).to receive(:get).with(@route, headers: {})
125
125
  # Finally:
126
126
  Distant::BaseTest.all
127
127
  end
@@ -131,7 +131,7 @@ describe Distant::Base do
131
131
  expect(Distant::BaseTest).to receive(:preprocess_response){ {id: 123} }
132
132
  end
133
133
  it 'makes a GET request with the correct route' do
134
- expect(Distant::Connection).to receive(:get).with(@single_route.gsub(':id', '123'), {})
134
+ expect(Distant::Connection).to receive(:get).with(@single_route.gsub(':id', '123'), headers: {})
135
135
  # Finally:
136
136
  Distant::BaseTest.find(id: 123)
137
137
  end
@@ -151,7 +151,7 @@ describe Distant::Base do
151
151
  expect(Distant::BaseTest).to receive(:preprocess_response){ [{base_test_id: 123, id: 456}]}
152
152
  end
153
153
  it 'makes a GET request with the correct route' do
154
- expect(Distant::Connection).to receive(:get).with('/base/123/tests', {})
154
+ expect(Distant::Connection).to receive(:get).with('/base/123/tests', headers: {})
155
155
  result = Distant::BaseTest.new(id: 123).sub_tests
156
156
  expect(result.first).to be_a Distant::SubTest
157
157
  end
@@ -171,7 +171,7 @@ describe Distant::Base do
171
171
  expect(Distant::SubTest).to receive(:preprocess_response){ {id: 123, name: 'foo'}}
172
172
  end
173
173
  it 'makes a GET request with the correct route' do
174
- expect(Distant::Connection).to receive(:get).with('/base/123', {})
174
+ expect(Distant::Connection).to receive(:get).with('/base/123', headers: {})
175
175
  result = Distant::SubTest.new(id: 456, base_test_id: 123).base_test
176
176
  expect(result).to be_a Distant::BaseTest
177
177
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Drago