coverage/index.html in contentful-2.0.3 vs coverage/index.html in contentful-2.1.0

- old
+ new

@@ -12,31 +12,31 @@ <body> <div id="loading"> <img src="./assets/0.10.0/loading.gif" alt="loading"/> </div> <div id="wrapper" style="display:none;"> - <div class="timestamp">Generated <abbr class="timeago" title="2017-04-24T13:58:37-03:00">2017-04-24T13:58:37-03:00</abbr></div> + <div class="timestamp">Generated <abbr class="timeago" title="2017-05-26T07:55:32-03:00">2017-05-26T07:55:32-03:00</abbr></div> <ul class="group_tabs"></ul> <div id="content"> <div class="file_list_container" id="AllFiles"> <h2> <span class="group_name">All Files</span> - (<span class="covered_percent"><span class="green">98.49%</span></span> + (<span class="covered_percent"><span class="green">98.45%</span></span> covered at <span class="covered_strength"> <span class="green"> - 413.56 + 396.87 </span> </span> hits/line) </h2> <a name="AllFiles"></a> <div> <b>50</b> files in total. - <b>1593</b> relevant lines. - <span class="green"><b>1569</b> lines covered</span> and - <span class="red"><b>24</b> lines missed </span> + <b>1677</b> relevant lines. + <span class="green"><b>1651</b> lines covered</span> and + <span class="red"><b>26</b> lines missed </span> </div> <table class="file_list"> <thead> <tr> <th>File</th> @@ -100,16 +100,16 @@ <td>4310.0</td> </tr> <tr> <td class="strong"><a href="#02d53b1265b3935962cdc88641c7211626bef8f8" class="src_link" title="lib/contentful/client.rb">lib/contentful/client.rb</a></td> - <td class="green strong">97.52 %</td> - <td>347</td> - <td>121</td> - <td>118</td> - <td>3</td> - <td>73.1</td> + <td class="green strong">96.6 %</td> + <td>418</td> + <td>147</td> + <td>142</td> + <td>5</td> + <td>105.5</td> </tr> <tr> <td class="strong"><a href="#8fde43fb81c9f865768b3b2b9b726281963bd2e0" class="src_link" title="lib/contentful/coercions.rb">lib/contentful/coercions.rb</a></td> <td class="green strong">95.65 %</td> @@ -341,13 +341,13 @@ </tr> <tr> <td class="strong"><a href="#bb578f091ede06ee0e73520e211d99d517944b3f" class="src_link" title="spec/client_configuration_spec.rb">spec/client_configuration_spec.rb</a></td> <td class="green strong">100.0 %</td> - <td>205</td> - <td>94</td> - <td>94</td> + <td>350</td> + <td>152</td> + <td>152</td> <td>0</td> <td>1.2</td> </tr> <tr> @@ -505,11 +505,11 @@ <td class="green strong">100.0 %</td> <td>6</td> <td>2</td> <td>2</td> <td>0</td> - <td>88.0</td> + <td>92.0</td> </tr> <tr> <td class="strong"><a href="#f082498d33dd96aab89c6037b28476bc417390d0" class="src_link" title="spec/support/json_responses.rb">spec/support/json_responses.rb</a></td> <td class="green strong">100.0 %</td> @@ -2439,15 +2439,15 @@ </div> <div class="source_table" id="02d53b1265b3935962cdc88641c7211626bef8f8"> <div class="header"> <h3>lib/contentful/client.rb</h3> - <h4><span class="green">97.52 %</span> covered</h4> + <h4><span class="green">96.6 %</span> covered</h4> <div> - <b>121</b> relevant lines. - <span class="green"><b>118</b> lines covered</span> and - <span class="red"><b>3</b> lines missed.</span> + <b>147</b> relevant lines. + <span class="green"><b>142</b> lines covered</span> and + <span class="red"><b>5</b> lines missed.</span> </div> </div> <pre> <ol> @@ -2498,2039 +2498,2465 @@ <span class="hits">1</span> <code class="ruby">require &#39;logger&#39;</code> </li> - <li class="never" data-hits="" data-linenumber="9"> + <li class="covered" data-hits="1" data-linenumber="9"> + <span class="hits">1</span> + <code class="ruby">require &#39;rbconfig&#39;</code> + </li> + + <li class="never" data-hits="" data-linenumber="10"> + <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="10"> + <li class="covered" data-hits="1" data-linenumber="11"> <span class="hits">1</span> <code class="ruby">module Contentful</code> </li> - <li class="never" data-hits="" data-linenumber="11"> + <li class="never" data-hits="" data-linenumber="12"> <code class="ruby"> # The client object is initialized with a space and a key and then used</code> </li> - <li class="never" data-hits="" data-linenumber="12"> + <li class="never" data-hits="" data-linenumber="13"> <code class="ruby"> # for querying resources from this space.</code> </li> - <li class="never" data-hits="" data-linenumber="13"> + <li class="never" data-hits="" data-linenumber="14"> <code class="ruby"> # See README for details</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> + <li class="covered" data-hits="1" data-linenumber="15"> <span class="hits">1</span> <code class="ruby"> class Client</code> </li> - <li class="never" data-hits="" data-linenumber="15"> + <li class="never" data-hits="" data-linenumber="16"> <code class="ruby"> # Default configuration for Contentful::Client</code> </li> - <li class="covered" data-hits="1" data-linenumber="16"> + <li class="covered" data-hits="1" data-linenumber="17"> <span class="hits">1</span> <code class="ruby"> DEFAULT_CONFIGURATION = {</code> </li> - <li class="never" data-hits="" data-linenumber="17"> + <li class="never" data-hits="" data-linenumber="18"> <code class="ruby"> secure: true,</code> </li> - <li class="never" data-hits="" data-linenumber="18"> + <li class="never" data-hits="" data-linenumber="19"> <code class="ruby"> raise_errors: true,</code> </li> - <li class="never" data-hits="" data-linenumber="19"> + <li class="never" data-hits="" data-linenumber="20"> <code class="ruby"> dynamic_entries: :manual,</code> </li> - <li class="never" data-hits="" data-linenumber="20"> + <li class="never" data-hits="" data-linenumber="21"> <code class="ruby"> api_url: &#39;cdn.contentful.com&#39;,</code> </li> - <li class="never" data-hits="" data-linenumber="21"> + <li class="never" data-hits="" data-linenumber="22"> <code class="ruby"> api_version: 1,</code> </li> - <li class="never" data-hits="" data-linenumber="22"> + <li class="never" data-hits="" data-linenumber="23"> <code class="ruby"> authentication_mechanism: :header,</code> </li> - <li class="never" data-hits="" data-linenumber="23"> + <li class="never" data-hits="" data-linenumber="24"> <code class="ruby"> resource_builder: ResourceBuilder,</code> </li> - <li class="never" data-hits="" data-linenumber="24"> + <li class="never" data-hits="" data-linenumber="25"> <code class="ruby"> resource_mapping: {},</code> </li> - <li class="never" data-hits="" data-linenumber="25"> + <li class="never" data-hits="" data-linenumber="26"> <code class="ruby"> entry_mapping: {},</code> </li> - <li class="never" data-hits="" data-linenumber="26"> + <li class="never" data-hits="" data-linenumber="27"> <code class="ruby"> default_locale: &#39;en-US&#39;,</code> </li> - <li class="never" data-hits="" data-linenumber="27"> + <li class="never" data-hits="" data-linenumber="28"> <code class="ruby"> raw_mode: false,</code> </li> - <li class="never" data-hits="" data-linenumber="28"> + <li class="never" data-hits="" data-linenumber="29"> <code class="ruby"> gzip_encoded: true,</code> </li> - <li class="never" data-hits="" data-linenumber="29"> + <li class="never" data-hits="" data-linenumber="30"> <code class="ruby"> logger: false,</code> </li> - <li class="never" data-hits="" data-linenumber="30"> + <li class="never" data-hits="" data-linenumber="31"> <code class="ruby"> log_level: Logger::INFO,</code> </li> - <li class="never" data-hits="" data-linenumber="31"> + <li class="never" data-hits="" data-linenumber="32"> <code class="ruby"> proxy_host: nil,</code> </li> - <li class="never" data-hits="" data-linenumber="32"> + <li class="never" data-hits="" data-linenumber="33"> <code class="ruby"> proxy_username: nil,</code> </li> - <li class="never" data-hits="" data-linenumber="33"> + <li class="never" data-hits="" data-linenumber="34"> <code class="ruby"> proxy_password: nil,</code> </li> - <li class="never" data-hits="" data-linenumber="34"> + <li class="never" data-hits="" data-linenumber="35"> <code class="ruby"> proxy_port: nil,</code> </li> - <li class="never" data-hits="" data-linenumber="35"> + <li class="never" data-hits="" data-linenumber="36"> <code class="ruby"> max_rate_limit_retries: 1,</code> </li> - <li class="never" data-hits="" data-linenumber="36"> + <li class="never" data-hits="" data-linenumber="37"> <code class="ruby"> max_rate_limit_wait: 60,</code> </li> - <li class="never" data-hits="" data-linenumber="37"> + <li class="never" data-hits="" data-linenumber="38"> - <code class="ruby"> max_include_resolution_depth: 20</code> + <code class="ruby"> max_include_resolution_depth: 20,</code> </li> - <li class="never" data-hits="" data-linenumber="38"> + <li class="never" data-hits="" data-linenumber="39"> + <code class="ruby"> application_name: nil,</code> + </li> + + <li class="never" data-hits="" data-linenumber="40"> + + + <code class="ruby"> application_version: nil,</code> + </li> + + <li class="never" data-hits="" data-linenumber="41"> + + + <code class="ruby"> integration_name: nil,</code> + </li> + + <li class="never" data-hits="" data-linenumber="42"> + + + <code class="ruby"> integration_version: nil</code> + </li> + + <li class="never" data-hits="" data-linenumber="43"> + + <code class="ruby"> }</code> </li> - <li class="never" data-hits="" data-linenumber="39"> + <li class="never" data-hits="" data-linenumber="44"> <code class="ruby"> # Rate Limit Reset Header Key</code> </li> - <li class="covered" data-hits="1" data-linenumber="40"> + <li class="covered" data-hits="1" data-linenumber="45"> <span class="hits">1</span> <code class="ruby"> RATE_LIMIT_RESET_HEADER_KEY = &#39;x-contentful-ratelimit-reset&#39;</code> </li> - <li class="never" data-hits="" data-linenumber="41"> + <li class="never" data-hits="" data-linenumber="46"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="42"> + <li class="covered" data-hits="1" data-linenumber="47"> <span class="hits">1</span> <code class="ruby"> attr_reader :configuration, :logger, :proxy</code> </li> - <li class="never" data-hits="" data-linenumber="43"> + <li class="never" data-hits="" data-linenumber="48"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="44"> + <li class="never" data-hits="" data-linenumber="49"> <code class="ruby"> # Wraps the actual HTTP request via proxy</code> </li> - <li class="never" data-hits="" data-linenumber="45"> + <li class="never" data-hits="" data-linenumber="50"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="46"> + <li class="covered" data-hits="1" data-linenumber="51"> <span class="hits">1</span> <code class="ruby"> def self.get_http(url, query, headers = {}, proxy = {})</code> </li> - <li class="covered" data-hits="179" data-linenumber="47"> + <li class="covered" data-hits="179" data-linenumber="52"> <span class="hits">179</span> <code class="ruby"> if proxy[:host]</code> </li> - <li class="missed" data-hits="0" data-linenumber="48"> + <li class="missed" data-hits="0" data-linenumber="53"> <code class="ruby"> HTTP[headers].via(proxy[:host], proxy[:port], proxy[:username], proxy[:password]).get(url, params: query)</code> </li> - <li class="never" data-hits="" data-linenumber="49"> + <li class="never" data-hits="" data-linenumber="54"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="179" data-linenumber="50"> + <li class="covered" data-hits="179" data-linenumber="55"> <span class="hits">179</span> <code class="ruby"> HTTP[headers].get(url, params: query)</code> </li> - <li class="never" data-hits="" data-linenumber="51"> + <li class="never" data-hits="" data-linenumber="56"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="52"> + <li class="never" data-hits="" data-linenumber="57"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="53"> + <li class="never" data-hits="" data-linenumber="58"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="54"> + <li class="never" data-hits="" data-linenumber="59"> <code class="ruby"> # @see _ https://github.com/contentful/contentful.rb#client-configuration-options</code> </li> - <li class="never" data-hits="" data-linenumber="55"> + <li class="never" data-hits="" data-linenumber="60"> <code class="ruby"> # @param [Hash] given_configuration</code> </li> - <li class="never" data-hits="" data-linenumber="56"> + <li class="never" data-hits="" data-linenumber="61"> <code class="ruby"> # @option given_configuration [String] :space Required</code> </li> - <li class="never" data-hits="" data-linenumber="57"> + <li class="never" data-hits="" data-linenumber="62"> <code class="ruby"> # @option given_configuration [String] :access_token Required</code> </li> - <li class="never" data-hits="" data-linenumber="58"> + <li class="never" data-hits="" data-linenumber="63"> <code class="ruby"> # @option given_configuration [String] :api_url Modifying this to &#39;preview.contentful.com&#39; gives you access to our Preview API</code> </li> - <li class="never" data-hits="" data-linenumber="59"> + <li class="never" data-hits="" data-linenumber="64"> <code class="ruby"> # @option given_configuration [String] :api_version</code> </li> - <li class="never" data-hits="" data-linenumber="60"> + <li class="never" data-hits="" data-linenumber="65"> <code class="ruby"> # @option given_configuration [String] :default_locale</code> </li> - <li class="never" data-hits="" data-linenumber="61"> + <li class="never" data-hits="" data-linenumber="66"> <code class="ruby"> # @option given_configuration [String] :proxy_host</code> </li> - <li class="never" data-hits="" data-linenumber="62"> + <li class="never" data-hits="" data-linenumber="67"> <code class="ruby"> # @option given_configuration [String] :proxy_username</code> </li> - <li class="never" data-hits="" data-linenumber="63"> + <li class="never" data-hits="" data-linenumber="68"> <code class="ruby"> # @option given_configuration [String] :proxy_password</code> </li> - <li class="never" data-hits="" data-linenumber="64"> + <li class="never" data-hits="" data-linenumber="69"> <code class="ruby"> # @option given_configuration [Number] :proxy_port</code> </li> - <li class="never" data-hits="" data-linenumber="65"> + <li class="never" data-hits="" data-linenumber="70"> <code class="ruby"> # @option given_configuration [Number] :max_rate_limit_retries</code> </li> - <li class="never" data-hits="" data-linenumber="66"> + <li class="never" data-hits="" data-linenumber="71"> <code class="ruby"> # @option given_configuration [Number] :max_rate_limit_wait</code> </li> - <li class="never" data-hits="" data-linenumber="67"> + <li class="never" data-hits="" data-linenumber="72"> <code class="ruby"> # @option given_configuration [Number] :max_include_resolution_depth</code> </li> - <li class="never" data-hits="" data-linenumber="68"> + <li class="never" data-hits="" data-linenumber="73"> <code class="ruby"> # @option given_configuration [Boolean] :gzip_encoded</code> </li> - <li class="never" data-hits="" data-linenumber="69"> + <li class="never" data-hits="" data-linenumber="74"> <code class="ruby"> # @option given_configuration [Boolean] :raw_mode</code> </li> - <li class="never" data-hits="" data-linenumber="70"> + <li class="never" data-hits="" data-linenumber="75"> <code class="ruby"> # @option given_configuration [false, ::Logger] :logger</code> </li> - <li class="never" data-hits="" data-linenumber="71"> + <li class="never" data-hits="" data-linenumber="76"> <code class="ruby"> # @option given_configuration [::Logger::DEBUG, ::Logger::INFO, ::Logger::WARN, ::Logger::ERROR] :log_level</code> </li> - <li class="never" data-hits="" data-linenumber="72"> + <li class="never" data-hits="" data-linenumber="77"> <code class="ruby"> # @option given_configuration [Boolean] :raise_errors</code> </li> - <li class="never" data-hits="" data-linenumber="73"> + <li class="never" data-hits="" data-linenumber="78"> <code class="ruby"> # @option given_configuration [::Array&lt;String&gt;] :dynamic_entries</code> </li> - <li class="never" data-hits="" data-linenumber="74"> + <li class="never" data-hits="" data-linenumber="79"> <code class="ruby"> # @option given_configuration [::Hash&lt;String, Contentful::Resource&gt;] :resource_mapping</code> </li> - <li class="never" data-hits="" data-linenumber="75"> + <li class="never" data-hits="" data-linenumber="80"> <code class="ruby"> # @option given_configuration [::Hash&lt;String, Contentful::Resource&gt;] :entry_mapping</code> </li> - <li class="covered" data-hits="1" data-linenumber="76"> + <li class="never" data-hits="" data-linenumber="81"> + + + <code class="ruby"> # @option given_configuration [String] :application_name</code> + </li> + + <li class="never" data-hits="" data-linenumber="82"> + + + <code class="ruby"> # @option given_configuration [String] :application_version</code> + </li> + + <li class="never" data-hits="" data-linenumber="83"> + + + <code class="ruby"> # @option given_configuration [String] :integration_name</code> + </li> + + <li class="never" data-hits="" data-linenumber="84"> + + + <code class="ruby"> # @option given_configuration [String] :integration_version</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="85"> <span class="hits">1</span> <code class="ruby"> def initialize(given_configuration = {})</code> </li> - <li class="covered" data-hits="185" data-linenumber="77"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="86"> + <span class="hits">193</span> <code class="ruby"> @configuration = default_configuration.merge(given_configuration)</code> </li> - <li class="covered" data-hits="185" data-linenumber="78"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="87"> + <span class="hits">193</span> <code class="ruby"> normalize_configuration!</code> </li> - <li class="covered" data-hits="185" data-linenumber="79"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="88"> + <span class="hits">193</span> <code class="ruby"> validate_configuration!</code> </li> - <li class="covered" data-hits="183" data-linenumber="80"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="89"> + <span class="hits">191</span> <code class="ruby"> setup_logger</code> </li> - <li class="never" data-hits="" data-linenumber="81"> + <li class="never" data-hits="" data-linenumber="90"> <code class="ruby"></code> </li> - <li class="covered" data-hits="183" data-linenumber="82"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="91"> + <span class="hits">191</span> <code class="ruby"> update_dynamic_entry_cache! if configuration[:dynamic_entries] == :auto</code> </li> - <li class="never" data-hits="" data-linenumber="83"> + <li class="never" data-hits="" data-linenumber="92"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="84"> + <li class="never" data-hits="" data-linenumber="93"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="85"> + <li class="never" data-hits="" data-linenumber="94"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="86"> + <li class="covered" data-hits="1" data-linenumber="95"> <span class="hits">1</span> <code class="ruby"> def setup_logger</code> </li> - <li class="covered" data-hits="183" data-linenumber="87"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="96"> + <span class="hits">191</span> <code class="ruby"> @logger = configuration[:logger]</code> </li> - <li class="covered" data-hits="183" data-linenumber="88"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="97"> + <span class="hits">191</span> <code class="ruby"> logger.level = configuration[:log_level] if logger</code> </li> - <li class="never" data-hits="" data-linenumber="89"> + <li class="never" data-hits="" data-linenumber="98"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="90"> + <li class="never" data-hits="" data-linenumber="99"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="91"> + <li class="never" data-hits="" data-linenumber="100"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="92"> + <li class="covered" data-hits="1" data-linenumber="101"> <span class="hits">1</span> <code class="ruby"> def proxy_params</code> </li> - <li class="never" data-hits="" data-linenumber="93"> + <li class="never" data-hits="" data-linenumber="102"> <code class="ruby"> {</code> </li> - <li class="never" data-hits="" data-linenumber="94"> + <li class="never" data-hits="" data-linenumber="103"> <code class="ruby"> host: configuration[:proxy_host],</code> </li> - <li class="never" data-hits="" data-linenumber="95"> + <li class="never" data-hits="" data-linenumber="104"> <code class="ruby"> port: configuration[:proxy_port],</code> </li> - <li class="never" data-hits="" data-linenumber="96"> + <li class="never" data-hits="" data-linenumber="105"> <code class="ruby"> username: configuration[:proxy_username],</code> </li> - <li class="never" data-hits="" data-linenumber="97"> + <li class="never" data-hits="" data-linenumber="106"> <code class="ruby"> password: configuration[:proxy_password]</code> </li> - <li class="covered" data-hits="185" data-linenumber="98"> + <li class="covered" data-hits="185" data-linenumber="107"> <span class="hits">185</span> <code class="ruby"> }</code> </li> - <li class="never" data-hits="" data-linenumber="99"> + <li class="never" data-hits="" data-linenumber="108"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="100"> + <li class="never" data-hits="" data-linenumber="109"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="101"> + <li class="never" data-hits="" data-linenumber="110"> <code class="ruby"> # Returns the default configuration</code> </li> - <li class="never" data-hits="" data-linenumber="102"> + <li class="never" data-hits="" data-linenumber="111"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="103"> + <li class="covered" data-hits="1" data-linenumber="112"> <span class="hits">1</span> <code class="ruby"> def default_configuration</code> </li> - <li class="covered" data-hits="185" data-linenumber="104"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="113"> + <span class="hits">193</span> <code class="ruby"> DEFAULT_CONFIGURATION.dup</code> </li> - <li class="never" data-hits="" data-linenumber="105"> + <li class="never" data-hits="" data-linenumber="114"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="106"> + <li class="never" data-hits="" data-linenumber="115"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="107"> + <li class="never" data-hits="" data-linenumber="116"> <code class="ruby"> # Gets the client&#39;s space</code> </li> - <li class="never" data-hits="" data-linenumber="108"> + <li class="never" data-hits="" data-linenumber="117"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="109"> + <li class="never" data-hits="" data-linenumber="118"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="110"> + <li class="never" data-hits="" data-linenumber="119"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="111"> + <li class="never" data-hits="" data-linenumber="120"> <code class="ruby"> # @return [Contentful::Space]</code> </li> - <li class="covered" data-hits="1" data-linenumber="112"> + <li class="covered" data-hits="1" data-linenumber="121"> <span class="hits">1</span> <code class="ruby"> def space(query = {})</code> </li> - <li class="covered" data-hits="9" data-linenumber="113"> + <li class="covered" data-hits="9" data-linenumber="122"> <span class="hits">9</span> <code class="ruby"> Request.new(self, &#39;&#39;, query).get</code> </li> - <li class="never" data-hits="" data-linenumber="114"> + <li class="never" data-hits="" data-linenumber="123"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="115"> + <li class="never" data-hits="" data-linenumber="124"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="116"> + <li class="never" data-hits="" data-linenumber="125"> <code class="ruby"> # Gets a specific content type</code> </li> - <li class="never" data-hits="" data-linenumber="117"> + <li class="never" data-hits="" data-linenumber="126"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="118"> + <li class="never" data-hits="" data-linenumber="127"> <code class="ruby"> # @param [String] id</code> </li> - <li class="never" data-hits="" data-linenumber="119"> + <li class="never" data-hits="" data-linenumber="128"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="120"> + <li class="never" data-hits="" data-linenumber="129"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="121"> + <li class="never" data-hits="" data-linenumber="130"> <code class="ruby"> # @return [Contentful::ContentType]</code> </li> - <li class="covered" data-hits="1" data-linenumber="122"> + <li class="covered" data-hits="1" data-linenumber="131"> <span class="hits">1</span> <code class="ruby"> def content_type(id, query = {})</code> </li> - <li class="covered" data-hits="22" data-linenumber="123"> + <li class="covered" data-hits="22" data-linenumber="132"> <span class="hits">22</span> <code class="ruby"> Request.new(self, &#39;/content_types&#39;, query, id).get</code> </li> - <li class="never" data-hits="" data-linenumber="124"> + <li class="never" data-hits="" data-linenumber="133"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="125"> + <li class="never" data-hits="" data-linenumber="134"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="126"> + <li class="never" data-hits="" data-linenumber="135"> <code class="ruby"> # Gets a collection of content types</code> </li> - <li class="never" data-hits="" data-linenumber="127"> + <li class="never" data-hits="" data-linenumber="136"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="128"> + <li class="never" data-hits="" data-linenumber="137"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="129"> + <li class="never" data-hits="" data-linenumber="138"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="130"> + <li class="never" data-hits="" data-linenumber="139"> <code class="ruby"> # @return [Contentful::Array&lt;Contentful::ContentType&gt;]</code> </li> - <li class="covered" data-hits="1" data-linenumber="131"> + <li class="covered" data-hits="1" data-linenumber="140"> <span class="hits">1</span> <code class="ruby"> def content_types(query = {})</code> </li> - <li class="covered" data-hits="22" data-linenumber="132"> + <li class="covered" data-hits="22" data-linenumber="141"> <span class="hits">22</span> <code class="ruby"> Request.new(self, &#39;/content_types&#39;, query).get</code> </li> - <li class="never" data-hits="" data-linenumber="133"> + <li class="never" data-hits="" data-linenumber="142"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="134"> + <li class="never" data-hits="" data-linenumber="143"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="135"> + <li class="never" data-hits="" data-linenumber="144"> <code class="ruby"> # Gets a specific entry</code> </li> - <li class="never" data-hits="" data-linenumber="136"> + <li class="never" data-hits="" data-linenumber="145"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="137"> + <li class="never" data-hits="" data-linenumber="146"> <code class="ruby"> # @param [String] id</code> </li> - <li class="never" data-hits="" data-linenumber="138"> + <li class="never" data-hits="" data-linenumber="147"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="139"> + <li class="never" data-hits="" data-linenumber="148"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="140"> + <li class="never" data-hits="" data-linenumber="149"> <code class="ruby"> # @return [Contentful::Entry]</code> </li> - <li class="covered" data-hits="1" data-linenumber="141"> + <li class="covered" data-hits="1" data-linenumber="150"> <span class="hits">1</span> <code class="ruby"> def entry(id, query = {})</code> </li> - <li class="covered" data-hits="29" data-linenumber="142"> + <li class="covered" data-hits="29" data-linenumber="151"> <span class="hits">29</span> <code class="ruby"> normalize_select!(query)</code> </li> - <li class="covered" data-hits="29" data-linenumber="143"> + <li class="covered" data-hits="29" data-linenumber="152"> <span class="hits">29</span> <code class="ruby"> query[&#39;sys.id&#39;] = id</code> </li> - <li class="covered" data-hits="29" data-linenumber="144"> + <li class="covered" data-hits="29" data-linenumber="153"> <span class="hits">29</span> <code class="ruby"> entries = Request.new(self, &#39;/entries&#39;, query).get</code> </li> - <li class="never" data-hits="" data-linenumber="145"> + <li class="never" data-hits="" data-linenumber="154"> <code class="ruby"></code> </li> - <li class="covered" data-hits="26" data-linenumber="146"> + <li class="covered" data-hits="26" data-linenumber="155"> <span class="hits">26</span> <code class="ruby"> return entries if configuration[:raw_mode]</code> </li> - <li class="never" data-hits="" data-linenumber="147"> + <li class="never" data-hits="" data-linenumber="156"> <code class="ruby"></code> </li> - <li class="covered" data-hits="25" data-linenumber="148"> + <li class="covered" data-hits="25" data-linenumber="157"> <span class="hits">25</span> <code class="ruby"> entries.first</code> </li> - <li class="never" data-hits="" data-linenumber="149"> + <li class="never" data-hits="" data-linenumber="158"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="150"> + <li class="never" data-hits="" data-linenumber="159"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="151"> + <li class="never" data-hits="" data-linenumber="160"> <code class="ruby"> # Gets a collection of entries</code> </li> - <li class="never" data-hits="" data-linenumber="152"> + <li class="never" data-hits="" data-linenumber="161"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="153"> + <li class="never" data-hits="" data-linenumber="162"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="154"> + <li class="never" data-hits="" data-linenumber="163"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="155"> + <li class="never" data-hits="" data-linenumber="164"> <code class="ruby"> # @return [Contentful::Array&lt;Contentful::Entry&gt;]</code> </li> - <li class="covered" data-hits="1" data-linenumber="156"> + <li class="covered" data-hits="1" data-linenumber="165"> <span class="hits">1</span> <code class="ruby"> def entries(query = {})</code> </li> - <li class="covered" data-hits="17" data-linenumber="157"> + <li class="covered" data-hits="17" data-linenumber="166"> <span class="hits">17</span> <code class="ruby"> normalize_select!(query)</code> </li> - <li class="covered" data-hits="17" data-linenumber="158"> + <li class="covered" data-hits="17" data-linenumber="167"> <span class="hits">17</span> <code class="ruby"> Request.new(self, &#39;/entries&#39;, query).get</code> </li> - <li class="never" data-hits="" data-linenumber="159"> + <li class="never" data-hits="" data-linenumber="168"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="160"> + <li class="never" data-hits="" data-linenumber="169"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="161"> + <li class="never" data-hits="" data-linenumber="170"> <code class="ruby"> # Gets a specific asset</code> </li> - <li class="never" data-hits="" data-linenumber="162"> + <li class="never" data-hits="" data-linenumber="171"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="163"> + <li class="never" data-hits="" data-linenumber="172"> <code class="ruby"> # @param [String] id</code> </li> - <li class="never" data-hits="" data-linenumber="164"> + <li class="never" data-hits="" data-linenumber="173"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="165"> + <li class="never" data-hits="" data-linenumber="174"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="166"> + <li class="never" data-hits="" data-linenumber="175"> <code class="ruby"> # @return [Contentful::Asset]</code> </li> - <li class="covered" data-hits="1" data-linenumber="167"> + <li class="covered" data-hits="1" data-linenumber="176"> <span class="hits">1</span> <code class="ruby"> def asset(id, query = {})</code> </li> - <li class="covered" data-hits="20" data-linenumber="168"> + <li class="covered" data-hits="20" data-linenumber="177"> <span class="hits">20</span> <code class="ruby"> Request.new(self, &#39;/assets&#39;, query, id).get</code> </li> - <li class="never" data-hits="" data-linenumber="169"> + <li class="never" data-hits="" data-linenumber="178"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="170"> + <li class="never" data-hits="" data-linenumber="179"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="171"> + <li class="never" data-hits="" data-linenumber="180"> <code class="ruby"> # Gets a collection of assets</code> </li> - <li class="never" data-hits="" data-linenumber="172"> + <li class="never" data-hits="" data-linenumber="181"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="173"> + <li class="never" data-hits="" data-linenumber="182"> <code class="ruby"> # @param [Hash] query</code> </li> - <li class="never" data-hits="" data-linenumber="174"> + <li class="never" data-hits="" data-linenumber="183"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="175"> + <li class="never" data-hits="" data-linenumber="184"> <code class="ruby"> # @return [Contentful::Array&lt;Contentful::Asset&gt;]</code> </li> - <li class="covered" data-hits="1" data-linenumber="176"> + <li class="covered" data-hits="1" data-linenumber="185"> <span class="hits">1</span> <code class="ruby"> def assets(query = {})</code> </li> - <li class="covered" data-hits="9" data-linenumber="177"> + <li class="covered" data-hits="9" data-linenumber="186"> <span class="hits">9</span> <code class="ruby"> normalize_select!(query)</code> </li> - <li class="covered" data-hits="9" data-linenumber="178"> + <li class="covered" data-hits="9" data-linenumber="187"> <span class="hits">9</span> <code class="ruby"> Request.new(self, &#39;/assets&#39;, query).get</code> </li> - <li class="never" data-hits="" data-linenumber="179"> + <li class="never" data-hits="" data-linenumber="188"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="180"> + <li class="never" data-hits="" data-linenumber="189"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="181"> + <li class="never" data-hits="" data-linenumber="190"> <code class="ruby"> # Returns the base url for all of the client&#39;s requests</code> </li> - <li class="never" data-hits="" data-linenumber="182"> + <li class="never" data-hits="" data-linenumber="191"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="183"> + <li class="covered" data-hits="1" data-linenumber="192"> <span class="hits">1</span> <code class="ruby"> def base_url</code> </li> - <li class="covered" data-hits="169" data-linenumber="184"> + <li class="covered" data-hits="169" data-linenumber="193"> <span class="hits">169</span> <code class="ruby"> &quot;http#{configuration[:secure] ? &#39;s&#39; : &#39;&#39;}://#{configuration[:api_url]}/spaces/#{configuration[:space]}&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="185"> + <li class="never" data-hits="" data-linenumber="194"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="186"> + <li class="never" data-hits="" data-linenumber="195"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="187"> + <li class="never" data-hits="" data-linenumber="196"> + <code class="ruby"> # Returns the formatted part of the X-Contentful-User-Agent header</code> + </li> + + <li class="never" data-hits="" data-linenumber="197"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="198"> + <span class="hits">1</span> + + <code class="ruby"> def format_user_agent_header(key, values)</code> + </li> + + <li class="covered" data-hits="711" data-linenumber="199"> + <span class="hits">711</span> + + <code class="ruby"> header = &quot;#{key} #{values[:name]}&quot;</code> + </li> + + <li class="covered" data-hits="711" data-linenumber="200"> + <span class="hits">711</span> + + <code class="ruby"> header = &quot;#{header}/#{values[:version]}&quot; if values[:version]</code> + </li> + + <li class="covered" data-hits="711" data-linenumber="201"> + <span class="hits">711</span> + + <code class="ruby"> &quot;#{header};&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="202"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="203"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="204"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent sdk data</code> + </li> + + <li class="never" data-hits="" data-linenumber="205"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="206"> + <span class="hits">1</span> + + <code class="ruby"> def sdk_info</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="207"> + <span class="hits">227</span> + + <code class="ruby"> { name: &#39;contentful.rb&#39;, version: ::Contentful::VERSION }</code> + </li> + + <li class="never" data-hits="" data-linenumber="208"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="209"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="210"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent app data</code> + </li> + + <li class="never" data-hits="" data-linenumber="211"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="212"> + <span class="hits">1</span> + + <code class="ruby"> def app_info</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="213"> + <span class="hits">227</span> + + <code class="ruby"> { name: configuration[:application_name], version: configuration[:application_version] }</code> + </li> + + <li class="never" data-hits="" data-linenumber="214"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="215"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="216"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent integration data</code> + </li> + + <li class="never" data-hits="" data-linenumber="217"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="218"> + <span class="hits">1</span> + + <code class="ruby"> def integration_info</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="219"> + <span class="hits">227</span> + + <code class="ruby"> { name: configuration[:integration_name], version: configuration[:integration_version] }</code> + </li> + + <li class="never" data-hits="" data-linenumber="220"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="221"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="222"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent platform data</code> + </li> + + <li class="never" data-hits="" data-linenumber="223"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="224"> + <span class="hits">1</span> + + <code class="ruby"> def platform_info</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="225"> + <span class="hits">227</span> + + <code class="ruby"> { name: &#39;ruby&#39;, version: RUBY_VERSION }</code> + </li> + + <li class="never" data-hits="" data-linenumber="226"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="227"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="228"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent os data</code> + </li> + + <li class="never" data-hits="" data-linenumber="229"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="230"> + <span class="hits">1</span> + + <code class="ruby"> def os_info</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="231"> + <span class="hits">227</span> + + <code class="ruby"> os_name = case ::RbConfig::CONFIG[&#39;host_os&#39;]</code> + </li> + + <li class="missed" data-hits="0" data-linenumber="232"> + + + <code class="ruby"> when /(cygwin|mingw|mswin|windows)/i then &#39;Windows&#39;</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="233"> + <span class="hits">227</span> + + <code class="ruby"> when /(darwin|macruby|mac os)/i then &#39;macOS&#39;</code> + </li> + + <li class="missed" data-hits="0" data-linenumber="234"> + + + <code class="ruby"> when /(linux|bsd|aix|solarix)/i then &#39;Linux&#39;</code> + </li> + + <li class="never" data-hits="" data-linenumber="235"> + + + <code class="ruby"> end</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="236"> + <span class="hits">227</span> + + <code class="ruby"> { name: os_name, version: Gem::Platform.local.version }</code> + </li> + + <li class="never" data-hits="" data-linenumber="237"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="238"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="239"> + + + <code class="ruby"> # Returns the X-Contentful-User-Agent</code> + </li> + + <li class="never" data-hits="" data-linenumber="240"> + + + <code class="ruby"> # @private</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="241"> + <span class="hits">1</span> + + <code class="ruby"> def contentful_user_agent</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="242"> + <span class="hits">227</span> + + <code class="ruby"> header = {</code> + </li> + + <li class="never" data-hits="" data-linenumber="243"> + + + <code class="ruby"> &#39;sdk&#39; =&gt; sdk_info,</code> + </li> + + <li class="never" data-hits="" data-linenumber="244"> + + + <code class="ruby"> &#39;app&#39; =&gt; app_info,</code> + </li> + + <li class="never" data-hits="" data-linenumber="245"> + + + <code class="ruby"> &#39;integration&#39; =&gt; integration_info,</code> + </li> + + <li class="never" data-hits="" data-linenumber="246"> + + + <code class="ruby"> &#39;platform&#39; =&gt; platform_info,</code> + </li> + + <li class="never" data-hits="" data-linenumber="247"> + + + <code class="ruby"> &#39;os&#39; =&gt; os_info</code> + </li> + + <li class="never" data-hits="" data-linenumber="248"> + + + <code class="ruby"> }</code> + </li> + + <li class="never" data-hits="" data-linenumber="249"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="227" data-linenumber="250"> + <span class="hits">227</span> + + <code class="ruby"> result = []</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="251"> + <span class="hits">227</span> + + <code class="ruby"> header.each do |key, values|</code> + </li> + + <li class="covered" data-hits="1135" data-linenumber="252"> + <span class="hits">1135</span> + + <code class="ruby"> next unless values[:name]</code> + </li> + + <li class="covered" data-hits="711" data-linenumber="253"> + <span class="hits">711</span> + + <code class="ruby"> result &lt;&lt; format_user_agent_header(key, values)</code> + </li> + + <li class="never" data-hits="" data-linenumber="254"> + + + <code class="ruby"> end</code> + </li> + + <li class="covered" data-hits="227" data-linenumber="255"> + <span class="hits">227</span> + + <code class="ruby"> result.join(&#39; &#39;)</code> + </li> + + <li class="never" data-hits="" data-linenumber="256"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="257"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="258"> + + <code class="ruby"> # Returns the headers used for the HTTP requests</code> </li> - <li class="never" data-hits="" data-linenumber="188"> + <li class="never" data-hits="" data-linenumber="259"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="189"> + <li class="covered" data-hits="1" data-linenumber="260"> <span class="hits">1</span> <code class="ruby"> def request_headers</code> </li> - <li class="covered" data-hits="190" data-linenumber="190"> - <span class="hits">190</span> + <li class="covered" data-hits="191" data-linenumber="261"> + <span class="hits">191</span> - <code class="ruby"> headers = { &#39;User-Agent&#39; =&gt; &quot;RubyContentfulGem/#{Contentful::VERSION}&quot; }</code> + <code class="ruby"> headers = { &#39;X-Contentful-User-Agent&#39; =&gt; contentful_user_agent }</code> </li> - <li class="covered" data-hits="190" data-linenumber="191"> - <span class="hits">190</span> + <li class="covered" data-hits="191" data-linenumber="262"> + <span class="hits">191</span> <code class="ruby"> headers[&#39;Authorization&#39;] = &quot;Bearer #{configuration[:access_token]}&quot; if configuration[:authentication_mechanism] == :header</code> </li> - <li class="covered" data-hits="190" data-linenumber="192"> - <span class="hits">190</span> + <li class="covered" data-hits="191" data-linenumber="263"> + <span class="hits">191</span> <code class="ruby"> headers[&#39;Content-Type&#39;] = &quot;application/vnd.contentful.delivery.v#{configuration[:api_version].to_i}+json&quot; if configuration[:api_version]</code> </li> - <li class="covered" data-hits="190" data-linenumber="193"> - <span class="hits">190</span> + <li class="covered" data-hits="191" data-linenumber="264"> + <span class="hits">191</span> <code class="ruby"> headers[&#39;Accept-Encoding&#39;] = &#39;gzip&#39; if configuration[:gzip_encoded]</code> </li> - <li class="covered" data-hits="190" data-linenumber="194"> - <span class="hits">190</span> + <li class="covered" data-hits="191" data-linenumber="265"> + <span class="hits">191</span> <code class="ruby"> headers</code> </li> - <li class="never" data-hits="" data-linenumber="195"> + <li class="never" data-hits="" data-linenumber="266"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="196"> + <li class="never" data-hits="" data-linenumber="267"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="197"> + <li class="never" data-hits="" data-linenumber="268"> <code class="ruby"> # Patches a query hash with the client configurations for queries</code> </li> - <li class="never" data-hits="" data-linenumber="198"> + <li class="never" data-hits="" data-linenumber="269"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="199"> + <li class="covered" data-hits="1" data-linenumber="270"> <span class="hits">1</span> <code class="ruby"> def request_query(query)</code> </li> - <li class="covered" data-hits="183" data-linenumber="200"> + <li class="covered" data-hits="183" data-linenumber="271"> <span class="hits">183</span> <code class="ruby"> if configuration[:authentication_mechanism] == :query_string</code> </li> - <li class="covered" data-hits="1" data-linenumber="201"> + <li class="covered" data-hits="1" data-linenumber="272"> <span class="hits">1</span> <code class="ruby"> query[&#39;access_token&#39;] = configuration[:access_token]</code> </li> - <li class="never" data-hits="" data-linenumber="202"> + <li class="never" data-hits="" data-linenumber="273"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="183" data-linenumber="203"> + <li class="covered" data-hits="183" data-linenumber="274"> <span class="hits">183</span> <code class="ruby"> query</code> </li> - <li class="never" data-hits="" data-linenumber="204"> + <li class="never" data-hits="" data-linenumber="275"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="205"> + <li class="never" data-hits="" data-linenumber="276"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="206"> + <li class="never" data-hits="" data-linenumber="277"> <code class="ruby"> # Get a Contentful::Request object</code> </li> - <li class="never" data-hits="" data-linenumber="207"> + <li class="never" data-hits="" data-linenumber="278"> <code class="ruby"> # Set second parameter to false to deactivate Resource building and</code> </li> - <li class="never" data-hits="" data-linenumber="208"> + <li class="never" data-hits="" data-linenumber="279"> <code class="ruby"> # return Response objects instead</code> </li> - <li class="never" data-hits="" data-linenumber="209"> + <li class="never" data-hits="" data-linenumber="280"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="210"> + <li class="never" data-hits="" data-linenumber="281"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="211"> + <li class="covered" data-hits="1" data-linenumber="282"> <span class="hits">1</span> <code class="ruby"> def get(request, build_resource = true)</code> </li> - <li class="covered" data-hits="180" data-linenumber="212"> + <li class="covered" data-hits="180" data-linenumber="283"> <span class="hits">180</span> <code class="ruby"> retries_left = configuration[:max_rate_limit_retries]</code> </li> - <li class="covered" data-hits="180" data-linenumber="213"> + <li class="covered" data-hits="180" data-linenumber="284"> <span class="hits">180</span> <code class="ruby"> result = nil</code> </li> - <li class="covered" data-hits="180" data-linenumber="214"> + <li class="covered" data-hits="180" data-linenumber="285"> <span class="hits">180</span> <code class="ruby"> begin</code> </li> - <li class="covered" data-hits="181" data-linenumber="215"> + <li class="covered" data-hits="181" data-linenumber="286"> <span class="hits">181</span> <code class="ruby"> response = run_request(request)</code> </li> - <li class="never" data-hits="" data-linenumber="216"> + <li class="never" data-hits="" data-linenumber="287"> <code class="ruby"></code> </li> - <li class="covered" data-hits="181" data-linenumber="217"> + <li class="covered" data-hits="181" data-linenumber="288"> <span class="hits">181</span> <code class="ruby"> return response if !build_resource || configuration[:raw_mode]</code> </li> - <li class="never" data-hits="" data-linenumber="218"> + <li class="never" data-hits="" data-linenumber="289"> <code class="ruby"></code> </li> - <li class="covered" data-hits="176" data-linenumber="219"> + <li class="covered" data-hits="176" data-linenumber="290"> <span class="hits">176</span> <code class="ruby"> return fail_response(response) if response.status != :ok</code> </li> - <li class="never" data-hits="" data-linenumber="220"> + <li class="never" data-hits="" data-linenumber="291"> <code class="ruby"></code> </li> - <li class="covered" data-hits="167" data-linenumber="221"> + <li class="covered" data-hits="167" data-linenumber="292"> <span class="hits">167</span> <code class="ruby"> result = do_build_resource(response)</code> </li> - <li class="never" data-hits="" data-linenumber="222"> + <li class="never" data-hits="" data-linenumber="293"> <code class="ruby"> rescue UnparsableResource =&gt; error</code> </li> - <li class="missed" data-hits="0" data-linenumber="223"> + <li class="missed" data-hits="0" data-linenumber="294"> <code class="ruby"> raise error if configuration[:raise_errors]</code> </li> - <li class="missed" data-hits="0" data-linenumber="224"> + <li class="missed" data-hits="0" data-linenumber="295"> <code class="ruby"> return error</code> </li> - <li class="never" data-hits="" data-linenumber="225"> + <li class="never" data-hits="" data-linenumber="296"> <code class="ruby"> rescue Contentful::RateLimitExceeded =&gt; rate_limit_error</code> </li> - <li class="covered" data-hits="2" data-linenumber="226"> + <li class="covered" data-hits="2" data-linenumber="297"> <span class="hits">2</span> <code class="ruby"> reset_time = rate_limit_error.response.raw[RATE_LIMIT_RESET_HEADER_KEY].to_i</code> </li> - <li class="covered" data-hits="2" data-linenumber="227"> + <li class="covered" data-hits="2" data-linenumber="298"> <span class="hits">2</span> <code class="ruby"> if should_retry(retries_left, reset_time, configuration[:max_rate_limit_wait])</code> </li> - <li class="covered" data-hits="1" data-linenumber="228"> + <li class="covered" data-hits="1" data-linenumber="299"> <span class="hits">1</span> <code class="ruby"> retries_left -= 1</code> </li> - <li class="covered" data-hits="1" data-linenumber="229"> + <li class="covered" data-hits="1" data-linenumber="300"> <span class="hits">1</span> <code class="ruby"> logger.info(retry_message(retries_left, reset_time)) if logger</code> </li> - <li class="covered" data-hits="1" data-linenumber="230"> + <li class="covered" data-hits="1" data-linenumber="301"> <span class="hits">1</span> <code class="ruby"> sleep(reset_time * Random.new.rand(1.0..1.2))</code> </li> - <li class="covered" data-hits="1" data-linenumber="231"> + <li class="covered" data-hits="1" data-linenumber="302"> <span class="hits">1</span> <code class="ruby"> retry</code> </li> - <li class="never" data-hits="" data-linenumber="232"> + <li class="never" data-hits="" data-linenumber="303"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="233"> + <li class="never" data-hits="" data-linenumber="304"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="234"> + <li class="covered" data-hits="1" data-linenumber="305"> <span class="hits">1</span> <code class="ruby"> raise</code> </li> - <li class="never" data-hits="" data-linenumber="235"> + <li class="never" data-hits="" data-linenumber="306"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="236"> + <li class="never" data-hits="" data-linenumber="307"> <code class="ruby"></code> </li> - <li class="covered" data-hits="167" data-linenumber="237"> + <li class="covered" data-hits="167" data-linenumber="308"> <span class="hits">167</span> <code class="ruby"> result</code> </li> - <li class="never" data-hits="" data-linenumber="238"> + <li class="never" data-hits="" data-linenumber="309"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="239"> + <li class="never" data-hits="" data-linenumber="310"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="240"> + <li class="never" data-hits="" data-linenumber="311"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="241"> + <li class="covered" data-hits="1" data-linenumber="312"> <span class="hits">1</span> <code class="ruby"> def retry_message(retries_left, reset_time)</code> </li> - <li class="covered" data-hits="1" data-linenumber="242"> + <li class="covered" data-hits="1" data-linenumber="313"> <span class="hits">1</span> <code class="ruby"> message = &#39;Contentful API Rate Limit Hit! &#39;</code> </li> - <li class="covered" data-hits="1" data-linenumber="243"> + <li class="covered" data-hits="1" data-linenumber="314"> <span class="hits">1</span> <code class="ruby"> message += &quot;Retrying - Retries left: #{retries_left}&quot;</code> </li> - <li class="covered" data-hits="1" data-linenumber="244"> + <li class="covered" data-hits="1" data-linenumber="315"> <span class="hits">1</span> <code class="ruby"> message += &quot;- Time until reset (seconds): #{reset_time}&quot;</code> </li> - <li class="covered" data-hits="1" data-linenumber="245"> + <li class="covered" data-hits="1" data-linenumber="316"> <span class="hits">1</span> <code class="ruby"> message</code> </li> - <li class="never" data-hits="" data-linenumber="246"> + <li class="never" data-hits="" data-linenumber="317"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="247"> + <li class="never" data-hits="" data-linenumber="318"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="248"> + <li class="never" data-hits="" data-linenumber="319"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="249"> + <li class="covered" data-hits="1" data-linenumber="320"> <span class="hits">1</span> <code class="ruby"> def fail_response(response)</code> </li> - <li class="covered" data-hits="9" data-linenumber="250"> + <li class="covered" data-hits="9" data-linenumber="321"> <span class="hits">9</span> <code class="ruby"> fail response.object if configuration[:raise_errors]</code> </li> - <li class="covered" data-hits="1" data-linenumber="251"> + <li class="covered" data-hits="1" data-linenumber="322"> <span class="hits">1</span> <code class="ruby"> response.object</code> </li> - <li class="never" data-hits="" data-linenumber="252"> + <li class="never" data-hits="" data-linenumber="323"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="253"> + <li class="never" data-hits="" data-linenumber="324"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="254"> + <li class="never" data-hits="" data-linenumber="325"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="255"> + <li class="covered" data-hits="1" data-linenumber="326"> <span class="hits">1</span> <code class="ruby"> def should_retry(retries_left, reset_time, max_wait)</code> </li> - <li class="covered" data-hits="2" data-linenumber="256"> + <li class="covered" data-hits="2" data-linenumber="327"> <span class="hits">2</span> <code class="ruby"> retries_left &gt; 0 &amp;&amp; max_wait &gt; reset_time</code> </li> - <li class="never" data-hits="" data-linenumber="257"> + <li class="never" data-hits="" data-linenumber="328"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="258"> + <li class="never" data-hits="" data-linenumber="329"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="259"> + <li class="never" data-hits="" data-linenumber="330"> <code class="ruby"> # Runs request and parses Response</code> </li> - <li class="never" data-hits="" data-linenumber="260"> + <li class="never" data-hits="" data-linenumber="331"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="261"> + <li class="covered" data-hits="1" data-linenumber="332"> <span class="hits">1</span> <code class="ruby"> def run_request(request)</code> </li> - <li class="covered" data-hits="181" data-linenumber="262"> + <li class="covered" data-hits="181" data-linenumber="333"> <span class="hits">181</span> <code class="ruby"> url = request.absolute? ? request.url : base_url + request.url</code> </li> - <li class="covered" data-hits="181" data-linenumber="263"> + <li class="covered" data-hits="181" data-linenumber="334"> <span class="hits">181</span> <code class="ruby"> logger.info(request: { url: url, query: request.query, header: request_headers }) if logger</code> </li> - <li class="covered" data-hits="181" data-linenumber="264"> + <li class="covered" data-hits="181" data-linenumber="335"> <span class="hits">181</span> <code class="ruby"> Response.new(</code> </li> - <li class="never" data-hits="" data-linenumber="265"> + <li class="never" data-hits="" data-linenumber="336"> <code class="ruby"> self.class.get_http(</code> </li> - <li class="never" data-hits="" data-linenumber="266"> + <li class="never" data-hits="" data-linenumber="337"> <code class="ruby"> url,</code> </li> - <li class="never" data-hits="" data-linenumber="267"> + <li class="never" data-hits="" data-linenumber="338"> <code class="ruby"> request_query(request.query),</code> </li> - <li class="never" data-hits="" data-linenumber="268"> + <li class="never" data-hits="" data-linenumber="339"> <code class="ruby"> request_headers,</code> </li> - <li class="never" data-hits="" data-linenumber="269"> + <li class="never" data-hits="" data-linenumber="340"> <code class="ruby"> proxy_params</code> </li> - <li class="never" data-hits="" data-linenumber="270"> + <li class="never" data-hits="" data-linenumber="341"> <code class="ruby"> ), request</code> </li> - <li class="never" data-hits="" data-linenumber="271"> + <li class="never" data-hits="" data-linenumber="342"> <code class="ruby"> )</code> </li> - <li class="never" data-hits="" data-linenumber="272"> + <li class="never" data-hits="" data-linenumber="343"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="273"> + <li class="never" data-hits="" data-linenumber="344"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="274"> + <li class="never" data-hits="" data-linenumber="345"> <code class="ruby"> # Runs Resource Builder</code> </li> - <li class="never" data-hits="" data-linenumber="275"> + <li class="never" data-hits="" data-linenumber="346"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="276"> + <li class="covered" data-hits="1" data-linenumber="347"> <span class="hits">1</span> <code class="ruby"> def do_build_resource(response)</code> </li> - <li class="covered" data-hits="167" data-linenumber="277"> + <li class="covered" data-hits="167" data-linenumber="348"> <span class="hits">167</span> <code class="ruby"> logger.debug(response: response) if logger</code> </li> - <li class="never" data-hits="" data-linenumber="278"> + <li class="never" data-hits="" data-linenumber="349"> <code class="ruby"> configuration[:resource_builder].new(</code> </li> - <li class="never" data-hits="" data-linenumber="279"> + <li class="never" data-hits="" data-linenumber="350"> <code class="ruby"> response.object,</code> </li> - <li class="never" data-hits="" data-linenumber="280"> + <li class="never" data-hits="" data-linenumber="351"> <code class="ruby"> configuration,</code> </li> - <li class="covered" data-hits="167" data-linenumber="281"> + <li class="covered" data-hits="167" data-linenumber="352"> <span class="hits">167</span> <code class="ruby"> (response.request.query || {}).fetch(:locale, nil) == &#39;*&#39;,</code> </li> - <li class="never" data-hits="" data-linenumber="282"> + <li class="never" data-hits="" data-linenumber="353"> <code class="ruby"> 0,</code> </li> - <li class="never" data-hits="" data-linenumber="283"> + <li class="never" data-hits="" data-linenumber="354"> <code class="ruby"> response.request.endpoint</code> </li> - <li class="covered" data-hits="167" data-linenumber="284"> + <li class="covered" data-hits="167" data-linenumber="355"> <span class="hits">167</span> <code class="ruby"> ).run</code> </li> - <li class="never" data-hits="" data-linenumber="285"> + <li class="never" data-hits="" data-linenumber="356"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="286"> + <li class="never" data-hits="" data-linenumber="357"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="287"> + <li class="never" data-hits="" data-linenumber="358"> <code class="ruby"> # Use this method together with the client&#39;s :dynamic_entries configuration.</code> </li> - <li class="never" data-hits="" data-linenumber="288"> + <li class="never" data-hits="" data-linenumber="359"> <code class="ruby"> # See README for details.</code> </li> - <li class="never" data-hits="" data-linenumber="289"> + <li class="never" data-hits="" data-linenumber="360"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="290"> + <li class="covered" data-hits="1" data-linenumber="361"> <span class="hits">1</span> <code class="ruby"> def update_dynamic_entry_cache!</code> </li> - <li class="covered" data-hits="11" data-linenumber="291"> + <li class="covered" data-hits="11" data-linenumber="362"> <span class="hits">11</span> <code class="ruby"> content_types(limit: 1000).map do |ct|</code> </li> - <li class="covered" data-hits="22" data-linenumber="292"> + <li class="covered" data-hits="22" data-linenumber="363"> <span class="hits">22</span> <code class="ruby"> ContentTypeCache.cache_set(configuration[:space], ct.id, ct)</code> </li> - <li class="never" data-hits="" data-linenumber="293"> + <li class="never" data-hits="" data-linenumber="364"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="294"> + <li class="never" data-hits="" data-linenumber="365"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="295"> + <li class="never" data-hits="" data-linenumber="366"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="296"> + <li class="never" data-hits="" data-linenumber="367"> <code class="ruby"> # Use this method to manually register a dynamic entry</code> </li> - <li class="never" data-hits="" data-linenumber="297"> + <li class="never" data-hits="" data-linenumber="368"> <code class="ruby"> # See examples/dynamic_entries.rb</code> </li> - <li class="never" data-hits="" data-linenumber="298"> + <li class="never" data-hits="" data-linenumber="369"> <code class="ruby"> # @private</code> </li> - <li class="covered" data-hits="1" data-linenumber="299"> + <li class="covered" data-hits="1" data-linenumber="370"> <span class="hits">1</span> <code class="ruby"> def register_dynamic_entry(key, klass)</code> </li> - <li class="covered" data-hits="1" data-linenumber="300"> + <li class="covered" data-hits="1" data-linenumber="371"> <span class="hits">1</span> <code class="ruby"> ContentTypeCache.cache_set(configuration[:space], key, klass)</code> </li> - <li class="never" data-hits="" data-linenumber="301"> + <li class="never" data-hits="" data-linenumber="372"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="302"> + <li class="never" data-hits="" data-linenumber="373"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="303"> + <li class="never" data-hits="" data-linenumber="374"> <code class="ruby"> # Create a new synchronisation object</code> </li> - <li class="never" data-hits="" data-linenumber="304"> + <li class="never" data-hits="" data-linenumber="375"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="305"> + <li class="never" data-hits="" data-linenumber="376"> <code class="ruby"> # @param [Hash, String] options Options or Sync URL</code> </li> - <li class="never" data-hits="" data-linenumber="306"> + <li class="never" data-hits="" data-linenumber="377"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="307"> + <li class="never" data-hits="" data-linenumber="378"> <code class="ruby"> # @note You will need to call #each_page or #first_page on it</code> </li> - <li class="never" data-hits="" data-linenumber="308"> + <li class="never" data-hits="" data-linenumber="379"> <code class="ruby"> #</code> </li> - <li class="never" data-hits="" data-linenumber="309"> + <li class="never" data-hits="" data-linenumber="380"> <code class="ruby"> # @return [Contentful::Sync]</code> </li> - <li class="covered" data-hits="1" data-linenumber="310"> + <li class="covered" data-hits="1" data-linenumber="381"> <span class="hits">1</span> <code class="ruby"> def sync(options = { initial: true })</code> </li> - <li class="covered" data-hits="40" data-linenumber="311"> + <li class="covered" data-hits="40" data-linenumber="382"> <span class="hits">40</span> <code class="ruby"> Sync.new(self, options)</code> </li> - <li class="never" data-hits="" data-linenumber="312"> + <li class="never" data-hits="" data-linenumber="383"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="313"> + <li class="never" data-hits="" data-linenumber="384"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="314"> + <li class="covered" data-hits="1" data-linenumber="385"> <span class="hits">1</span> <code class="ruby"> private</code> </li> - <li class="never" data-hits="" data-linenumber="315"> + <li class="never" data-hits="" data-linenumber="386"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="316"> + <li class="never" data-hits="" data-linenumber="387"> <code class="ruby"> # If the query contains the :select operator, we enforce :sys properties.</code> </li> - <li class="never" data-hits="" data-linenumber="317"> + <li class="never" data-hits="" data-linenumber="388"> <code class="ruby"> # The SDK requires sys.type to function properly, but as other of our SDKs</code> </li> - <li class="never" data-hits="" data-linenumber="318"> + <li class="never" data-hits="" data-linenumber="389"> <code class="ruby"> # require more parts of the :sys properties, we decided that every SDK should</code> </li> - <li class="never" data-hits="" data-linenumber="319"> + <li class="never" data-hits="" data-linenumber="390"> <code class="ruby"> # include the complete :sys block to provide consistency accross our SDKs.</code> </li> - <li class="covered" data-hits="1" data-linenumber="320"> + <li class="covered" data-hits="1" data-linenumber="391"> <span class="hits">1</span> <code class="ruby"> def normalize_select!(query)</code> </li> - <li class="covered" data-hits="55" data-linenumber="321"> + <li class="covered" data-hits="55" data-linenumber="392"> <span class="hits">55</span> <code class="ruby"> return unless query.key?(:select)</code> </li> - <li class="never" data-hits="" data-linenumber="322"> + <li class="never" data-hits="" data-linenumber="393"> <code class="ruby"></code> </li> - <li class="covered" data-hits="9" data-linenumber="323"> + <li class="covered" data-hits="9" data-linenumber="394"> <span class="hits">9</span> <code class="ruby"> query[:select] = query[:select].split(&#39;,&#39;).map(&amp;:strip) if query[:select].is_a? String</code> </li> - <li class="covered" data-hits="19" data-linenumber="324"> + <li class="covered" data-hits="19" data-linenumber="395"> <span class="hits">19</span> <code class="ruby"> query[:select] = query[:select].reject { |p| p.start_with?(&#39;sys.&#39;) }</code> </li> - <li class="covered" data-hits="9" data-linenumber="325"> + <li class="covered" data-hits="9" data-linenumber="396"> <span class="hits">9</span> <code class="ruby"> query[:select] &lt;&lt; &#39;sys&#39; unless query[:select].include?(&#39;sys&#39;)</code> </li> - <li class="never" data-hits="" data-linenumber="326"> + <li class="never" data-hits="" data-linenumber="397"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="327"> + <li class="never" data-hits="" data-linenumber="398"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="328"> + <li class="covered" data-hits="1" data-linenumber="399"> <span class="hits">1</span> <code class="ruby"> def normalize_configuration!</code> </li> - <li class="covered" data-hits="925" data-linenumber="329"> - <span class="hits">925</span> + <li class="covered" data-hits="965" data-linenumber="400"> + <span class="hits">965</span> <code class="ruby"> [:space, :access_token, :api_url, :default_locale].each { |s| configuration[s] = configuration[s].to_s }</code> </li> - <li class="covered" data-hits="185" data-linenumber="330"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="401"> + <span class="hits">193</span> <code class="ruby"> configuration[:authentication_mechanism] = configuration[:authentication_mechanism].to_sym</code> </li> - <li class="never" data-hits="" data-linenumber="331"> + <li class="never" data-hits="" data-linenumber="402"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="332"> + <li class="never" data-hits="" data-linenumber="403"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="333"> + <li class="covered" data-hits="1" data-linenumber="404"> <span class="hits">1</span> <code class="ruby"> def validate_configuration!</code> </li> - <li class="covered" data-hits="185" data-linenumber="334"> - <span class="hits">185</span> + <li class="covered" data-hits="193" data-linenumber="405"> + <span class="hits">193</span> <code class="ruby"> fail ArgumentError, &#39;You will need to initialize a client with a :space&#39; if configuration[:space].empty?</code> </li> - <li class="covered" data-hits="184" data-linenumber="335"> - <span class="hits">184</span> + <li class="covered" data-hits="192" data-linenumber="406"> + <span class="hits">192</span> <code class="ruby"> fail ArgumentError, &#39;You will need to initialize a client with an :access_token&#39; if configuration[:access_token].empty?</code> </li> - <li class="covered" data-hits="183" data-linenumber="336"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="407"> + <span class="hits">191</span> <code class="ruby"> fail ArgumentError, &#39;The client configuration needs to contain an :api_url&#39; if configuration[:api_url].empty?</code> </li> - <li class="covered" data-hits="183" data-linenumber="337"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="408"> + <span class="hits">191</span> <code class="ruby"> fail ArgumentError, &#39;The client configuration needs to contain a :default_locale&#39; if configuration[:default_locale].empty?</code> </li> - <li class="covered" data-hits="183" data-linenumber="338"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="409"> + <span class="hits">191</span> <code class="ruby"> fail ArgumentError, &#39;The :api_version must be a positive number or nil&#39; unless configuration[:api_version].to_i &gt;= 0</code> </li> - <li class="covered" data-hits="183" data-linenumber="339"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="410"> + <span class="hits">191</span> <code class="ruby"> fail ArgumentError, &#39;The authentication mechanism must be :header or :query_string&#39; unless [:header, :query_string].include?(</code> </li> - <li class="never" data-hits="" data-linenumber="340"> + <li class="never" data-hits="" data-linenumber="411"> <code class="ruby"> configuration[:authentication_mechanism]</code> </li> - <li class="never" data-hits="" data-linenumber="341"> + <li class="never" data-hits="" data-linenumber="412"> <code class="ruby"> )</code> </li> - <li class="covered" data-hits="183" data-linenumber="342"> - <span class="hits">183</span> + <li class="covered" data-hits="191" data-linenumber="413"> + <span class="hits">191</span> <code class="ruby"> fail ArgumentError, &#39;The :dynamic_entries mode must be :auto or :manual&#39; unless [:auto, :manual].include?(</code> </li> - <li class="never" data-hits="" data-linenumber="343"> + <li class="never" data-hits="" data-linenumber="414"> <code class="ruby"> configuration[:dynamic_entries]</code> </li> - <li class="never" data-hits="" data-linenumber="344"> + <li class="never" data-hits="" data-linenumber="415"> <code class="ruby"> )</code> </li> - <li class="never" data-hits="" data-linenumber="345"> + <li class="never" data-hits="" data-linenumber="416"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="346"> + <li class="never" data-hits="" data-linenumber="417"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="347"> + <li class="never" data-hits="" data-linenumber="418"> <code class="ruby">end</code> </li> @@ -12761,12 +13187,12 @@ <div class="source_table" id="bb578f091ede06ee0e73520e211d99d517944b3f"> <div class="header"> <h3>spec/client_configuration_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>94</b> relevant lines. - <span class="green"><b>94</b> lines covered</span> and + <b>152</b> relevant lines. + <span class="green"><b>152</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -13997,10 +14423,880 @@ </li> <li class="never" data-hits="" data-linenumber="205"> + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="206"> + <span class="hits">1</span> + + <code class="ruby"> describe &#39;X-Contentful-User-Agent headers&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="207"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;default values&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="208"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="209"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="210"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="211"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="212"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="213"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="214"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="215"> + <span class="hits">2</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="216"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="217"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="218"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="219"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="220"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;integration&#39;, &#39;app&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="221"> + <span class="hits">2</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="222"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="223"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="224"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="225"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;with integration name only&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="226"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="227"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="228"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="229"> + + + <code class="ruby"> &quot;integration foobar;&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="230"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="231"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="232"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(integration_name: &#39;foobar&#39;)</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="233"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="3" data-linenumber="234"> + <span class="hits">3</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="235"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="236"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="237"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="238"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="239"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;app&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="240"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="241"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="242"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="243"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="244"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;with integration&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="245"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="246"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="247"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="248"> + + + <code class="ruby"> &quot;integration foobar/0.1.0;&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="249"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="250"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="251"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(integration_name: &#39;foobar&#39;, integration_version: &#39;0.1.0&#39;)</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="252"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="3" data-linenumber="253"> + <span class="hits">3</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="254"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="255"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="256"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="257"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="258"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;app&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="259"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="260"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="261"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="262"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="263"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;with application name only&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="264"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="265"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="266"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="267"> + + + <code class="ruby"> &quot;app fooapp;&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="268"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="269"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="270"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(application_name: &#39;fooapp&#39;)</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="271"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="3" data-linenumber="272"> + <span class="hits">3</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="273"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="274"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="275"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="276"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="277"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;integration&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="278"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="279"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="280"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="281"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="282"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;with application&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="283"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="284"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="285"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="286"> + + + <code class="ruby"> &quot;app fooapp/1.0.0;&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="287"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="288"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="289"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(application_name: &#39;fooapp&#39;, application_version: &#39;1.0.0&#39;)</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="290"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="3" data-linenumber="291"> + <span class="hits">3</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="292"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="293"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="294"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="295"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="296"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;integration&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="297"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="298"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="299"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="300"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="301"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;with all&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="302"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="303"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="304"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="305"> + + + <code class="ruby"> &quot;integration foobar/0.1.0;&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="306"> + + + <code class="ruby"> &quot;app fooapp/1.0.0;&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="307"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="308"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="309"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(</code> + </li> + + <li class="never" data-hits="" data-linenumber="310"> + + + <code class="ruby"> integration_name: &#39;foobar&#39;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="311"> + + + <code class="ruby"> integration_version: &#39;0.1.0&#39;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="312"> + + + <code class="ruby"> application_name: &#39;fooapp&#39;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="313"> + + + <code class="ruby"> application_version: &#39;1.0.0&#39;</code> + </li> + + <li class="never" data-hits="" data-linenumber="314"> + + + <code class="ruby"> )</code> + </li> + + <li class="never" data-hits="" data-linenumber="315"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="316"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="4" data-linenumber="317"> + <span class="hits">4</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="318"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="319"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="320"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="321"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="322"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="323"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;when only version numbers, skips header&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="324"> + <span class="hits">1</span> + + <code class="ruby"> expected = [</code> + </li> + + <li class="never" data-hits="" data-linenumber="325"> + + + <code class="ruby"> &quot;sdk contentful.rb/#{Contentful::VERSION};&quot;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="326"> + + + <code class="ruby"> &quot;platform ruby/#{RUBY_VERSION};&quot;</code> + </li> + + <li class="never" data-hits="" data-linenumber="327"> + + + <code class="ruby"> ]</code> + </li> + + <li class="never" data-hits="" data-linenumber="328"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="329"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client(</code> + </li> + + <li class="never" data-hits="" data-linenumber="330"> + + + <code class="ruby"> integration_version: &#39;0.1.0&#39;,</code> + </li> + + <li class="never" data-hits="" data-linenumber="331"> + + + <code class="ruby"> application_version: &#39;1.0.0&#39;</code> + </li> + + <li class="never" data-hits="" data-linenumber="332"> + + + <code class="ruby"> )</code> + </li> + + <li class="never" data-hits="" data-linenumber="333"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="334"> + <span class="hits">1</span> + + <code class="ruby"> expected.each do |h|</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="335"> + <span class="hits">2</span> + + <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="336"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="337"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="338"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code> + </li> + + <li class="never" data-hits="" data-linenumber="339"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="340"> + <span class="hits">1</span> + + <code class="ruby"> [&#39;integration&#39;, &#39;app&#39;].each do |h|</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="341"> + <span class="hits">2</span> + + <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code> + </li> + + <li class="never" data-hits="" data-linenumber="342"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="343"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="344"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="345"> + <span class="hits">1</span> + + <code class="ruby"> it &#39;headers include X-Contentful-User-Agent&#39; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="346"> + <span class="hits">1</span> + + <code class="ruby"> client = create_client</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="347"> + <span class="hits">1</span> + + <code class="ruby"> expect(client.request_headers[&#39;X-Contentful-User-Agent&#39;]).to eq client.contentful_user_agent</code> + </li> + + <li class="never" data-hits="" data-linenumber="348"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="349"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="350"> + + <code class="ruby">end</code> </li> </ol> </pre> @@ -19916,11 +21212,11 @@ <span class="hits">1</span> <code class="ruby">def create_client(options = {})</code> </li> - <li class="covered" data-hits="175" data-linenumber="2"> - <span class="hits">175</span> + <li class="covered" data-hits="183" data-linenumber="2"> + <span class="hits">183</span> <code class="ruby"> Contentful::Client.new({</code> </li> <li class="never" data-hits="" data-linenumber="3">