frodo 0.12.6 → 0.12.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ad72629909d379b037ab935b6f026d9735cfa8ea7f5e2aada9572c8a5dd7f14
4
- data.tar.gz: 96b2ecab8606c359095a304e525cd65f380445a85a0b7f8f6f07ad966657021d
3
+ metadata.gz: 1a40dc4c7d9c0ce23fe834d93e91365b8a0d23f60fc42317378a4f9eb021e688
4
+ data.tar.gz: b2ed79b9746182ef6af02ec480925e87107d2412c4d44316fc36070f28d1511a
5
5
  SHA512:
6
- metadata.gz: ba428ab987ec05e1a04f35d09f3da82e30b05f782f5186c68e95b613d53a23cce06fa2f57e5815c0b09ffd065d33969213c1ce196250e81a520472c6ba360aa7
7
- data.tar.gz: 7c8cb277e3b96fd9893ac508ee008d62789ade50e2a7708b170434a8f8429d9d90ff64a99bfeac1413b40c397470ecb9b45f4c9a7bf010d1bf6c0882ad01aad7
6
+ metadata.gz: 929f1284a12b79d4ad569e043740f6893d1811cefd1f5bf6ca14fd3054c5e287544d6dfb1d7d157e0112c96ad2f755750ee84249a8f20fa03465a140a5323658
7
+ data.tar.gz: 3521fb729651a1cd94333ab08d7680cd9cd0fbcf5e21c277d26db72dcb15e6821e80efe0bba9d7d68a9de9a586ffb6fdc29ac9f869595f0cda6c1d3a1370783f
@@ -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.
@@ -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
@@ -21,7 +21,7 @@ module Frodo
21
21
  @service_url = service_url
22
22
 
23
23
  Frodo::ServiceRegistry.add(self)
24
- register_custom_types
24
+ register_custom_types unless options[:with_metadata]
25
25
  end
26
26
 
27
27
  # Returns user supplied name for service, or its URL
data/lib/frodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Frodo
2
- VERSION = '0.12.6'
2
+ VERSION = '0.12.7'
3
3
  end
@@ -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.6
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: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri