p2 2.0 → 2.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +15 -8
- data/lib/p2/compiler.rb +1 -0
- data/lib/p2/proc_ext.rb +1 -1
- data/lib/p2/version.rb +1 -1
- metadata +18 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a0a95331ecb304e4fb0ae830d5c1f30a160a4ec9d26d86de8b22454fbef21e2
|
4
|
+
data.tar.gz: 49ecb084b5881d3f8287c4af46edfbf9b83930438baddafb3502ddf44b2a8b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b4aae65ebce0e4e87adf6e19e7c7731aa481dfeb3d6efb66c2ae345c704f828d0d2143a147e49f49061e0ad30c1b48209d198ffa9aaeca1cd743167257e297b
|
7
|
+
data.tar.gz: 6efe1aedca928c95a0102e1192c3406f8657c54536f18c0db741f86b8b365c9a178565171d7f5476f78ebb47b566a6d075c5dad674d6c4ae41fc995f603a0ce5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,9 +24,9 @@
|
|
24
24
|
|
25
25
|
## What is P2?
|
26
26
|
|
27
|
-
P2 is a templating engine for dynamically producing
|
28
|
-
|
29
|
-
|
27
|
+
P2 is a templating engine for dynamically producing HTML. P2 templates are
|
28
|
+
expressed as Ruby procs, leading to easier debugging, better protection against
|
29
|
+
HTML injection attacks, and better code reuse.
|
30
30
|
|
31
31
|
P2 templates can be composed in a variety of ways, facilitating the usage of
|
32
32
|
layout templates, and enabling a component-oriented approach to building complex
|
@@ -37,11 +37,8 @@ making the data flow easy to follow and understand. P2 also lets developers
|
|
37
37
|
create derivative templates using full or partial parameter application.
|
38
38
|
|
39
39
|
P2 includes built-in support for rendering Markdown (using
|
40
|
-
[Kramdown](https://github.com/gettalong/kramdown/)).
|
41
|
-
|
42
|
-
P2 automatically escapes all text emitted in templates according to the template
|
43
|
-
type. For more information see the section on [escaping
|
44
|
-
content](#escaping-content).
|
40
|
+
[Kramdown](https://github.com/gettalong/kramdown/)). P2 also automatically
|
41
|
+
escapes all text emitted in templates.
|
45
42
|
|
46
43
|
```ruby
|
47
44
|
require 'p2'
|
@@ -64,6 +61,16 @@ hello.render(name: 'world')
|
|
64
61
|
#=> "<html><head><title>Title</title></head><body><h1>Hello, world!</h1></body></html>"
|
65
62
|
```
|
66
63
|
|
64
|
+
P2 features:
|
65
|
+
|
66
|
+
- Express HTML using plain Ruby procs.
|
67
|
+
- Automatic compilation for super-fast execution (up to 2X faster than ERB templates).
|
68
|
+
- Deferred rendering using `defer`.
|
69
|
+
- Template composition (for uses such as layouts).
|
70
|
+
- Automatic conversion of backtraces for exceptions occurring while rendering,
|
71
|
+
in order to point to the correct spot in the original template code.
|
72
|
+
|
73
|
+
|
67
74
|
## Table of Content
|
68
75
|
|
69
76
|
- [Installing P2](#installing-p2)
|
data/lib/p2/compiler.rb
CHANGED
data/lib/p2/proc_ext.rb
CHANGED
data/lib/p2/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 0.8.
|
18
|
+
version: 0.8.2
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 0.8.
|
25
|
+
version: 0.8.2
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: kramdown
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,6 +93,20 @@ dependencies:
|
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: 2.7.2
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: tilt
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.2.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 2.2.0
|
96
110
|
email: sharon@noteflakes.com
|
97
111
|
executables: []
|
98
112
|
extensions: []
|
@@ -111,9 +125,8 @@ homepage: http://github.com/digital-fabric/p2
|
|
111
125
|
licenses:
|
112
126
|
- MIT
|
113
127
|
metadata:
|
114
|
-
source_code_uri: https://github.com/digital-fabric/p2
|
115
|
-
documentation_uri: https://www.rubydoc.info/gems/p2
|
116
128
|
homepage_uri: https://github.com/digital-fabric/p2
|
129
|
+
documentation_uri: https://www.rubydoc.info/gems/p2
|
117
130
|
changelog_uri: https://github.com/digital-fabric/p2/blob/master/CHANGELOG.md
|
118
131
|
rdoc_options:
|
119
132
|
- "--title"
|