cortex-snippets-client 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 980ca1cf8a4a809700bd23f98eb56d93a94c4a9a
4
- data.tar.gz: 29f400a93acc70da930d3ba86261bf96d970ab3e
3
+ metadata.gz: f6a5c0a4eeb33d9d9e45f84b15985558557348f5
4
+ data.tar.gz: bbc4d7895bc5ef3db28aef653a255368b1f0a6f1
5
5
  SHA512:
6
- metadata.gz: 0a7910dffcbeb3613271945dc0743af96a04711ae24f02343287c9ef31dc7879754d2e9567b044e5dd90378aacaa9ec45db288bd9c63e7e0ffea11db40190606
7
- data.tar.gz: d4e20d5920e05e0c7d0b440e705cc5ea1a450abefc932c490d222eda5c6fe75aa82e1adeaf5639e4958f5bc5002abcf3b0deb72cb398d4de5137fe991134e69b
6
+ metadata.gz: f7ad501e402f2f287d4912862a606d147556fd5a2eceec565587bde938b4f3d82456e74f60a5206c5477759c3ce1dc26901855360c654e5734af9ab9c2a028b7
7
+ data.tar.gz: f4a505eeed0eb49cc7e5835a0626313500323787cd4d3ce5458f808672e6cf91a8a03eadd4e8a12ab57d84f541f9540c5df04b5179dbecd3991afc7f57303270
data/CHANGELOG.md CHANGED
@@ -3,6 +3,7 @@ Version History
3
3
  * All Version bumps are required to update this file as well!!
4
4
  ----
5
5
 
6
+ * 1.0.2 - Add TranslationHelper for content_tag and remove capture concern
6
7
  * 1.0.1 - Fix namespacing bug for Cortex::Snippets::Client
7
8
  * 1.0.0 - Multi-tenancy Rebuild, now takes in Cortex Client
8
9
  * 0.8.1 - Dependency upgrades, etc
@@ -4,22 +4,24 @@ require 'addressable/uri'
4
4
  module Cortex
5
5
  module Snippets
6
6
  class Client
7
+ include ActionView::Helpers::TranslationHelper
8
+
7
9
  def initialize(cortex_client)
8
10
  @cortex_client = cortex_client
9
11
  end
10
12
 
11
- def snippet(options = {}, &block)
12
- snippets = current_webpage.snippets || []
13
+ def snippet(request, options = {}, block)
14
+ snippets = current_webpage(request).snippets || []
13
15
  snippet = snippets.find { |snippet| snippet[:document][:name] == options[:id] }
14
16
 
15
17
  if snippet.nil? || snippet[:document][:body].nil? || snippet[:document][:body].empty?
16
- content_tag(:snippet, capture(&block), options)
18
+ content_tag(:snippet, block, options)
17
19
  else
18
20
  content_tag(:snippet, snippet[:document][:body].html_safe, options)
19
21
  end
20
22
  end
21
23
 
22
- def current_webpage
24
+ def current_webpage(request)
23
25
  if defined?(Rails)
24
26
  url = sanitized_webpage_url(request.original_url)
25
27
  Rails.cache.fetch("webpages/#{@cortex_client.access_token.client.id}/#{url}", race_condition_ttl: 10) do
@@ -1,5 +1,5 @@
1
1
  module Cortex
2
2
  module Snippets
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cortex-snippets-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CareerBuilder Employer Site & Content Products
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cortex-client