frodo 0.12.6 → 0.12.7
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 +4 -4
- data/lib/frodo/concerns/api.rb +1 -1
- data/lib/frodo/concerns/base.rb +3 -1
- data/lib/frodo/service.rb +1 -1
- data/lib/frodo/version.rb +1 -1
- data/spec/frodo/concerns/base_spec.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a40dc4c7d9c0ce23fe834d93e91365b8a0d23f60fc42317378a4f9eb021e688
|
4
|
+
data.tar.gz: b2ed79b9746182ef6af02ec480925e87107d2412c4d44316fc36070f28d1511a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 929f1284a12b79d4ad569e043740f6893d1811cefd1f5bf6ca14fd3054c5e287544d6dfb1d7d157e0112c96ad2f755750ee84249a8f20fa03465a140a5323658
|
7
|
+
data.tar.gz: 3521fb729651a1cd94333ab08d7680cd9cd0fbcf5e21c277d26db72dcb15e6821e80efe0bba9d7d68a9de9a586ffb6fdc29ac9f869595f0cda6c1d3a1370783f
|
data/lib/frodo/concerns/api.rb
CHANGED
@@ -41,7 +41,7 @@ module Frodo
|
|
41
41
|
|
42
42
|
def metadata_on_init
|
43
43
|
# Creating Metadata using a different client than the one that is stored
|
44
|
-
Frodo::Client.new(@options).api_get("$metadata").body
|
44
|
+
Frodo::Client.new(@options).api_get("$metadata").body unless @options[:with_metadata]
|
45
45
|
end
|
46
46
|
|
47
47
|
# Public: Execute a query and returns the result.
|
data/lib/frodo/concerns/base.rb
CHANGED
@@ -56,6 +56,8 @@ module Frodo
|
|
56
56
|
#
|
57
57
|
# :request_headers - A hash containing custom headers that will be
|
58
58
|
# appended to each request
|
59
|
+
#
|
60
|
+
# :with_metadata - Flag to specify if we need to use metadata
|
59
61
|
|
60
62
|
def initialize(opts = {})
|
61
63
|
raise ArgumentError, 'Please specify a hash of options' unless opts.is_a?(Hash)
|
@@ -78,7 +80,7 @@ module Frodo
|
|
78
80
|
end
|
79
81
|
|
80
82
|
def service
|
81
|
-
@service ||= Frodo::Service.new(instance_url, strict: false, metadata_document: metadata_on_init)
|
83
|
+
@service ||= Frodo::Service.new(instance_url, strict: false, metadata_document: metadata_on_init, with_metadata: options[:with_metadata] )
|
82
84
|
end
|
83
85
|
|
84
86
|
def inspect
|
data/lib/frodo/service.rb
CHANGED
data/lib/frodo/version.rb
CHANGED
@@ -8,6 +8,7 @@ describe Frodo::Concerns::Base do
|
|
8
8
|
context = self
|
9
9
|
Class.new {
|
10
10
|
include Frodo::Concerns::Connection
|
11
|
+
include Frodo::Concerns::API
|
11
12
|
include context.described_class
|
12
13
|
}
|
13
14
|
end
|
@@ -44,6 +45,41 @@ describe Frodo::Concerns::Base do
|
|
44
45
|
it { should_not raise_error }
|
45
46
|
end
|
46
47
|
|
48
|
+
describe '.service' do
|
49
|
+
subject { client.service }
|
50
|
+
before do
|
51
|
+
allow(client).to receive(:instance_url).and_return("some_url")
|
52
|
+
allow(client).to receive(:metadata_on_init).and_return("")
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when with_metadata is true' do
|
56
|
+
before { allow(client).to receive(:options).and_return({ with_metadata: true }) }
|
57
|
+
|
58
|
+
it 'service options contains :with_metadata' do
|
59
|
+
expect(subject.options.has_key?(:with_metadata)).to be_truthy
|
60
|
+
expect(subject.options[:with_metadata]).to be_truthy
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'when with_metadata is false' do
|
65
|
+
before { allow(client).to receive(:options).and_return({ with_metadata: false }) }
|
66
|
+
|
67
|
+
it 'service options contains :with_metadata' do
|
68
|
+
expect(subject.options.has_key?(:with_metadata)).to be_truthy
|
69
|
+
expect(subject.options[:with_metadata]).to be_falsey
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'when with_metadata not presented in options' do
|
74
|
+
before { allow(client).to receive(:options).and_return({}) }
|
75
|
+
|
76
|
+
it 'service options contains :with_metadata' do
|
77
|
+
expect(subject.options.has_key?(:with_metadata)).to be_truthy
|
78
|
+
expect(subject.options[:with_metadata]).to be_falsey
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
47
83
|
describe '.instance_url' do
|
48
84
|
subject { client.instance_url }
|
49
85
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frodo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emmanuel Pinault
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|