lhs 15.1.1 → 15.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lhs.gemspec +1 -1
- data/lib/lhs/concerns/item/save.rb +1 -1
- data/lib/lhs/concerns/item/update.rb +1 -1
- data/lib/lhs/concerns/item/validation.rb +1 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/record/options_spec.rb +6 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13a9d25e1f79ac50a05c978ee5f2ab7f7ed7abeb
|
4
|
+
data.tar.gz: 2dde05c8df403fdf57199f8cbeade1a024eec3ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: decf3316e125e44703d005608fa43541b70160d861f7a11d8db2a7ee47af36e10bf5ecedb6eebf5b63c6c72401bc47acb97716b99a09c57af54d8e09b207d3d7
|
7
|
+
data.tar.gz: b9492d724ee365fa68183d959c2f245a3cd995ab26f62e5d1209a2b0ba58d472fecdb02a192063e222d796e2760b7d7e8d961cf1d1e2c9df5db12dcbff7b5705
|
data/lhs.gemspec
CHANGED
@@ -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', '
|
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
|
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
|
data/lib/lhs/version.rb
CHANGED
data/spec/record/options_spec.rb
CHANGED
@@ -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:
|
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:
|
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:
|
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:
|
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.
|
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-
|
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:
|
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:
|
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.
|
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
|