embed-an-inkpad 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/embed-an-inkpad.gemspec +1 -1
- data/lib/embed-an-inkpad/view_helpers.rb +6 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a601d67169a1dc7cbce96c8a9980d8aa2fd56576
|
4
|
+
data.tar.gz: 7307b4dd674b810a071ae8765c68bc4fb52c3c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ce2d31fb517584aef4bc5c1cea361073e47a587c4c9ced39c1d904c566f0c6d94b2b82687e3a4dee288e64b8c49e7463b5273bbd21c1ad05c258c5ec4b8b1c
|
7
|
+
data.tar.gz: cd6e3751495e8320f44c9da05e5c6d0bd681ad8be9c5fe6d533d77c0d323553754be33e9d6a77f36ee31a2a75b411e6076088d73ddcfc1e01c3c09b92e5b059e
|
data/embed-an-inkpad.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'embed-an-inkpad'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.2'
|
4
4
|
s.date = '2015-05-14'
|
5
5
|
s.summary = 'Embed an Inkpad document'
|
6
6
|
s.description = 'Embed an Inkpad document into your Rails app. Stop bothering engineers to update the Terms of Service and other boring semi-static pages. Manage content through inkpad.io.'
|
@@ -1,20 +1,18 @@
|
|
1
1
|
module EmbedAnInkpad
|
2
2
|
module ViewHelpers
|
3
|
-
def embed_an_inkpad inkpad_id
|
4
|
-
|
5
3
|
|
6
|
-
|
4
|
+
def embed_an_inkpad inkpad_id
|
5
|
+
uri = URI("https://www.inkpad.io/#{inkpad_id}")
|
7
6
|
|
8
7
|
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
9
8
|
request = Net::HTTP::Get.new uri
|
9
|
+
request['Accept'] = 'text/html;vanilla'
|
10
10
|
|
11
|
-
response = http.request request
|
12
|
-
|
13
|
-
content_tag :pre do
|
14
|
-
response.body
|
15
|
-
end
|
11
|
+
response = http.request request
|
12
|
+
response.body.html_safe
|
16
13
|
end
|
17
14
|
end
|
15
|
+
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|