inversion 1.3.1 → 1.4.0
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
- checksums.yaml.gz.sig +0 -0
- data/Examples.md +134 -0
- data/GettingStarted.md +50 -0
- data/Guide.md +14 -0
- data/{History.rdoc → History.md} +52 -43
- data/{README.rdoc → README.md} +43 -34
- data/Tags.md +555 -0
- data/bin/inversion +4 -8
- data/lib/inversion/cli/api.rb +75 -0
- data/lib/inversion/cli/tagtokens.rb +34 -0
- data/lib/inversion/cli/tree.rb +70 -0
- data/lib/inversion/cli.rb +406 -0
- data/lib/inversion/exceptions.rb +0 -1
- data/lib/inversion/mixins.rb +10 -11
- data/lib/inversion/parser.rb +5 -6
- data/lib/inversion/refinements.rb +18 -0
- data/lib/inversion/renderstate.rb +24 -25
- data/lib/inversion/sinatra.rb +0 -1
- data/lib/inversion/template/attrtag.rb +7 -5
- data/lib/inversion/template/begintag.rb +0 -1
- data/lib/inversion/template/calltag.rb +0 -1
- data/lib/inversion/template/codetag.rb +37 -28
- data/lib/inversion/template/commenttag.rb +0 -1
- data/lib/inversion/template/configtag.rb +3 -4
- data/lib/inversion/template/containertag.rb +1 -2
- data/lib/inversion/template/defaulttag.rb +1 -2
- data/lib/inversion/template/elsetag.rb +0 -1
- data/lib/inversion/template/elsiftag.rb +0 -1
- data/lib/inversion/template/endtag.rb +2 -3
- data/lib/inversion/template/escapetag.rb +1 -2
- data/lib/inversion/template/fortag.rb +2 -3
- data/lib/inversion/template/fragmenttag.rb +1 -2
- data/lib/inversion/template/iftag.rb +3 -1
- data/lib/inversion/template/importtag.rb +2 -3
- data/lib/inversion/template/includetag.rb +1 -2
- data/lib/inversion/template/node.rb +4 -5
- data/lib/inversion/template/pptag.rb +1 -2
- data/lib/inversion/template/publishtag.rb +2 -3
- data/lib/inversion/template/rescuetag.rb +1 -2
- data/lib/inversion/template/subscribetag.rb +3 -4
- data/lib/inversion/template/tag.rb +3 -4
- data/lib/inversion/template/textnode.rb +1 -2
- data/lib/inversion/template/timedeltatag.rb +1 -2
- data/lib/inversion/template/unlesstag.rb +0 -1
- data/lib/inversion/template/uriencodetag.rb +1 -2
- data/lib/inversion/template/yieldtag.rb +0 -1
- data/lib/inversion/template.rb +18 -22
- data/lib/inversion/tilt.rb +1 -2
- data/lib/inversion.rb +2 -3
- data/spec/helpers.rb +19 -13
- data/spec/inversion/mixins_spec.rb +1 -1
- data/spec/inversion/monkeypatches_spec.rb +1 -1
- data/spec/inversion/parser_spec.rb +1 -1
- data/spec/inversion/renderstate_spec.rb +1 -1
- data/spec/inversion/sinatra_spec.rb +1 -1
- data/spec/inversion/template/attrtag_spec.rb +1 -1
- data/spec/inversion/template/begintag_spec.rb +1 -1
- data/spec/inversion/template/calltag_spec.rb +1 -1
- data/spec/inversion/template/codetag_spec.rb +24 -1
- data/spec/inversion/template/commenttag_spec.rb +1 -1
- data/spec/inversion/template/configtag_spec.rb +1 -1
- data/spec/inversion/template/containertag_spec.rb +1 -1
- data/spec/inversion/template/defaulttag_spec.rb +1 -1
- data/spec/inversion/template/elsetag_spec.rb +1 -1
- data/spec/inversion/template/elsiftag_spec.rb +1 -1
- data/spec/inversion/template/endtag_spec.rb +1 -1
- data/spec/inversion/template/escapetag_spec.rb +1 -1
- data/spec/inversion/template/fortag_spec.rb +1 -1
- data/spec/inversion/template/fragmenttag_spec.rb +1 -1
- data/spec/inversion/template/iftag_spec.rb +1 -1
- data/spec/inversion/template/importtag_spec.rb +1 -1
- data/spec/inversion/template/includetag_spec.rb +1 -1
- data/spec/inversion/template/node_spec.rb +1 -1
- data/spec/inversion/template/pptag_spec.rb +1 -1
- data/spec/inversion/template/publishtag_spec.rb +1 -1
- data/spec/inversion/template/rescuetag_spec.rb +1 -1
- data/spec/inversion/template/subscribetag_spec.rb +1 -1
- data/spec/inversion/template/tag_spec.rb +1 -1
- data/spec/inversion/template/textnode_spec.rb +1 -1
- data/spec/inversion/template/timedeltatag_spec.rb +1 -1
- data/spec/inversion/template/unlesstag_spec.rb +1 -1
- data/spec/inversion/template/uriencodetag_spec.rb +1 -1
- data/spec/inversion/template/yieldtag_spec.rb +1 -1
- data/spec/inversion/template_spec.rb +1 -1
- data/spec/inversion/tilt_spec.rb +1 -1
- data/spec/inversion_spec.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +59 -45
- metadata.gz.sig +0 -0
- data/Examples.rdoc +0 -134
- data/GettingStarted.rdoc +0 -44
- data/Guide.rdoc +0 -47
- data/Manifest.txt +0 -86
- data/Rakefile +0 -7
- data/Tags.rdoc +0 -560
- data/lib/inversion/command.rb +0 -278
- data/lib/inversion/monkeypatches.rb +0 -21
@@ -9,7 +9,7 @@ require 'inversion/template/commenttag'
|
|
9
9
|
require 'inversion/template/fortag'
|
10
10
|
require 'inversion/renderstate'
|
11
11
|
|
12
|
-
describe Inversion::Template::RescueTag do
|
12
|
+
RSpec.describe Inversion::Template::RescueTag do
|
13
13
|
|
14
14
|
it "handles a non-existant body" do
|
15
15
|
tag = Inversion::Template::RescueTag.new( nil )
|
@@ -7,7 +7,7 @@ require 'inversion/template'
|
|
7
7
|
require 'inversion/template/textnode'
|
8
8
|
require 'inversion/template/subscribetag'
|
9
9
|
|
10
|
-
describe Inversion::Template::SubscribeTag do
|
10
|
+
RSpec.describe Inversion::Template::SubscribeTag do
|
11
11
|
|
12
12
|
|
13
13
|
it "raises a parse error if the key isn't a simple attribute" do
|
@@ -7,7 +7,7 @@ require 'inversion/template/unlesstag'
|
|
7
7
|
require 'inversion/template/textnode'
|
8
8
|
require 'inversion/renderstate'
|
9
9
|
|
10
|
-
describe Inversion::Template::UnlessTag do
|
10
|
+
RSpec.describe Inversion::Template::UnlessTag do
|
11
11
|
|
12
12
|
|
13
13
|
it "renders its contents if its attribute is false" do
|
@@ -5,7 +5,7 @@ require_relative '../../helpers'
|
|
5
5
|
|
6
6
|
require 'inversion/template/yieldtag'
|
7
7
|
|
8
|
-
describe Inversion::Template::YieldTag do
|
8
|
+
RSpec.describe Inversion::Template::YieldTag do
|
9
9
|
|
10
10
|
|
11
11
|
it "calls the renderstate's block before rendering, and renders as its return value" do
|
data/spec/inversion/tilt_spec.rb
CHANGED
data/spec/inversion_spec.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inversion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -11,9 +11,9 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
MIID+DCCAmCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
15
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMjAxMDcyMzU4MTRaFw0yMzAxMDcyMzU4
|
16
|
+
MTRaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
17
17
|
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
18
18
|
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
19
19
|
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
|
@@ -22,77 +22,90 @@ cert_chain:
|
|
22
22
|
vQ66lts4alKC69TE5cuKasWBm+16A4aEe3XdZBRNmtOu/g81gvwA7fkJHKllJuaI
|
23
23
|
dXzdHqq+zbGZVSQ7pRYHYomD0IiDe1DbIouFnPWmagaBnGHwXkDT2bKKP+s2v21m
|
24
24
|
ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
|
25
|
-
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
XrxOxp8o0uOkU7FdLSGsyqJ2LzsR4obN
|
25
|
+
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYD
|
26
|
+
VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4DANBgkqhkiG
|
27
|
+
9w0BAQsFAAOCAYEASrm1AbEoxACZ9WXJH3R5axV3U0CA4xaETlL2YT+2nOfVBMQ9
|
28
|
+
0ZlkPx6j4ghKJgAIi1TMfDM2JyPJsppQh8tiNccDjWc62UZRY/dq26cMqf/lcI+a
|
29
|
+
6YBuEYvzZfearwVs8tHnXtwYV3WSCoCOQaB+nq2lA1O+nkKNl41WOsVbNama5jx3
|
30
|
+
8cQtVSEEmZy6jIDJ8c5TmBJ7BQUDEUEWA/A3V42Xyctoj7DvUXWE0lP+X6ypAVSr
|
31
|
+
lFh3TS64D7NTvxkmg7natUoCvobl6kGl4yMaqE4YRTlfuzhpf91TSOntClqrAOsS
|
32
|
+
K1s56WndQj3IoBocdY9mQhDZLtLHofSkymoP8btBlj5SsN24TiF0VMSZlctSCYZg
|
33
|
+
GKyHim/MMlIfGOWsgfioq5jzwmql7W4CDubbb8Lkg70v+hN2E/MnNVAcNE3gyaGc
|
34
|
+
P5YP5BAbNW+gvd3QHRiWTTuhgHrdDnGdXg93N2M5KHn1ug8BtPLQwlcFwEpKnlLn
|
35
|
+
btEP+7EplFuoiMfd
|
37
36
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
37
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
39
38
|
dependencies:
|
40
39
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
40
|
+
name: loggability
|
42
41
|
requirement: !ruby/object:Gem::Requirement
|
43
42
|
requirements:
|
44
43
|
- - "~>"
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
45
|
+
version: '0.17'
|
47
46
|
type: :runtime
|
48
47
|
prerelease: false
|
49
48
|
version_requirements: !ruby/object:Gem::Requirement
|
50
49
|
requirements:
|
51
50
|
- - "~>"
|
52
51
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
52
|
+
version: '0.17'
|
54
53
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
54
|
+
name: sysexits
|
56
55
|
requirement: !ruby/object:Gem::Requirement
|
57
56
|
requirements:
|
58
57
|
- - "~>"
|
59
58
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
59
|
+
version: '1.2'
|
61
60
|
type: :runtime
|
62
61
|
prerelease: false
|
63
62
|
version_requirements: !ruby/object:Gem::Requirement
|
64
63
|
requirements:
|
65
64
|
- - "~>"
|
66
65
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
66
|
+
version: '1.2'
|
68
67
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
68
|
+
name: gli
|
70
69
|
requirement: !ruby/object:Gem::Requirement
|
71
70
|
requirements:
|
72
71
|
- - "~>"
|
73
72
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
73
|
+
version: '2.21'
|
75
74
|
type: :runtime
|
76
75
|
prerelease: false
|
77
76
|
version_requirements: !ruby/object:Gem::Requirement
|
78
77
|
requirements:
|
79
78
|
- - "~>"
|
80
79
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
80
|
+
version: '2.21'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: tty-prompt
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.23'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0.23'
|
82
95
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
96
|
+
name: pastel
|
84
97
|
requirement: !ruby/object:Gem::Requirement
|
85
98
|
requirements:
|
86
99
|
- - "~>"
|
87
100
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
101
|
+
version: '0.8'
|
89
102
|
type: :runtime
|
90
103
|
prerelease: false
|
91
104
|
version_requirements: !ruby/object:Gem::Requirement
|
92
105
|
requirements:
|
93
106
|
- - "~>"
|
94
107
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
108
|
+
version: '0.8'
|
96
109
|
- !ruby/object:Gem::Dependency
|
97
110
|
name: rack-test
|
98
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,14 +126,14 @@ dependencies:
|
|
113
126
|
requirements:
|
114
127
|
- - "~>"
|
115
128
|
- !ruby/object:Gem::Version
|
116
|
-
version: '0.
|
129
|
+
version: '0.21'
|
117
130
|
type: :development
|
118
131
|
prerelease: false
|
119
132
|
version_requirements: !ruby/object:Gem::Requirement
|
120
133
|
requirements:
|
121
134
|
- - "~>"
|
122
135
|
- !ruby/object:Gem::Version
|
123
|
-
version: '0.
|
136
|
+
version: '0.21'
|
124
137
|
- !ruby/object:Gem::Dependency
|
125
138
|
name: rdoc
|
126
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,19 +149,19 @@ dependencies:
|
|
136
149
|
- !ruby/object:Gem::Version
|
137
150
|
version: '6.2'
|
138
151
|
- !ruby/object:Gem::Dependency
|
139
|
-
name: rdoc-generator-
|
152
|
+
name: rdoc-generator-sixfish
|
140
153
|
requirement: !ruby/object:Gem::Requirement
|
141
154
|
requirements:
|
142
155
|
- - "~>"
|
143
156
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
157
|
+
version: '0.1'
|
145
158
|
type: :development
|
146
159
|
prerelease: false
|
147
160
|
version_requirements: !ruby/object:Gem::Requirement
|
148
161
|
requirements:
|
149
162
|
- - "~>"
|
150
163
|
- !ruby/object:Gem::Version
|
151
|
-
version: '0.
|
164
|
+
version: '0.1'
|
152
165
|
- !ruby/object:Gem::Dependency
|
153
166
|
name: rspec-wait
|
154
167
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,21 +244,22 @@ executables:
|
|
231
244
|
extensions: []
|
232
245
|
extra_rdoc_files: []
|
233
246
|
files:
|
234
|
-
- Examples.
|
235
|
-
- GettingStarted.
|
236
|
-
- Guide.
|
237
|
-
- History.
|
238
|
-
-
|
239
|
-
-
|
240
|
-
- Rakefile
|
241
|
-
- Tags.rdoc
|
247
|
+
- Examples.md
|
248
|
+
- GettingStarted.md
|
249
|
+
- Guide.md
|
250
|
+
- History.md
|
251
|
+
- README.md
|
252
|
+
- Tags.md
|
242
253
|
- bin/inversion
|
243
254
|
- lib/inversion.rb
|
244
|
-
- lib/inversion/
|
255
|
+
- lib/inversion/cli.rb
|
256
|
+
- lib/inversion/cli/api.rb
|
257
|
+
- lib/inversion/cli/tagtokens.rb
|
258
|
+
- lib/inversion/cli/tree.rb
|
245
259
|
- lib/inversion/exceptions.rb
|
246
260
|
- lib/inversion/mixins.rb
|
247
|
-
- lib/inversion/monkeypatches.rb
|
248
261
|
- lib/inversion/parser.rb
|
262
|
+
- lib/inversion/refinements.rb
|
249
263
|
- lib/inversion/renderstate.rb
|
250
264
|
- lib/inversion/sinatra.rb
|
251
265
|
- lib/inversion/template.rb
|
@@ -340,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
354
|
- !ruby/object:Gem::Version
|
341
355
|
version: '0'
|
342
356
|
requirements: []
|
343
|
-
rubygems_version: 3.
|
357
|
+
rubygems_version: 3.3.7
|
344
358
|
signing_key:
|
345
359
|
specification_version: 4
|
346
360
|
summary: Inversion is a templating system for Ruby.
|
metadata.gz.sig
CHANGED
Binary file
|
data/Examples.rdoc
DELETED
@@ -1,134 +0,0 @@
|
|
1
|
-
= Annotated Examples
|
2
|
-
|
3
|
-
This is a list of template examples with annotations explaining what each group of lines is doing.
|
4
|
-
|
5
|
-
== Simple Examples
|
6
|
-
|
7
|
-
...
|
8
|
-
|
9
|
-
|
10
|
-
== Advanced Examples
|
11
|
-
|
12
|
-
Here's a somewhat more complex example. At our company Spime-Thorpe from above, say we're creating a system that will handle mass layoffs without the need for management to handle all those messy personal interactions. We'll need a mass-mailer for the employees that will be afforded the chance to explore their career opportunities, right? So we create a template called +overboard-mail.tmpl+:
|
13
|
-
|
14
|
-
<?config debugging_comments: true ?>
|
15
|
-
<?default grace_period to "7 days" ?>
|
16
|
-
|
17
|
-
<?begin?>
|
18
|
-
<p>Dear <?call employee.fullname ?>,</p>
|
19
|
-
<?rescue DatabaseError ?>
|
20
|
-
<p>Dear Valued Ex-Employee,</p>
|
21
|
-
<?end begin?>
|
22
|
-
|
23
|
-
<p>Congratulations! You have been selected by <?call failed_company.name ?>'s
|
24
|
-
elite management team as one of the many lucky individuals that will
|
25
|
-
enjoy the exciting challenge of pursuing other rewarding employment
|
26
|
-
opportunities!</p>
|
27
|
-
|
28
|
-
<p><em>Kudos!</em></p>
|
29
|
-
|
30
|
-
<p>You will find your accounts have been disabled, your desk has been helpfully
|
31
|
-
cleared out for you, and all of your personal effects packaged up and
|
32
|
-
delivered to your address of record approximately
|
33
|
-
<?timedelta tracking_info.delivery_date ?>:</p>
|
34
|
-
|
35
|
-
<?for line in employee.address ?>
|
36
|
-
<?attr line ?><br />
|
37
|
-
<?end for ?>
|
38
|
-
|
39
|
-
<p>Please visit your <a href="[?call config.overboard_url ?]/[?uriencode
|
40
|
-
failed_company.id ?]/[?uriencode employee.id ?]">customized Man OverBoard
|
41
|
-
transition site</a> immediately:</p>
|
42
|
-
|
43
|
-
<p>This will acknowledge that you have received this message, and automatically
|
44
|
-
disable your email account. Be sure and save this message!</p>
|
45
|
-
|
46
|
-
<?if employee.severance_amount.nonzero? ?>
|
47
|
-
<p>Failure to acknowledge this message within <?attr grace_period ?> could result
|
48
|
-
in delay of your final severance pay, in the amount of
|
49
|
-
<?call "$%0.2f" % employee.severance_amount ?>.</p>
|
50
|
-
<?else?>
|
51
|
-
<p>Failure to acknowledge this message within <?attr grace_period ?> will
|
52
|
-
result in automatic forfeiture of your numerous Man Overboard package benefits.</p>
|
53
|
-
<?end if?>
|
54
|
-
|
55
|
-
<?comment Disabled at client request ?>
|
56
|
-
If you have any questions or concerns, please don't hesitate to contact your
|
57
|
-
friendly Spime-Thorpe <a href="mailto:salesteam2@spime-thorpe.com">representative</a>.
|
58
|
-
<?end comment ?>
|
59
|
-
|
60
|
-
<p>Good Luck,<br />
|
61
|
-
Your friends at Spime-Thorpe, Inc!<br />
|
62
|
-
<a href="http://www.spime-thorpe.com/">http://www.spime-thorpe.com/</a></p>
|
63
|
-
|
64
|
-
When wrapped with a layout template, here's what this renders as:
|
65
|
-
|
66
|
-
<?example { language: xml, caption: "The rendered output for one lucky individual" } ?>
|
67
|
-
<!DOCTYPE html>
|
68
|
-
<!--
|
69
|
-
|
70
|
-
Spime-Thorpe!
|
71
|
-
$Id$
|
72
|
-
|
73
|
-
-->
|
74
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
75
|
-
<head>
|
76
|
-
<title>Spime-Thorpe: Untitled</title>
|
77
|
-
|
78
|
-
<link rel="stylesheet" src="/css/base.css" type="text/css" />
|
79
|
-
|
80
|
-
<script type="text/javascript" src="/js/jquery-latest.min.js"></script>
|
81
|
-
|
82
|
-
</head>
|
83
|
-
<body>
|
84
|
-
|
85
|
-
<header>
|
86
|
-
<hgroup>
|
87
|
-
<h1>Spime-Thorpe</h1>
|
88
|
-
<h2></h2>
|
89
|
-
</hgroup>
|
90
|
-
</header>
|
91
|
-
|
92
|
-
<section id="content">
|
93
|
-
<p>Dear James Random,</p>
|
94
|
-
|
95
|
-
<p>Congratulations! You have been selected by Widgets R Us's
|
96
|
-
elite management team as one of the many lucky individuals that will
|
97
|
-
enjoy the exciting challenge of pursuing other rewarding employment
|
98
|
-
opportunities!</p>
|
99
|
-
|
100
|
-
<p><em>Kudos!</em></p>
|
101
|
-
|
102
|
-
<p>You will find your accounts have been disabled, your desk has been helpfully
|
103
|
-
cleared out for you, and all of your personal effects packaged up and
|
104
|
-
delivered to your address of record approximately
|
105
|
-
3 days ago:</p>
|
106
|
-
|
107
|
-
1213 NE. Winding Road<br />
|
108
|
-
Syracuse, NY 100213<br />
|
109
|
-
|
110
|
-
<p>Please visit your <a href="http://failedcompany.spime-thorpe.com/overboard/a18661/1881">
|
111
|
-
customized Man OverBoard transition site</a> immediately:</p>
|
112
|
-
|
113
|
-
<p>This will acknowledge that you have received this message, and automatically
|
114
|
-
disable your email account. Be sure and save this message!</p>
|
115
|
-
|
116
|
-
<p>Failure to acknowledge this message within 11 days could result
|
117
|
-
in delay of your final severance pay, in the amount of
|
118
|
-
$12.81.</p>
|
119
|
-
|
120
|
-
|
121
|
-
<p>Good Luck,<br />
|
122
|
-
Your friends at Spime-Thorpe, Inc!<br />
|
123
|
-
<a href="http://www.spime-thorpe.com/">http://www.spime-thorpe.com/</a></p>
|
124
|
-
</section>
|
125
|
-
|
126
|
-
<footer>
|
127
|
-
<section id="copyright">Copyright 2011, Spime-Thorpe</section>
|
128
|
-
</footer>
|
129
|
-
|
130
|
-
</body>
|
131
|
-
</html>
|
132
|
-
|
133
|
-
This example can be found in the Inversion repository, in the +experiments+ directory.
|
134
|
-
|
data/GettingStarted.rdoc
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
= Getting Started
|
2
|
-
|
3
|
-
== Requirements
|
4
|
-
|
5
|
-
- Ruby 1.9.2 or later
|
6
|
-
|
7
|
-
== Installation
|
8
|
-
|
9
|
-
$ gem install inversion
|
10
|
-
|
11
|
-
== Basic Usage
|
12
|
-
|
13
|
-
Inversion, like most other templating systems, works by giving you a way of defining the static
|
14
|
-
parts of your output, and then letting you combine that at a later point with the dynamic parts:
|
15
|
-
|
16
|
-
Create the template and use it to render an exciting message:
|
17
|
-
|
18
|
-
tmpl = Inversion::Template.new( "Hello, <?attr name ?>!" )
|
19
|
-
tmpl.name = "World"
|
20
|
-
puts tmpl.render
|
21
|
-
|
22
|
-
The +<?attr name ?>+ tag defines the _name_ accessor on the template[rdoc-ref:Templates]
|
23
|
-
object, the value of which is substituted for any occurrences of +name+ in the template:
|
24
|
-
|
25
|
-
Hello, World!
|
26
|
-
|
27
|
-
This by itself isn't fantastically useful, but it does illustrate one of the ways in which Inversion
|
28
|
-
is different: the program and the template share data through an API, instead of through a complex
|
29
|
-
data structure, which establishes a clear delineation between what responsibility is the program's
|
30
|
-
and which is the template's. The program doesn't have to know how the view uses the data it's given,
|
31
|
-
and tests of the controller can substitute a Mock Object for the template to test the interaction
|
32
|
-
between the two instead of having to match patterns in the eventual output like an integration test.
|
33
|
-
|
34
|
-
You can also interact with the values set in the template:
|
35
|
-
|
36
|
-
Name: <?attr employee.full_name ?>
|
37
|
-
|
38
|
-
This will call the #full_name method on whatever is set as the +employee+ attribute when
|
39
|
-
rendered, and the result will take the place of the tag.
|
40
|
-
|
41
|
-
Inversion also comes with a collection of {other tags}[rdoc-ref:Tags] that
|
42
|
-
provide flow control, exception-handling, etc.
|
43
|
-
|
44
|
-
|
data/Guide.rdoc
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
= Inversion User's Guide
|
2
|
-
|
3
|
-
Inversion is a templating system for Ruby. It uses the Inversion of Control principle to decouple
|
4
|
-
the contents and structure of the template from the code that uses it, making it easier to use,
|
5
|
-
test-friendly, and clean.
|
6
|
-
|
7
|
-
{Getting Started}[rdoc-ref:GettingStarted] goes over the requirements, installation, and basic usage of the library.
|
8
|
-
|
9
|
-
The rdoc-ref:Templates topic has more details about how to load templates and control their behavior with options.
|
10
|
-
|
11
|
-
When you're ready to start making your own templates, there's a quick-reference for the list of built-in rdoc-ref:Tags, too.
|
12
|
-
|
13
|
-
Finally, there are a number of {Annotated Examples}[rdoc-ref:Examples] that illustrate how to solve common problems while templating.
|
14
|
-
|
15
|
-
|
16
|
-
== Authors
|
17
|
-
|
18
|
-
* Michael Granger
|
19
|
-
* Mahlon E. Smith
|
20
|
-
|
21
|
-
|
22
|
-
== License
|
23
|
-
|
24
|
-
Copyright © 2011-2015, Michael Granger, Mahlon E. Smith
|
25
|
-
All rights reserved.
|
26
|
-
|
27
|
-
Redistribution and use in source and binary forms, with or without modification, are
|
28
|
-
permitted provided that the following conditions are met:
|
29
|
-
|
30
|
-
* Redistributions of source code must retain the above copyright notice, this list of
|
31
|
-
conditions and the following disclaimer.
|
32
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
33
|
-
conditions and the following disclaimer in the documentation and/or other materials
|
34
|
-
provided with the distribution.
|
35
|
-
* Neither the name of the authors nor contributors may be used to endorse or promote products
|
36
|
-
derived from this software without specific prior written permission.
|
37
|
-
|
38
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
39
|
-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
40
|
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
41
|
-
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
42
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
43
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
44
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
45
|
-
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
46
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
47
|
-
|