imprenta 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/README.md +41 -2
- data/imprenta.gemspec +1 -1
- data/lib/imprenta/configuration.rb +2 -2
- data/lib/imprenta/static_server.rb +0 -1
- data/lib/imprenta/version.rb +1 -1
- data/lib/imprenta.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fa4d44f02caca84304d491edc76e7de0de8929f
|
4
|
+
data.tar.gz: 867f4e5beb6b3e58eb04455efafc9c804d704592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d97d77fe122eafce9d6bc5b76c35cd7a4308f8b314e60c8021b7918ffcdb2d795badadec2c7df4a3c7bd89cf8ceb6d284c007e0f928d001bf41e4d2b63409ab9
|
7
|
+
data.tar.gz: 80d2e0f80eaa62ca1c879d85a69a83b208e5184b504760a8c3524c97d8fc923272c6efae536bac62eeeaf018dbc2f951f2692ab6b4e49b0e3c514d62fafae007
|
data/README.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Imprenta
|
2
2
|
|
3
|
-
|
3
|
+
The goal of this gem is to provide an easy and efficient way to generate and serve
|
4
|
+
static pages within Rails. The perfect use case for this gem is when your users
|
5
|
+
generate some content that gets published and then it barely changes. e.g: a blog post,
|
6
|
+
landing page, about.me, etc.
|
7
|
+
|
8
|
+
The gem will provide with methods to save generated templates as static html pages.
|
9
|
+
It also comes with a Rack server that allows you to serve the generated pages from
|
10
|
+
an endpoint within your App.
|
4
11
|
|
5
12
|
## Installation
|
6
13
|
|
@@ -18,7 +25,39 @@ Or install it yourself as:
|
|
18
25
|
|
19
26
|
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
In the action that you want to cache, use something like the following:
|
29
|
+
|
30
|
+
``ruby
|
31
|
+
|
32
|
+
def publish
|
33
|
+
imprenta_cache_template(template: "path/to/template",
|
34
|
+
layout: 'application',
|
35
|
+
id: 'mytemplateid')
|
36
|
+
|
37
|
+
redirect_to media_kit_path(@media_kit), notice: 'Media Kit Published'
|
38
|
+
end
|
39
|
+
``
|
40
|
+
|
41
|
+
Then in your routes add the following:
|
42
|
+
|
43
|
+
``ruby
|
44
|
+
|
45
|
+
get 'mystatic-pages/:id', :to => Imprenta.server
|
46
|
+
|
47
|
+
``
|
48
|
+
|
49
|
+
## Configuration
|
50
|
+
|
51
|
+
Imprenta allows you to customize the Rack server with your own middlewares. By defaut, it
|
52
|
+
will have loaded a middleware to handle 500,400,401,404, etc.
|
53
|
+
|
54
|
+
``ruby
|
55
|
+
|
56
|
+
Imprenta.configure do |config|
|
57
|
+
config.middlewares.use Bugsnag::Rack
|
58
|
+
end
|
59
|
+
|
60
|
+
``
|
22
61
|
|
23
62
|
## Contributing
|
24
63
|
|
data/imprenta.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["rafaelchacon@gmail.com"]
|
11
11
|
spec.description = %q{Publish and serve static html pages with Rails}
|
12
12
|
spec.summary = %q{This gem helps the process of publishing and serving static pages within rails}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/skyscrpr/imprenta"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/imprenta/version.rb
CHANGED
data/lib/imprenta.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imprenta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Chacon
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- lib/imprenta/rails.rb
|
73
73
|
- lib/imprenta/static_server.rb
|
74
74
|
- lib/imprenta/version.rb
|
75
|
-
homepage:
|
75
|
+
homepage: https://github.com/skyscrpr/imprenta
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|