imprenta 0.0.1 → 0.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: 459db6fcf19b139f775326dee32096ee92152515
4
- data.tar.gz: 74551ca9d29c416ef35aba742ad45def1410ce3a
3
+ metadata.gz: 5fa4d44f02caca84304d491edc76e7de0de8929f
4
+ data.tar.gz: 867f4e5beb6b3e58eb04455efafc9c804d704592
5
5
  SHA512:
6
- metadata.gz: b92b94803153b7dcd326437b0089d9bdfe63dd6e6c4f32b2cebd5ccfcd17226697413fdb1ca563caeb72aa9effe339072c5c1fd70862043aee460811ea6ee82e
7
- data.tar.gz: 7831f36d1b434abeacf5b4268c738882c3cdad4fa3a5a99efb3f67dffb3d2dd2d77db7d56418c42b33b86f1015ca22d24aaad436b8d24214fc72730c7d8e7fb8
6
+ metadata.gz: d97d77fe122eafce9d6bc5b76c35cd7a4308f8b314e60c8021b7918ffcdb2d795badadec2c7df4a3c7bd89cf8ceb6d284c007e0f928d001bf41e4d2b63409ab9
7
+ data.tar.gz: 80d2e0f80eaa62ca1c879d85a69a83b208e5184b504760a8c3524c97d8fc923272c6efae536bac62eeeaf018dbc2f951f2692ab6b4e49b0e3c514d62fafae007
data/README.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Imprenta
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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($/)
@@ -12,8 +12,8 @@ module Imprenta
12
12
  setup_default_middlewares
13
13
  end
14
14
 
15
- def configure(&block)
16
- block.call
15
+ def configure
16
+ yield self
17
17
  end
18
18
 
19
19
  def reset
@@ -2,7 +2,6 @@ module Imprenta
2
2
  class StaticServer
3
3
  def initialize(args = {})
4
4
  @middleware_stack = args.fetch(:middlewares)
5
- # @middleware_stack.use Bugsnag::Rack
6
5
  end
7
6
 
8
7
  def call(env)
@@ -1,3 +1,3 @@
1
1
  module Imprenta
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/imprenta.rb CHANGED
@@ -18,7 +18,7 @@ module Imprenta
18
18
  end
19
19
 
20
20
  def configure(&block)
21
- configuration.configure(block)
21
+ configuration.configure(&block)
22
22
  end
23
23
  end
24
24
  end
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.1
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: {}