Skip to content

Commit 6eddc53

Browse files
committed
Merge branch 'develop'
2 parents a34995c + de88140 commit 6eddc53

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/cortex/snippets/client.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ def cortex_client
1515
end
1616

1717
def current_webpage(request)
18-
cortex_client.webpages.get_feed(request_url(request)).contents
18+
if defined?(Rails)
19+
Rails.cache.fetch("webpages/#{request_url(request)}", expires_in: 30.minutes) do
20+
cortex_client.webpages.get_feed(request_url(request)).contents
21+
end
22+
else
23+
raise 'Your Web framework is not supported. Supported frameworks: Rails'
24+
end
1925
end
2026

2127
private

lib/cortex/snippets/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Cortex
22
module Snippets
3-
VERSION = '0.3.2'
3+
VERSION = '0.4.0'
44
end
55
end

0 commit comments

Comments
 (0)