masterview 0.2.1 → 0.2.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.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.2.2 - June 30th, 2006 - Fix bug when not generating rhtml that rails template error could not find source and thus would fail to generate rhtml error page
2
+
1
3
  0.2.1 - June 28th, 2006
2
4
  Added Mongrel support
3
5
  Added image_tag directive
data/RELEASE_NOTES CHANGED
@@ -1,5 +1,29 @@
1
1
  = MasterView - Rails-optimized (x)html friendly template engine
2
2
 
3
+ == Recent changes (Release 0.2.2)
4
+
5
+ Fixes problem when rails encounters exception in either compiling or
6
+ involving RuntimeError in the generated rhtml. The rails TemplateError
7
+ class looks at the file system for the template contents. So when
8
+ generate_rhtml is false (no file is generated) rails was not able to
9
+ find source and was not outputting an error page. Rails TemplateError
10
+ class was extended to look at MasterView store first and then fallback
11
+ to file system.
12
+
13
+ == Recent changes (Release 0.2.1)
14
+
15
+ Release 0.2.1 adds Mongrel support, a new image_tag directive
16
+ and some additional illustrations and links to videos. Also
17
+ javascript_include and stylesheet_link directives can infer the
18
+ path from the src attribute if the attr_value is empty.
19
+
20
+ Also added additional logging around startup and the version of
21
+ MasterView that is running and a new admin page to visually
22
+ see what MasterView features are currently loaded (tidy,
23
+ auto parsing on change, parse on startup, reading rhtml direct
24
+ from masterview (eliminating rhtml file generation))
25
+
26
+
3
27
  == Recent changes (Release 0.2.0)
4
28
 
5
29
  Release 0.2.0 features a number of significant improvements.
data/Rakefile CHANGED
@@ -279,6 +279,8 @@ PKG_FILES_MV_PLUGIN_GENERATOR = [
279
279
 
280
280
  PKG_FILES_DOCS = [ # docs and examples, actually
281
281
  "doc/*",
282
+ "doc/images/*.png",
283
+ "doc/screenshots/*",
282
284
  "doc/stylesheets/*",
283
285
  "examples/**/*"
284
286
  ]
@@ -17,12 +17,29 @@
17
17
  <body>
18
18
 
19
19
  <div id="pageHeader">
20
- <div>MasterView Template Engine</div>
21
- <div class="description">Rails-optimized (x)html friendly template engine</div>
20
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
21
+ </div>
22
+
23
+ <div id="headerNav">
24
+ <div>
25
+ &middot;&nbsp;
26
+ <a href="./index.html">Doc Home</a>
27
+ &nbsp;|&nbsp;
28
+ <a href="./installation.html">Installation</a>
29
+ &nbsp;|&nbsp;
30
+ <a href="./configuration.html">Configuration</a>
31
+ &nbsp;|&nbsp;
32
+ <a href="./guide.html">Usage</a>
33
+ &nbsp;|&nbsp;
34
+ <a href="./directives.html">Directives</a>
35
+ &nbsp;&nbsp;
36
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
37
+ &nbsp;&middot;
38
+ </div>
22
39
  </div>
23
40
 
24
41
  <div id="pageBody">
25
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
42
+ <div id="bodyContent">
26
43
 
27
44
  <h1>MasterView - Configuration Guide</h1>
28
45
 
data/doc/directives.html CHANGED
@@ -17,12 +17,29 @@
17
17
  <body>
18
18
 
19
19
  <div id="pageHeader">
20
- <div>MasterView Template Engine</div>
21
- <div class="description">Rails-optimized (x)html friendly template engine</div>
20
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
21
+ </div>
22
+
23
+ <div id="headerNav">
24
+ <div>
25
+ &middot;&nbsp;
26
+ <a href="./index.html">Doc Home</a>
27
+ &nbsp;|&nbsp;
28
+ <a href="./installation.html">Installation</a>
29
+ &nbsp;|&nbsp;
30
+ <a href="./configuration.html">Configuration</a>
31
+ &nbsp;|&nbsp;
32
+ <a href="./guide.html">Usage</a>
33
+ &nbsp;|&nbsp;
34
+ <a href="./directives.html">Directives</a>
35
+ &nbsp;&nbsp;
36
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
37
+ &nbsp;&middot;
38
+ </div>
22
39
  </div>
23
40
 
24
41
  <div id="pageBody">
25
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
42
+ <div id="bodyContent">
26
43
 
27
44
  <h1>MasterView - Directives Reference</h1>
28
45
 
data/doc/guide.html CHANGED
@@ -16,12 +16,29 @@
16
16
  <body>
17
17
 
18
18
  <div id="pageHeader">
19
- <div>MasterView Template Engine</div>
20
- <div class="description">Rails-optimized (x)html friendly template engine</div>
19
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
20
+ </div>
21
+
22
+ <div id="headerNav">
23
+ <div>
24
+ &middot;&nbsp;
25
+ <a href="./index.html">Doc Home</a>
26
+ &nbsp;|&nbsp;
27
+ <a href="./installation.html">Installation</a>
28
+ &nbsp;|&nbsp;
29
+ <a href="./configuration.html">Configuration</a>
30
+ &nbsp;|&nbsp;
31
+ <a href="./guide.html">Usage</a>
32
+ &nbsp;|&nbsp;
33
+ <a href="./directives.html">Directives</a>
34
+ &nbsp;&nbsp;
35
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
36
+ &nbsp;&middot;
37
+ </div>
21
38
  </div>
22
39
 
23
40
  <div id="pageBody">
24
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
41
+ <div id="bodyContent">
25
42
 
26
43
  <h1>MasterView - User's Guide</h1>
27
44
 
@@ -104,6 +121,54 @@ however MasterView also supports
104
121
  generating all parts to a single file for the ultimate in DRY.
105
122
  </p>
106
123
  <p>
124
+ For example, if our generated Controller name is Store and the Model is Product this is
125
+ what would be generated.<br/>
126
+ <table id="generatedRhtml">
127
+ <thead>
128
+ <tr>
129
+ <th>Template</h>
130
+ <th>Contained rhtml parts</th>
131
+ </tr>
132
+ </thead>
133
+ <tbody>
134
+ <tr>
135
+ <td>list.html</td>
136
+ <td><b>layout/store.rhtml</b> (layout for the controller)<br/>
137
+ <b>store/_messages.rhtml</b> (flash/error messages partial)<br/>
138
+ <b>store/_product.rhtml</b> (line partial for each item in list)<br/>
139
+ <b>store/list.rhtml</b> (list view)
140
+ </td>
141
+ </tr>
142
+ <tr>
143
+ <td>new.html</td>
144
+ <td>
145
+ <b>store/_form.rhtml</b> (form partial with input fields, used by new and edit)<br/>
146
+ <b>store/new.rhtml</b> (new product view)
147
+ </td>
148
+ </tr>
149
+ <tr>
150
+ <td>edit.html</td>
151
+ <td>
152
+ <b>store/edit.rhtml</b> (edit product view)
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <td>show.html</td>
157
+ <td>
158
+ <b>store/_show.rhtml</b> (readonly product details partial, used by show and destroy)<br/>
159
+ <b>store/show.rhtml</b> (show product view)
160
+ </td>
161
+ </tr>
162
+ <tr>
163
+ <td>destroy.html</td>
164
+ <td>
165
+ <b>store/destroy.rhtml</b> (destroy product view)
166
+ </td>
167
+ </tr>
168
+ </tbody>
169
+ </table>
170
+ </p>
171
+ <p>
107
172
  By adding the &#8212;single-file switch MasterView will create a single file
108
173
  and to make it easier to use this template at design time, some design time
109
174
  css stylesheets are included in the file to hide all sections except one.
Binary file
data/doc/index.html CHANGED
@@ -11,25 +11,43 @@
11
11
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
12
12
 
13
13
  <link href="./stylesheets/masterview.css" rel="stylesheet" type="text/css" />
14
+
14
15
  </head>
15
16
 
16
17
  <body>
17
18
 
18
19
  <div id="pageHeader">
19
- <div>MasterView Template Engine</div>
20
- <div class="description">Rails-optimized (x)html friendly template engine</div>
20
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
21
+ </div>
22
+
23
+ <div id="headerNav">
24
+ <div>
25
+ &middot;&nbsp;
26
+ <a href="./index.html">Doc Home</a>
27
+ &nbsp;|&nbsp;
28
+ <a href="./installation.html">Installation</a>
29
+ &nbsp;|&nbsp;
30
+ <a href="./configuration.html">Configuration</a>
31
+ &nbsp;|&nbsp;
32
+ <a href="./guide.html">Usage</a>
33
+ &nbsp;|&nbsp;
34
+ <a href="./directives.html">Directives</a>
35
+ &nbsp;&nbsp;
36
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
37
+ &nbsp;&middot;
38
+ </div>
21
39
  </div>
22
40
 
23
41
  <div id="pageBody">
24
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
42
+ <div id="bodyContent">
25
43
 
26
44
  <h1>MasterView - Rails-optimized (x)html friendly template engine</h1>
27
45
 
28
46
  <p>
29
47
  MasterView is a ruby/rails
30
48
  optimized HTML/XHTML friendly template engine. It is designed to use the
31
- full power and productivity of rails including layouts, partials, and rails
32
- html helpers while still being editable/styleable in a WYSIWYG HTML editor.
49
+ <b>full power and productivity of rails including layouts, partials, and rails
50
+ html helpers</b> while still being editable/styleable in a <b>WYSIWYG</b> HTML editor.
33
51
  </p>
34
52
  <p>
35
53
  MasterView is distributed as a gem
@@ -83,16 +101,35 @@ end of this page.
83
101
 
84
102
  <h2>Illustrations/Diagrams</h2>
85
103
  <ul>
86
- <li><a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration">MasterView rendering illustration</a> - showing how MasterView renders rhtml internally</li>
104
+ <li><a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration">MasterView rendering illustration</a> - showing how MasterView renders rhtml internally<br/><br/>
105
+ <a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration"><img src="images/masterview_rhtml_rendering_thumbnail_smaller.png"/></a><br/><br/>
106
+ </li>
107
+ <li><a href="media_list.html" alt="MasterView Screenshots and other media">MasterView screenshots - showing some generated MasterView templates and MasterView Admin page</a><br/><br/>
108
+ <a href="media_list.html" alt="MasterView Screenshots and other media"><img src="screenshots/generated_new_thumbnail.png"/></a><br/><br/>
109
+ </li>
87
110
  </ul>
88
111
 
89
112
  <h2>Videos</h2>
90
113
  <ul>
91
- <li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)</li>
92
- <li><a href="http://masterview.org/videos/masterview_quick_start.html">MasterView Quick Start Video</a> - longer video detailing basic configuration and operation of MasterView (no audio, ~25 minutes, uses flash)</li>
114
+ <li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)<br/><br/>
115
+ <a href="http://masterview.org/videos/demo_short.html"><img src="screenshots/generated_list_thumbnail.png"/></a><br/><br/>
116
+
117
+ </li>
118
+ <li><a href="http://masterview.org/videos/masterview_quick_start.html">MasterView Quick Start Video</a> - longer video detailing basic configuration and operation of MasterView (no audio, ~25 minutes, uses flash)<br/><br/>
119
+ <a href="http://masterview.org/videos/masterview_quick_start.html"><img src="screenshots/masterview_admin_thumbnail.png"/></a><br/><br/>
120
+ </li>
93
121
  </ul>
94
122
 
123
+ <h2>Usage Scenarios</h2>
124
+ <ul>
125
+ <li><b>New project</b> - use MasterView to generate view to get your CRUD up quickly. Edit files in WYSIWYG editor to achieve layout and style you like for your project. Re-edit as needed throughout project</li>
126
+ <li><b>Existing html prototype</b> - sprinkle MasterView attribute directives into existing html prototype to bring prototype alive. Re-edit prototype as needed</li>
127
+ <li><b>Hybrid of legacy and new</b> - MasterView will coexist nicely with existing rhtml being able to utilize it in new templates or even bring the rhtml into a MasterView template to drive it from there. Build your new MasterView templates with the generator or by augmenting html prototypes.</li>
128
+ </ul>
95
129
 
130
+ <h2>Why another templating engine?</h2>
131
+ <p>In short, I needed a way to be able to use a WYSIWYG editor to design/layout my rails pages and didn't want to give up the power and productivity of layouts, partials, and rails helpers. I needed to be able to create html templates quickly that could be handed off to a graphic designer for complex styling, and then use those html templates directly in the project. I also needed to be able to take existing html prototypes and easily make them real. I wanted to be able to give these html templates back to the designer at anytime throughout the project if the style or layout needs to be updated. The existing templating solutions did not meet all my goals or desired operation. For more information, read the background story below.
132
+ </p>
96
133
 
97
134
  <h2>Goals</h2>
98
135
  <ul>
@@ -108,13 +145,20 @@ development without breaking template.
108
145
  limited in its capabilities over what can be done with ERb
109
146
 
110
147
  </li>
111
- <li>Work nicely with layouts, partials, and rails html helpers.
148
+ <li>Utilize layouts, partials, and rails html helpers.
112
149
 
113
150
  </li>
114
151
  <li>Reduce complexity, work with existing rails code, no extra view logic or
115
152
  hashes than what is used by ERb. Scaffold generate initial templates or
116
153
  work from existing html prototype.
117
154
 
155
+ </li>
156
+ <li>Production ready generated templates - Make generated scaffolding templates
157
+ useable for production. Build in proper structure and style hooks. Provide simple
158
+ CSS for style and color usage. Fully generate labels and fields so that
159
+ it will be simple to reorder or remove things from views there by eliminating much
160
+ of the re-work necessary to build out real-world views.
161
+
118
162
  </li>
119
163
  <li>Reduce the numbers of files, simplifying editing. Define partials and
120
164
  layouts naturallyl right in the template, no need to go to another file.
@@ -146,6 +190,16 @@ application.
146
190
 
147
191
  <p>See the <a href="installation.html">MasterView Installation Guide</a> for complete installation instructions.</p>
148
192
 
193
+ <p>Briefly installation/launching is as follows:
194
+ <pre style="background-color: #eeeeee">
195
+ &gt; gem install masterview_gem_pack
196
+ &gt; rails demo; cd demo
197
+ &gt; script/generate masterview_plugin
198
+ &gt; script/generate masterview YOURMODEL YOURCONTROLLERNAME
199
+ &gt; script/server
200
+ </pre>
201
+ </p>
202
+
149
203
  <p>See the <a href="configuration.html">MasterView Configuration Guide</a> for informatino about customizing the MasterView configuration settings for your application.</p>
150
204
 
151
205
  <h2>Usage</h2>
@@ -17,12 +17,29 @@
17
17
  <body>
18
18
 
19
19
  <div id="pageHeader">
20
- <div>MasterView Template Engine</div>
21
- <div class="description">Rails-optimized (x)html friendly template engine</div>
20
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
21
+ </div>
22
+
23
+ <div id="headerNav">
24
+ <div>
25
+ &middot;&nbsp;
26
+ <a href="./index.html">Doc Home</a>
27
+ &nbsp;|&nbsp;
28
+ <a href="./installation.html">Installation</a>
29
+ &nbsp;|&nbsp;
30
+ <a href="./configuration.html">Configuration</a>
31
+ &nbsp;|&nbsp;
32
+ <a href="./guide.html">Usage</a>
33
+ &nbsp;|&nbsp;
34
+ <a href="./directives.html">Directives</a>
35
+ &nbsp;&nbsp;
36
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
37
+ &nbsp;&middot;
38
+ </div>
22
39
  </div>
23
40
 
24
41
  <div id="pageBody">
25
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
42
+ <div id="bodyContent">
26
43
 
27
44
  <h1>MasterView - Installation Guide</h1>
28
45
 
data/doc/media_list.html CHANGED
@@ -16,26 +16,70 @@
16
16
  <body>
17
17
 
18
18
  <div id="pageHeader">
19
- <div>MasterView Template Engine</div>
20
- <div class="description">Rails-optimized (x)html friendly template engine</div>
19
+ <a href="index.html"><img id="logo" src="images/masterview_logo.png" alt="MasterView Rails-optimized (x)html friendly template engine"/></a>
20
+ </div>
21
+
22
+ <div id="headerNav">
23
+ <div>
24
+ &middot;&nbsp;
25
+ <a href="./index.html">Doc Home</a>
26
+ &nbsp;|&nbsp;
27
+ <a href="./installation.html">Installation</a>
28
+ &nbsp;|&nbsp;
29
+ <a href="./configuration.html">Configuration</a>
30
+ &nbsp;|&nbsp;
31
+ <a href="./guide.html">Usage</a>
32
+ &nbsp;|&nbsp;
33
+ <a href="./directives.html">Directives</a>
34
+ &nbsp;&nbsp;
35
+ <a href="./media_list.html">Media (Videos/Illustrations)</a>
36
+ &nbsp;&middot;
37
+ </div>
21
38
  </div>
22
39
 
23
40
  <div id="pageBody">
24
- <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
41
+ <div id="bodyContent">
25
42
 
26
43
  <h1>MasterView - Media list</h1>
27
44
 
28
45
  <h2>Illustrations/Diagrams</h2>
29
46
  <ul>
30
- <li><a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration">MasterView rendering illustration</a> - showing how MasterView renders rhtml internally</li>
47
+ <li><a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration">MasterView rendering illustration</a> - showing how MasterView renders rhtml internally<br/><br/>
48
+ <a href="simple_diagram.html" alt="MasterView rhtml Rendering Illustration"><img src="images/masterview_rhtml_rendering_thumbnail.png"/><br>
49
+ Click for larger view</a>
50
+ </li>
31
51
  </ul>
32
52
 
33
53
  <h2>Videos</h2>
34
54
  <ul>
35
- <li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)</li>
36
- <li><a href="http://masterview.org/videos/masterview_quick_start.html">MasterView Quick Start Video</a> - longer video detailing basic configuration and operation of MasterView (no audio, ~25 minutes, uses flash)</li>
55
+ <li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)<br/><br/>
56
+ <a href="http://masterview.org/videos/demo_short.html"><img src="screenshots/generated_list_thumbnail.png"/></a><br/><br/>
57
+
58
+ </li>
59
+ <li><a href="http://masterview.org/videos/masterview_quick_start.html">MasterView Quick Start Video</a> - longer video detailing basic configuration and operation of MasterView (no audio, ~25 minutes, uses flash)<br/><br/>
60
+ <a href="http://masterview.org/videos/masterview_quick_start.html"><img src="screenshots/masterview_admin_thumbnail.png"/></a><br/><br/>
61
+ </li>
37
62
  </ul>
38
63
 
64
+ <h2>Screenshots</h2>
65
+ <p>Here are some screenshots for some masterview generated views. <br/><br/>
66
+
67
+ <b>** Click on the image for fullsize view **</b>
68
+ </p>
69
+
70
+ <p>
71
+
72
+ <b>Generated list view</b><br/>
73
+ <a href="screenshots/generated_list.png" alt="Click for fullsize image of generated list view"><img src="screenshots/generated_list_medium.png"/></a><br/><br/>
74
+
75
+ <b>Generated New view</b><br/>
76
+ <a href="screenshots/generated_new.png" alt="Click for fullsize image of generated new view"><img src="screenshots/generated_new_medium.png"/></a><br/><br/>
77
+
78
+ <b>MasterView Admin Page</b><br/>
79
+ <a href="screenshots/masterview_admin.png" alt="Click for fullsize image of MasterView Admin Page"><img src="screenshots/masterview_admin_medium.png"/></a><br/><br/>
80
+
81
+ </p>
82
+
39
83
  </div> <!-- bodyContent -->
40
84
  </div>
41
85
 
Binary file
Binary file
@@ -79,6 +79,7 @@ div#pageHeader {
79
79
  padding-bottom: 6px;
80
80
  border-bottom: 1px solid black;
81
81
  }
82
+
82
83
  div#pageHeader div {
83
84
  width: 800px;
84
85
  text-align: center;
@@ -109,6 +110,8 @@ div#pageHeader {
109
110
  font-family: "Times New Roman", Times, serif;
110
111
  font-size: 36px;
111
112
  font-weight: bold;
113
+ background-image: url(../images/masterview_logo_gradient.png);
114
+ background-repeat: repeat-x;
112
115
  /*vertical-align: middle;*/
113
116
  }
114
117
  div#pageHeader .description {
@@ -116,6 +119,8 @@ div#pageHeader .description {
116
119
  font-style: italic;
117
120
  }
118
121
 
122
+ div#pageHeader a { background: transparent; text-decoration: none; }
123
+
119
124
  /* --- page body styles -------------------------------- */
120
125
 
121
126
  /*??? this came in from the rdoc stylesheet - do we want this?? */
@@ -204,3 +209,18 @@ pre.code { /* from http://facets.rubyforge.org/wiki/wiki.css */
204
209
  .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
205
210
  .ruby-regexp { color: #ffa07a; background: transparent; }
206
211
  .ruby-value { color: #7fffd4; background: transparent; }
212
+
213
+ /* ------ Page specific styles -----------------------*/
214
+
215
+ table#generatedRhtml, table#generatedRhtml thead th, table#generatedRhtml tbody td {
216
+ border-width: 1px;
217
+ border-style: solid;
218
+ border-collapse:collapse;
219
+ margin:0;
220
+ padding:0;
221
+ }
222
+
223
+ table#generatedRhtml tbody td, table#generatedRhtml thead th {
224
+ padding:.2em .5em;
225
+ vertical-align:top;
226
+ }
@@ -91,10 +91,38 @@ module ActionView #:nodoc:
91
91
  end
92
92
 
93
93
  end
94
+
95
+
96
+ # The TemplateError exception is raised when the compilation of the template fails. This exception then gathers a
97
+ # bunch of intimate details and uses it to report a very precise exception message.
98
+ # Extend source_extract to be able to pull from MasterView if exists and fallback to file system
99
+ class TemplateError < ActionViewError #:nodoc:
100
+
101
+ def source_extract(indention = 0) #:nodoc:
102
+
103
+ #added/modified the following three lines to support reading from MasterView with fallback to file system
104
+ relative_path = (@file_name.starts_with?(@base_path)) ? @file_name[@base_path.length+1..-1] : @file_name
105
+ short_path_mio = (relative_path && !relative_path.empty?) ? MasterView::IOMgr.erb.path(relative_path) : nil
106
+ source_code = (short_path_mio && short_path_mio.exist?) ? StringIO.new(short_path_mio.read).readlines : IO.readlines(@file_name)
107
+
108
+ start_on_line = [ line_number - SOURCE_CODE_RADIUS - 1, 0 ].max
109
+ end_on_line = [ line_number + SOURCE_CODE_RADIUS - 1, source_code.length].min
110
+
111
+ line_counter = start_on_line
112
+ extract = source_code[start_on_line..end_on_line].collect do |line|
113
+ line_counter += 1
114
+ "#{' ' * indention}#{line_counter}: " + line
115
+ end
116
+
117
+ extract.join
118
+ end
119
+ end
120
+
94
121
  end
95
122
 
96
123
 
97
124
 
125
+
98
126
  module ActionController #:nodoc:
99
127
  module Layout #:nodoc:
100
128
  module ClassMethods
@@ -2,7 +2,7 @@ module MasterView
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: masterview
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.1
7
- date: 2006-06-28 00:00:00 -05:00
6
+ version: 0.2.2
7
+ date: 2006-06-30 00:00:00 -05:00
8
8
  summary: A (x)html friendly template engine for rails with the power of layouts, and partials.
9
9
  require_paths:
10
10
  - lib
@@ -103,13 +103,27 @@ files:
103
103
  - doc/stylesheets
104
104
  - doc/directives.html
105
105
  - doc/guide.html
106
- - doc/api
106
+ - doc/screenshots
107
107
  - doc/installation.html
108
108
  - doc/configuration.html
109
109
  - doc/index.html
110
110
  - doc/troubleshooting.html
111
111
  - doc/media_list.html
112
+ - doc/images
112
113
  - doc/simple_diagram.html
114
+ - doc/images/masterview_rhtml_rendering_thumbnail_smaller.png
115
+ - doc/images/masterview_rhtml_rendering_thumbnail.png
116
+ - doc/images/masterview_logo.png
117
+ - doc/images/masterview_logo_gradient.png
118
+ - doc/screenshots/generated_list.png
119
+ - doc/screenshots/generated_new.png
120
+ - doc/screenshots/masterview_admin.png
121
+ - doc/screenshots/generated_new_medium.png
122
+ - doc/screenshots/masterview_admin_medium.png
123
+ - doc/screenshots/generated_list_medium.png
124
+ - doc/screenshots/generated_list_thumbnail.png
125
+ - doc/screenshots/masterview_admin_thumbnail.png
126
+ - doc/screenshots/generated_new_thumbnail.png
113
127
  - doc/stylesheets/mv-directives.css
114
128
  - doc/stylesheets/mv-installation.css
115
129
  - doc/stylesheets/mv-config.css