lhs 15.1.1 → 15.2.0

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: 7ae927be42ef6bb4644591f1176b8188f7edfa97
4
- data.tar.gz: fda7dc77112f3e1a26b799e3479cfc774c2245f2
3
+ metadata.gz: 13a9d25e1f79ac50a05c978ee5f2ab7f7ed7abeb
4
+ data.tar.gz: 2dde05c8df403fdf57199f8cbeade1a024eec3ae
5
5
  SHA512:
6
- metadata.gz: 415c1b6d75efc2c8bd0ef958f5f8936a3ba5fe973a612048b546dc4d4d3610531e2cd05e87e90decfde830749b7d6a349ed887ca300bf34c40397ef9df5350a4
7
- data.tar.gz: ed29d4e0c3c6375d1919d7c3182a5ea6cd20fd51eaa70ea93c5801a351d1976a0d7921eb869c64ee91a5753126de9269aa5e80720bdcc3e5a091f608836fa5e4
6
+ metadata.gz: decf3316e125e44703d005608fa43541b70160d861f7a11d8db2a7ee47af36e10bf5ecedb6eebf5b63c6c72401bc47acb97716b99a09c57af54d8e09b207d3d7
7
+ data.tar.gz: b9492d724ee365fa68183d959c2f245a3cd995ab26f62e5d1209a2b0ba58d472fecdb02a192063e222d796e2760b7d7e8d961cf1d1e2c9df5db12dcbff7b5705
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.requirements << 'Ruby >= 2.3.0'
21
21
  s.required_ruby_version = '>= 2.3.0'
22
22
 
23
- s.add_dependency 'lhc', '>= 7.0.1'
23
+ s.add_dependency 'lhc', '~> 9.1.1'
24
24
  s.add_dependency 'activesupport', '> 4.2'
25
25
  s.add_dependency 'activemodel'
26
26
 
@@ -26,7 +26,7 @@ class LHS::Item < LHS::Proxy
26
26
  private
27
27
 
28
28
  def apply_default_creation_options(options, url, data)
29
- options = options.merge(method: :post, url: url, body: data.to_json)
29
+ options = options.merge(method: :post, url: url, body: data)
30
30
  options[:headers] ||= {}
31
31
  options[:headers].merge!('Content-Type' => 'application/json')
32
32
  options
@@ -33,7 +33,7 @@ class LHS::Item < LHS::Proxy
33
33
  options.merge(
34
34
  method: options.fetch(:method, :post),
35
35
  url: url,
36
- body: data_sent.to_json,
36
+ body: data_sent,
37
37
  headers: { 'Content-Type' => 'application/json' }
38
38
  )
39
39
  )
@@ -43,7 +43,7 @@ class LHS::Item < LHS::Proxy
43
43
  url: url,
44
44
  method: :post,
45
45
  params: params,
46
- body: _data.to_json,
46
+ body: _data,
47
47
  headers: { 'Content-Type' => 'application/json' }
48
48
  )
49
49
  )
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = '15.1.1'
2
+ VERSION = '15.2.0'
3
3
  end
@@ -61,7 +61,7 @@ describe LHS::Record do
61
61
  it 'is also applicable to create' do
62
62
  stub_request(:post, 'http://datastore/v2/records').to_return(body: {}.to_json)
63
63
  expect(LHC).to receive(:request)
64
- .with(options.merge(method: :post, url: "http://datastore/v2/records", body: "{\"name\":\"Steve\"}", headers: { 'Content-Type' => 'application/json' }))
64
+ .with(options.merge(method: :post, url: "http://datastore/v2/records", body: { name: 'Steve' }, headers: { 'Content-Type' => 'application/json' }))
65
65
  .and_call_original
66
66
  Record.options(options).create(name: 'Steve')
67
67
  end
@@ -76,7 +76,7 @@ describe LHS::Record do
76
76
  before(:each) do
77
77
  stub_request(:post, 'http://datastore/v2/records/123').to_return(body: {}.to_json)
78
78
  expect(LHC).to receive(:request)
79
- .with(options.merge(method: :post, url: "http://datastore/v2/records/123", body: "{\"href\":\"http://datastore/v2/records/123\"}", headers: { "Content-Type" => "application/json" }))
79
+ .with(options.merge(method: :post, url: "http://datastore/v2/records/123", body: { href: 'http://datastore/v2/records/123' }, headers: { "Content-Type" => "application/json" }))
80
80
  .and_call_original
81
81
  end
82
82
 
@@ -117,8 +117,9 @@ describe LHS::Record do
117
117
  context 'update' do
118
118
  before(:each) do
119
119
  stub_request(:post, "http://datastore/v2/records/123").to_return(body: {}.to_json)
120
+ body = LHS::Data.new({ href: 'http://datastore/v2/records/123', name: 'steve' }, nil, Record)
120
121
  expect(LHC).to receive(:request)
121
- .with(options.merge(method: :post, url: "http://datastore/v2/records/123", body: "{\"href\":\"http://datastore/v2/records/123\",\"name\":\"steve\"}", headers: { "Content-Type" => "application/json" }))
122
+ .with(options.merge(method: :post, url: "http://datastore/v2/records/123", body: body, headers: { "Content-Type" => "application/json" }))
122
123
  .and_call_original
123
124
  end
124
125
 
@@ -142,8 +143,9 @@ describe LHS::Record do
142
143
  context 'valid' do
143
144
  before(:each) do
144
145
  stub_request(:post, 'http://datastore/v2/records?persist=false').to_return(body: {}.to_json)
146
+ body = LHS::Data.new({ href: 'http://datastore/v2/records/123' }, nil, Record)
145
147
  expect(LHC).to receive(:request)
146
- .with(options.merge(url: '{+datastore}/records', method: :post, params: { persist: false }, body: "{\"href\":\"http://datastore/v2/records/123\"}", headers: { "Content-Type" => "application/json" }))
148
+ .with(options.merge(url: '{+datastore}/records', method: :post, params: { persist: false }, body: body, headers: { "Content-Type" => "application/json" }))
147
149
  .and_call_original
148
150
  end
149
151
 
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.1.1
4
+ version: 15.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhs/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-13 00:00:00.000000000 Z
11
+ date: 2018-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.1
19
+ version: 9.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.1
26
+ version: 9.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -436,7 +436,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
436
436
  requirements:
437
437
  - Ruby >= 2.3.0
438
438
  rubyforge_project:
439
- rubygems_version: 2.6.14
439
+ rubygems_version: 2.6.12
440
440
  signing_key:
441
441
  specification_version: 4
442
442
  summary: Rails gem providing an easy, active-record-like interface for http json services