embed-an-inkpad 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ad530c368adbbf8cc11326ca65fc035347b4cf6
4
+ data.tar.gz: 2f4ae7e617581a32208cb163f0eb5537613b66b6
5
+ SHA512:
6
+ metadata.gz: 464136609e56cf32dff27a42d749d5c5ee531ef5d1a53def9939460dd7fd374f894f004d0a3122bae28e8e21adcd0c846385c32034f3600860c8487184a8efa8
7
+ data.tar.gz: 35d3181ff5808cd6e92fda0cef6d131c0b1f9182cc8ed524814eb8eee52f3cb940a970c9598e12a7b3756f5b8c10a1445b6124cf0c80c223035f0c1a6b5b88e7
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'embed-an-inkpad'
3
+ s.version = '0.0.1'
4
+ s.date = '2015-05-14'
5
+ s.summary = 'Embed an Inkpad document'
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.'
7
+ s.authors = ['Lars Kluge']
8
+ s.email = 'l@larskluge.com'
9
+ s.files = `git ls-files`.split("\n")
10
+ s.homepage = 'https://www.inkpad.io'
11
+ s.license = 'MIT'
12
+ end
13
+
@@ -0,0 +1,11 @@
1
+ require 'embed-an-inkpad/view_helpers'
2
+
3
+
4
+ module EmbedAnInkpad
5
+ class Railtie < Rails::Railtie
6
+ initializer "embed-an-inkpad.view_helpers" do
7
+ ActionView::Base.send :include, ViewHelpers
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,20 @@
1
+ module EmbedAnInkpad
2
+ module ViewHelpers
3
+ def embed_an_inkpad inkpad_id
4
+
5
+
6
+ uri = URI("https://www.inkpad.io/#{inkpad_id}.md")
7
+
8
+ Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
9
+ request = Net::HTTP::Get.new uri
10
+
11
+ response = http.request request # Net::HTTPResponse object
12
+
13
+ content_tag :pre do
14
+ response.body
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
@@ -0,0 +1,2 @@
1
+ require 'embed-an-inkpad/railtie' if defined?(Rails)
2
+
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embed-an-inkpad
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Lars Kluge
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Embed an Inkpad document into your Rails app. Stop bothering engineers
14
+ to update the Terms of Service and other boring semi-static pages. Manage content
15
+ through inkpad.io.
16
+ email: l@larskluge.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - embed-an-inkpad.gemspec
22
+ - lib/embed-an-inkpad.rb
23
+ - lib/embed-an-inkpad/railtie.rb
24
+ - lib/embed-an-inkpad/view_helpers.rb
25
+ homepage: https://www.inkpad.io
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.4.5
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Embed an Inkpad document
49
+ test_files: []