mirah 0.0.7-java → 0.0.8-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. data/History.txt +181 -0
  2. data/README.txt +6 -10
  3. data/Rakefile +86 -9
  4. data/bin/mirah +2 -0
  5. data/bin/mirahc +2 -0
  6. data/bin/mirahp +2 -0
  7. data/{bin/dubyp → examples/interfaces.mirah} +16 -9
  8. data/examples/macros/square.mirah +12 -0
  9. data/examples/macros/square_int.mirah +12 -0
  10. data/examples/macros/string-each-char.mirah +14 -0
  11. data/examples/maven/README.txt +2 -0
  12. data/examples/maven/pom.xml +23 -0
  13. data/examples/maven/src/main/mirah/hello_mirah.mirah +9 -0
  14. data/examples/rosettacode/100-doors.mirah +44 -0
  15. data/examples/rosettacode/99-bottles-of-beer.mirah +13 -0
  16. data/examples/rosettacode/README.txt +9 -0
  17. data/examples/rosettacode/boolean-values.mirah +29 -0
  18. data/examples/rosettacode/comments.mirah +2 -0
  19. data/examples/rosettacode/copy-a-string.mirah +10 -0
  20. data/examples/rosettacode/count-occurrences-of-a-substring.mirah +40 -0
  21. data/examples/rosettacode/create-a-file.mirah +6 -0
  22. data/examples/rosettacode/empty-string.mirah +9 -0
  23. data/examples/rosettacode/factorial.mirah +10 -0
  24. data/examples/rosettacode/fibonacci.mirah +21 -0
  25. data/examples/rosettacode/file-size.mirah +5 -0
  26. data/examples/rosettacode/fizz-buzz.mirah +21 -0
  27. data/examples/rosettacode/flatten-a-list.mirah +24 -0
  28. data/examples/rosettacode/guess-the-number.mirah +21 -0
  29. data/examples/rosettacode/is-string-numeric.mirah +127 -0
  30. data/examples/rosettacode/palindrome.mirah +14 -0
  31. data/examples/rosettacode/repeat-a-string.mirah +9 -0
  32. data/examples/rosettacode/reverse-a-string.mirah +6 -0
  33. data/examples/rosettacode/rot-13.mirah +20 -0
  34. data/examples/rosettacode/user-input.mirah +4 -0
  35. data/examples/sort_closure.mirah +1 -1
  36. data/javalib/dynalink-0.2.jar +0 -0
  37. data/javalib/mirah-bootstrap.jar +0 -0
  38. data/lib/mirah.rb +7 -16
  39. data/lib/mirah/ast.rb +22 -92
  40. data/lib/mirah/ast/call.rb +41 -9
  41. data/lib/mirah/ast/class.rb +34 -6
  42. data/lib/mirah/ast/flow.rb +17 -5
  43. data/lib/mirah/ast/intrinsics.rb +50 -8
  44. data/lib/mirah/ast/literal.rb +7 -0
  45. data/lib/mirah/ast/local.rb +9 -1
  46. data/lib/mirah/ast/method.rb +21 -8
  47. data/lib/mirah/ast/scope.rb +1 -1
  48. data/lib/mirah/ast/structure.rb +81 -15
  49. data/lib/mirah/ast/type.rb +4 -0
  50. data/{bin/dubyc → lib/mirah/commands.rb} +4 -11
  51. data/lib/mirah/commands/base.rb +54 -0
  52. data/lib/mirah/commands/compile.rb +39 -0
  53. data/{examples/wiki/Rakefile → lib/mirah/commands/parse.rb} +18 -17
  54. data/lib/mirah/commands/run.rb +73 -0
  55. data/lib/mirah/compiler.rb +37 -417
  56. data/lib/mirah/compiler/call.rb +45 -0
  57. data/lib/mirah/compiler/class.rb +81 -0
  58. data/lib/mirah/compiler/flow.rb +109 -0
  59. data/lib/mirah/compiler/literal.rb +130 -0
  60. data/lib/mirah/compiler/local.rb +59 -0
  61. data/lib/mirah/compiler/method.rb +44 -0
  62. data/lib/mirah/compiler/structure.rb +65 -0
  63. data/lib/mirah/compiler/type.rb +27 -0
  64. data/lib/mirah/env.rb +4 -6
  65. data/lib/mirah/generator.rb +61 -0
  66. data/lib/mirah/jvm/compiler.rb +8 -867
  67. data/lib/mirah/jvm/compiler/base.rb +270 -0
  68. data/lib/mirah/jvm/compiler/java_source.rb +779 -0
  69. data/lib/mirah/jvm/compiler/jvm_bytecode.rb +851 -0
  70. data/lib/mirah/jvm/method_lookup.rb +21 -2
  71. data/lib/mirah/jvm/source_generator/builder.rb +10 -13
  72. data/lib/mirah/jvm/source_generator/loops.rb +99 -93
  73. data/lib/mirah/jvm/source_generator/precompile.rb +3 -2
  74. data/lib/mirah/jvm/typer.rb +3 -3
  75. data/lib/mirah/jvm/types.rb +10 -426
  76. data/lib/mirah/jvm/types/array_type.rb +62 -0
  77. data/lib/mirah/jvm/types/basic_types.rb +1 -0
  78. data/lib/mirah/jvm/types/dynamic_type.rb +46 -0
  79. data/lib/mirah/jvm/types/factory.rb +23 -5
  80. data/lib/mirah/jvm/types/interface_definition.rb +20 -0
  81. data/lib/mirah/jvm/types/intrinsics.rb +15 -3
  82. data/lib/mirah/jvm/types/meta_type.rb +45 -0
  83. data/lib/mirah/jvm/types/methods.rb +12 -5
  84. data/lib/mirah/jvm/types/null_type.rb +27 -0
  85. data/lib/mirah/jvm/types/primitive_type.rb +38 -0
  86. data/lib/mirah/jvm/types/source_mirror.rb +266 -0
  87. data/lib/mirah/jvm/types/type.rb +173 -0
  88. data/lib/mirah/jvm/types/type_definition.rb +55 -0
  89. data/lib/mirah/jvm/types/unreachable_type.rb +27 -0
  90. data/lib/mirah/jvm/types/void_type.rb +19 -0
  91. data/lib/mirah/parser.rb +90 -0
  92. data/lib/mirah/plugin/gwt.rb +5 -5
  93. data/lib/mirah/plugin/java.rb +1 -1
  94. data/lib/mirah/transform.rb +4 -321
  95. data/lib/mirah/transform/ast_ext.rb +63 -0
  96. data/lib/mirah/transform/error.rb +13 -0
  97. data/lib/mirah/transform/helper.rb +761 -0
  98. data/lib/mirah/transform/transformer.rb +255 -0
  99. data/lib/mirah/typer.rb +2 -383
  100. data/{bin/duby → lib/mirah/typer/base.rb} +12 -10
  101. data/lib/mirah/typer/simple.rb +377 -0
  102. data/lib/mirah/util/argument_processor.rb +114 -0
  103. data/lib/mirah/util/class_loader.rb +37 -0
  104. data/lib/mirah/util/compilation_state.rb +51 -0
  105. data/lib/mirah/util/process_errors.rb +33 -0
  106. data/lib/mirah/version.rb +1 -1
  107. data/lib/mirah_task.rb +3 -2
  108. data/test/{test_ast.rb → core/test_ast.rb} +6 -0
  109. data/test/{test_compilation.rb → core/test_compilation.rb} +0 -0
  110. data/test/{test_env.rb → core/test_env.rb} +24 -25
  111. data/test/{test_macros.rb → core/test_macros.rb} +2 -4
  112. data/test/{test_typer.rb → core/test_typer.rb} +0 -3
  113. data/test/jvm/bytecode_test_helper.rb +181 -0
  114. data/test/{test_javac_compiler.rb → jvm/javac_test_helper.rb} +38 -22
  115. data/test/jvm/test_enumerable.rb +304 -0
  116. data/test/{test_java_typer.rb → jvm/test_java_typer.rb} +2 -4
  117. data/test/{test_jvm_compiler.rb → jvm/test_jvm_compiler.rb} +146 -443
  118. data/test/jvm/test_macros.rb +147 -0
  119. data/test/jvm/test_main_method.rb +15 -0
  120. data/test/{test_gwt.rb → plugins/test_gwt.rb} +0 -2
  121. metadata +103 -91
  122. data/bin/jrubyp +0 -52
  123. data/examples/wiki/src/org/mirah/wiki/MirahWiki.duby +0 -339
  124. data/examples/wiki/src/org/mirah/wiki/edit.eduby.html +0 -42
  125. data/examples/wiki/src/org/mirah/wiki/error.eduby.html +0 -2
  126. data/examples/wiki/src/org/mirah/wiki/layout.eduby.html +0 -69
  127. data/examples/wiki/src/org/mirah/wiki/parser.eduby.html +0 -7
  128. data/examples/wiki/src/org/mirah/wiki/view.eduby.html +0 -15
  129. data/examples/wiki/war/WEB-INF/classes/test/HeredocContext.class +0 -0
  130. data/examples/wiki/war/WEB-INF/classes/test/MirahParser.class +0 -0
  131. data/examples/wiki/war/WEB-INF/lib/appengine-api.jar +0 -0
  132. data/examples/wiki/war/WEB-INF/lib/dubydatastore.jar +0 -0
  133. data/examples/wiki/war/WEB-INF/lib/jmeta-runtime.jar +0 -0
  134. data/examples/wiki/war/WEB-INF/lib/pegdown-stubs.jar +0 -0
  135. data/examples/wiki/war/WEB-INF/pegdown.jar +0 -0
  136. data/examples/wiki/war/app.yaml +0 -21
  137. data/examples/wiki/war/public/favicon.ico +0 -0
  138. data/examples/wiki/war/public/images/appengine_duby.png +0 -0
  139. data/examples/wiki/war/public/images/back.gif +0 -0
  140. data/examples/wiki/war/public/images/dir.gif +0 -0
  141. data/examples/wiki/war/public/images/file.gif +0 -0
  142. data/examples/wiki/war/public/javascripts/prettify.js +0 -61
  143. data/examples/wiki/war/public/robots.txt +0 -0
  144. data/examples/wiki/war/public/stylesheets/main.css +0 -156
  145. data/examples/wiki/war/public/stylesheets/prettify.css +0 -1
  146. data/examples/wiki/war/public/stylesheets/sh_style.css +0 -66
  147. data/examples/wiki/war/public/stylesheets/source.css +0 -21
  148. data/examples/wiki/war/public/wmd/images/bg-fill.png +0 -0
  149. data/examples/wiki/war/public/wmd/images/bg.png +0 -0
  150. data/examples/wiki/war/public/wmd/images/blockquote.png +0 -0
  151. data/examples/wiki/war/public/wmd/images/bold.png +0 -0
  152. data/examples/wiki/war/public/wmd/images/code.png +0 -0
  153. data/examples/wiki/war/public/wmd/images/h1.png +0 -0
  154. data/examples/wiki/war/public/wmd/images/hr.png +0 -0
  155. data/examples/wiki/war/public/wmd/images/img.png +0 -0
  156. data/examples/wiki/war/public/wmd/images/italic.png +0 -0
  157. data/examples/wiki/war/public/wmd/images/link.png +0 -0
  158. data/examples/wiki/war/public/wmd/images/ol.png +0 -0
  159. data/examples/wiki/war/public/wmd/images/redo.png +0 -0
  160. data/examples/wiki/war/public/wmd/images/separator.png +0 -0
  161. data/examples/wiki/war/public/wmd/images/ul.png +0 -0
  162. data/examples/wiki/war/public/wmd/images/undo.png +0 -0
  163. data/examples/wiki/war/public/wmd/images/wmd-on.png +0 -0
  164. data/examples/wiki/war/public/wmd/images/wmd.png +0 -0
  165. data/examples/wiki/war/public/wmd/showdown.js +0 -421
  166. data/examples/wiki/war/public/wmd/wmd-base.js +0 -1799
  167. data/examples/wiki/war/public/wmd/wmd-plus.js +0 -311
  168. data/examples/wiki/war/public/wmd/wmd.js +0 -73
  169. data/examples/wiki/war/src/org/mirah/wiki/MirahWiki.duby +0 -339
  170. data/examples/wiki/war/src/org/mirah/wiki/edit.eduby.html +0 -42
  171. data/examples/wiki/war/src/org/mirah/wiki/error.eduby.html +0 -2
  172. data/examples/wiki/war/src/org/mirah/wiki/layout.eduby.html +0 -69
  173. data/examples/wiki/war/src/org/mirah/wiki/parser.eduby.html +0 -7
  174. data/examples/wiki/war/src/org/mirah/wiki/view.eduby.html +0 -15
  175. data/javalib/dynalink-0.1.jar +0 -0
  176. data/javalib/jsr292-mock.jar +0 -0
  177. data/lib/mirah/class_loader.rb +0 -35
  178. data/lib/mirah/compilation_state.rb +0 -28
  179. data/lib/mirah/impl.rb +0 -273
  180. data/lib/mirah/jvm/base.rb +0 -267
  181. data/lib/mirah/jvm/source_compiler.rb +0 -760
  182. data/lib/mirah/transform2.rb +0 -752
data/bin/jrubyp DELETED
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env jruby
2
-
3
- # Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
4
- # All contributing project authors may be found in the NOTICE file.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
- $: << File.dirname(File.dirname(__FILE__)) + '/lib'
19
- require 'mirah'
20
-
21
- module Java::OrgJrubyparserAst
22
- class Node
23
- def pp(indent = 0)
24
- return if self.invisible?
25
- name = ""
26
- name = ":#{self.name}" if respond_to? :getName
27
- name += " #{value.inspect}" if respond_to? :getValue
28
- name += " (#{depth})" if respond_to? :getDepth
29
- print "#{' '*indent}(#{node_name}#{name}"
30
- if child_nodes.size == 0
31
- puts ')'
32
- else
33
- puts
34
- indent += 2
35
- child_nodes.each {|n| n.pp(indent)}
36
- puts "#{' '*indent})"
37
- end
38
- end
39
- end
40
- end
41
-
42
- filename = ARGV.shift
43
- case filename
44
- when '-e'
45
- contents = ARGV.join(' ')
46
- when '-', nil
47
- contents = $stdin.read
48
- else
49
- contents = IO.read(filename)
50
- end
51
-
52
- puts Duby::AST.parse_ruby(contents, filename).pp
@@ -1,339 +0,0 @@
1
- # Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
2
- # All contributing project authors may be found in the NOTICE file.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import javax.servlet.http.HttpServlet
17
- import javax.servlet.http.HttpServletRequest
18
- import javax.servlet.Filter
19
- import com.google.appengine.ext.duby.db.Model
20
- import com.google.appengine.api.datastore.Text
21
- import java.util.Date
22
- import org.pegdown.PegDownProcessorStub
23
- import com.google.appengine.api.users.UserServiceFactory
24
- import com.google.appengine.api.users.User
25
- import java.util.ArrayList
26
- import java.util.List
27
-
28
- class Page < Model
29
- property 'title', String
30
- property 'body', Text
31
- property 'userid', String
32
- property 'user', User
33
- property 'nickname', String
34
- property 'comment', String
35
- property 'created', Date
36
- property 'version', Long
37
- property 'locked', Boolean
38
- end
39
-
40
- class Helper < HttpServlet
41
- def markdown(text:String)
42
- return "" unless text
43
- flags = 0x5ff
44
- if @allow_html
45
- flags |= 0x200 unless @allow_html
46
- @html_markdown ||= PegDownProcessorStub.new(flags)
47
- @html_markdown.markdownToHtml(text)
48
- else
49
- @nohtml_markdown ||= PegDownProcessorStub.new(flags)
50
- @nohtml_markdown.markdownToHtml(text)
51
- end
52
- end
53
-
54
- def html=(enabled:boolean)
55
- @allow_html = enabled
56
- end
57
-
58
- def page_name(name:String)
59
- if name.nil?
60
- return "Main"
61
- else
62
- name = name.replaceAll("\\W", "")
63
- end
64
- if name.equals("")
65
- "Main"
66
- else
67
- name
68
- end
69
- end
70
-
71
- def h(text:String)
72
- return "" unless text
73
- text = text.replace("&", "&amp;")
74
- text = text.replace("<", "&lt;")
75
- text = text.replace(">", "&gt;")
76
- text = text.replace("\"", "&quot;")
77
- text.replace("'", "&#39;")
78
- end
79
-
80
- def h(o:Object)
81
- h(o.toString)
82
- end
83
-
84
- def_edb(layout, 'org/mirah/wiki/layout.eduby.html')
85
-
86
- def with_layout(content:String)
87
- @content = content
88
- layout
89
- end
90
-
91
- def title
92
- @title
93
- end
94
-
95
- def title=(title:String)
96
- @title = title
97
- end
98
-
99
- def users
100
- @users ||= UserServiceFactory.getUserService()
101
- end
102
-
103
- macro def admin?
104
- quote { users.isUserAdmin }
105
- end
106
-
107
- def user
108
- users.getCurrentUser
109
- end
110
-
111
- def nickname
112
- user.getNickname.replaceAll('@.*', '')
113
- end
114
-
115
- def extra_links
116
- @links ||= ArrayList.new
117
- end
118
-
119
- def url
120
- '/'
121
- end
122
- end
123
-
124
- class ViewPage < Helper
125
- def_edb(view, 'org/mirah/wiki/view.eduby.html')
126
-
127
- def doGet(request, response)
128
- @url = request.getRequestURI
129
- self.title = @name = page_name(request.getPathInfo)
130
- canonical = "/" + @name
131
- unless canonical.equals(request.getPathInfo)
132
- response.sendRedirect(canonical)
133
- return
134
- end
135
-
136
- @page = Page.get(@name)
137
- self.html = @page.locked if @page
138
- response.getWriter.write(with_layout(view))
139
- end
140
-
141
- def url
142
- @url
143
- end
144
-
145
- def extra_links
146
- links = ArrayList.new
147
- if @page
148
- can_edit = admin?
149
- can_edit = true unless @page.locked
150
- if can_edit
151
- links.add(["Edit", "/edit/#{@page.title}"])
152
- end
153
- end
154
- links.add(["New Page", "javascript:void(newPage())"])
155
- links
156
- end
157
- end
158
-
159
- import java.util.logging.Logger
160
-
161
- class EditPage < Helper
162
- def_edb(edit, 'org/mirah/wiki/edit.eduby.html')
163
- def_edb(error, 'org/mirah/wiki/error.eduby.html')
164
-
165
- def logger
166
- @logger ||= Logger.getLogger("EditPage")
167
- end
168
-
169
- def render(content:String)
170
- @response.setContentType("text/html; charset=utf-8")
171
- @response.getWriter.write(with_layout(content))
172
- end
173
-
174
- def url
175
- @url
176
- end
177
-
178
- def doGet(request, response)
179
- @url = request.getRequestURI
180
- @response = response
181
- @error = String(nil)
182
- @name = page_name(request.getPathInfo)
183
- @page = Page.get(@name)
184
- if @page && @page.locked
185
- unless admin?
186
- @error = "You are not authorized to edit this page"
187
- response.setStatus(403)
188
- render(error)
189
- return
190
- end
191
- end
192
- render(edit)
193
- end
194
-
195
- def doPost(_request, _response)
196
- @error = nil
197
- @response = _response
198
- @url = _request.getRequestURI
199
-
200
- # TODO scope inside blocks is not quite right
201
- this = self
202
- request = _request
203
- response = _response
204
- is_admin = admin?
205
-
206
- name = page_name(request.getPathInfo)
207
-
208
- begin
209
- edit_version = Long.parseLong(String(request.getParameter("version")))
210
- rescue NumberFormatException
211
- response.sendError(
212
- 400, "Invalid version '#{request.getParameter("version")}'")
213
- return
214
- end
215
-
216
- Model.transaction do
217
- orig_page = Page.get(name)
218
- current_version = orig_page ? orig_page.version : long(0)
219
- if current_version != edit_version
220
- @error = <<EOS
221
- Version conflict. You are trying to edit version #{edit_version}, but
222
- the current version is #{current_version}.
223
- EOS
224
- @page = orig_page
225
- @name = name
226
- response.setStatus(409)
227
- this.render(this.edit)
228
- return
229
- end
230
- if orig_page && orig_page.locked
231
- unless is_admin
232
- @error = "You are not authorized to edit this page"
233
- response.setStatus(403)
234
- this.render(this.error)
235
- return
236
- end
237
- end
238
-
239
- this.save_old_version(orig_page) if orig_page
240
-
241
- if orig_page
242
- page = orig_page
243
- page.version = page.version + 1
244
- else
245
- page = Page.new(name)
246
- page.title = name
247
- page.version = 1
248
- end
249
-
250
- locked = is_admin && "locked".equals(request.getParameter("locked"))
251
- page.body = String(request.getParameter("body"))
252
- page.nickname = String(request.getParameter("nickname"))
253
- page.comment = String(request.getParameter("comment"))
254
- page.user = this.user
255
- page.userid = this.user.getUserId
256
- page.created = Date.new
257
- page.locked = locked
258
- page.save
259
- response.sendRedirect("/wiki/" + name)
260
- end
261
- end
262
-
263
- def save_old_version(orig_page:Page)
264
- old_version = Page.new(orig_page)
265
- old_version.title = orig_page.title
266
- old_version.body = orig_page.body
267
- old_version.userid = orig_page.userid
268
- old_version.user = orig_page.user
269
- old_version.nickname = orig_page.nickname
270
- old_version.comment = orig_page.comment
271
- old_version.created = orig_page.created
272
- old_version.version = orig_page.version
273
- old_version.locked = orig_page.locked
274
- old_version.save
275
- end
276
- end
277
-
278
- import test.MirahParser
279
- import jmeta.BaseParser
280
- class MirahParserPage < Helper
281
- def_edb(render, 'org/mirah/wiki/parser.eduby.html')
282
-
283
- def initialize
284
- self.title = "Mirah Parser Test"
285
- end
286
-
287
- def doGet(request, response)
288
- doPost(request, response)
289
- end
290
-
291
- def doPost(request, response)
292
- @code = String(request.getParameter("code")) || "puts 'Hello, world!'"
293
- parser = MirahParser.new
294
- begin
295
- @parsed = BaseParser.print_r(parser.parse(@code))
296
- rescue => ex
297
- @parsed = ex.getMessage
298
- end
299
- response.getWriter.write(with_layout(render))
300
- end
301
- end
302
-
303
- class FederatedLogin < Helper
304
- def doGet(request, response)
305
- provider = request.getPathInfo
306
- if provider && provider.length > 1
307
- provider = provider.substring(1)
308
- else
309
- provider = 'www.google.com/accounts/o8/id'
310
- end
311
- continue = String(request.getParameter('continue')) || '/'
312
- url = users.createLoginURL(continue, nil, provider, nil)
313
- response.sendRedirect(url)
314
- end
315
- end
316
-
317
- class LoginRequired < Helper
318
- def doGet(request, response)
319
- # This should be a page allowing people to select an OpenID provider.
320
- # But I'm lazy so I'll just force them to use gmail...
321
- continue = String(request.getParameter('continue'))
322
- url = users.createLoginURL(continue, nil, 'www.google.com/accounts/o8/id', nil)
323
- response.sendRedirect(url)
324
- end
325
- end
326
-
327
- class MainFilter; implements Filter
328
- def init(arg); end
329
- def destroy; end
330
- def doFilter(request, response, filters)
331
- if "/".equals(HttpServletRequest(request).getRequestURI)
332
- request.getRequestDispatcher('/wiki/Main').forward(request, response)
333
- nil
334
- else
335
- filters.doFilter(request, response)
336
- nil
337
- end
338
- end
339
- end
@@ -1,42 +0,0 @@
1
- <div>
2
- <% if @error %>
3
- <div id=error><%=h @error %></div>
4
- <% end %>
5
- <div>
6
- <form method=post>
7
- <textarea id=body name=body style="width:95%;font-family:monospace" rows=5
8
- ><% if @page && @page.body %><%=h @page.body %><% end
9
- %></textarea><br>
10
- Your Name: <input name=nickname value="<%=h nickname %>"><br>
11
- Comment: <input name=comment value=<% if @page %>
12
- "Edited Page"
13
- <% else %>
14
- "Created Page"
15
- <% end %>><br>
16
- <input type=hidden name=version value="<%= @page ? @page.version : long(0) %>">
17
- <% if admin? %>
18
- Locked: <input name=locked value=locked type=checkbox <%= "checked" if @page && @page.locked%>><br>
19
- <% end %>
20
- <input type=submit name=Save>
21
- </form>
22
- </div>
23
- <hr style="clear:all">
24
- <div id=preview class="wmd-preview"></div>
25
- <script>
26
- (function(){
27
- var ta = document.getElementById("body");
28
- var sh = 0;
29
- function resize() {
30
- var nsh = ta.scrollHeight;
31
- if (nsh != sh) {
32
- ta.style.height = 0;
33
- ta.style.height = (nsh + 100) + "px";
34
- sh = ta.scrollHeight;
35
- }
36
- setTimeout(resize, 250);
37
- }
38
- resize();
39
- })();
40
- wmd_options={output:"markdown"};
41
- </script>
42
- <script type="text/javascript" src="/wmd/wmd.js""></script>
@@ -1,2 +0,0 @@
1
- <h1>error:</h1>
2
- <p><%=h @error %></p>
@@ -1,69 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5
- <title><%=h @title %></title>
6
- <link type="text/css" rel="stylesheet" href="/stylesheets/main.css">
7
- <link href="/stylesheets/prettify.css" type="text/css" rel="stylesheet" />
8
- <script type="text/javascript" src="/javascripts/prettify.js"></script>
9
- </head>
10
- <body onload="prettyPrint()">
11
- <div id="page">
12
- <div id="sidebar">
13
-
14
- <h1>Mirah</h1>
15
-
16
- <ul id="sidebar-items">
17
-
18
- <li>
19
- <h3>Join the community</h3>
20
- <ul class="links">
21
- <li><a href="/">Home Page</a></li>
22
- <li><a href="http://github.com/mirah/mirah">github</a></li>
23
- <li><a href="/wiki/Resources">Resources</a></li>
24
- <li><a href="/wiki/MirahHowto">Howto</a></li>
25
- <li><a
26
- href="http://groups.google.com/group/mirah/"
27
- target="_new">Send Feedback</a></li>
28
- </ul>
29
- </li>
30
-
31
- <li>
32
- <h3>Sample Apps</h3>
33
- <ul class="links">
34
- <li><a href="http://github.com/mirah/mirah/tree/master/examples/appengine/">Guestbook</a> |
35
- <a href="http://github.com/jacortinas/appengine-rails-jquery-demo">Mustache</a></li>
36
- </ul>
37
- <a href="/wiki/MirahSamples">Sample Code</a>
38
- </li>
39
-
40
- <li>
41
- <h3>Mirah Videos</h3>
42
- <ul class="links">
43
- <li><a href="http://www.youtube.com/watch?v=08rNKxW0PPo">ribrdb</a> |
44
- <a href="http://confreaks.net/videos/196-rubyconf2009-ruby-mutants">headius</a></li>
45
- </ul>
46
- </li>
47
-
48
- </div>
49
-
50
- <div id="content">
51
- <div id=hlinks>
52
- <% if user %>
53
- <%=h user.getEmail %>&nbsp;|&nbsp;
54
- <% extra_links.each do |_pair|;pair = List(_pair) %>
55
- <a href="<%=h pair.get(1)%>"><%=h pair.get(0)%></a>&nbsp;|&nbsp;
56
- <% end %>
57
- <a href="<%=h users.createLogoutURL('/')%>">Sign Out</a>
58
- <% else %>
59
- <a href="<%=users.createLoginURL(url)%>">Sign In</a>
60
- <% end %>
61
- </div>
62
- <div id=wikicontent>
63
- <%= @content %>
64
- </div>
65
- </div>
66
- </div>
67
- </body>
68
- </html>
69
-