dubious 0.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +202 -0
- data/README.rdoc +160 -0
- data/ROADMAP.rdoc +28 -0
- data/Rakefile +130 -0
- data/bin/dubious +4 -0
- data/examples/contacts/Rakefile +169 -0
- data/examples/contacts/WEB-INF/app.yaml +9 -0
- data/examples/contacts/WEB-INF/appengine-web.xml +14 -0
- data/examples/contacts/WEB-INF/classes/controllers/ApplicationController.class +0 -0
- data/examples/contacts/WEB-INF/classes/controllers/ContactsController.class +0 -0
- data/examples/contacts/WEB-INF/classes/controllers/InfoPropertiesController.class +0 -0
- data/examples/contacts/WEB-INF/classes/controllers/SourceController.class +0 -0
- data/examples/contacts/WEB-INF/classes/models/Contact$Query.class +0 -0
- data/examples/contacts/WEB-INF/classes/models/Contact.class +0 -0
- data/examples/contacts/WEB-INF/lib/appengine-api.jar +0 -0
- data/examples/contacts/WEB-INF/lib/dubious.jar +0 -0
- data/examples/contacts/WEB-INF/lib/dubydatastore.jar +0 -0
- data/examples/contacts/WEB-INF/web.xml +3 -0
- data/examples/contacts/app.yaml +44 -0
- data/examples/contacts/app/controllers/application_controller.mirah +5 -0
- data/examples/contacts/app/controllers/contacts_controller.mirah +62 -0
- data/examples/contacts/app/controllers/info_properties_controller.mirah +55 -0
- data/examples/contacts/app/controllers/source_controller.mirah +30 -0
- data/examples/contacts/app/models/contact.mirah +28 -0
- data/examples/contacts/app/views/contacts/edit.html.erb +50 -0
- data/examples/contacts/app/views/contacts/index.html.erb +38 -0
- data/examples/contacts/app/views/contacts/new.html.erb +49 -0
- data/examples/contacts/app/views/contacts/show.html.erb +47 -0
- data/examples/contacts/app/views/layouts/application.html.erb +10 -0
- data/examples/contacts/app/views/layouts/contacts.html.erb +20 -0
- data/examples/contacts/app/views/source/list.html.erb +27 -0
- data/examples/contacts/app/views/source/show.html.erb +15 -0
- data/examples/contacts/config/application.properties +4 -0
- data/examples/contacts/config/asset.properties +32 -0
- data/examples/contacts/config/build.properties +10 -0
- data/examples/contacts/config/routes.properties +1 -0
- data/examples/contacts/public/404.html +30 -0
- data/examples/contacts/public/422.html +30 -0
- data/examples/contacts/public/500.html +30 -0
- data/examples/contacts/public/favicon.ico +0 -0
- data/examples/contacts/public/images/appengine_duby.png +0 -0
- data/examples/contacts/public/images/back.gif +0 -0
- data/examples/contacts/public/images/dir.gif +0 -0
- data/examples/contacts/public/images/dubious.png +0 -0
- data/examples/contacts/public/images/file.gif +0 -0
- data/examples/contacts/public/images/silver-120x30.gif +0 -0
- data/examples/contacts/public/index.html +144 -0
- data/examples/contacts/public/javascripts/effects.js +1128 -0
- data/examples/contacts/public/javascripts/jquery.rails.min.js +117 -0
- data/examples/contacts/public/javascripts/lang/sh_css.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_duby.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_erb.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_html.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_java.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_js.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_mirah.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_properties.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_rb.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_sh.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_xml.min.js +1 -0
- data/examples/contacts/public/javascripts/lang/sh_yaml.min.js +1 -0
- data/examples/contacts/public/javascripts/prototype.js +4320 -0
- data/examples/contacts/public/javascripts/sh_main.min.js +4 -0
- data/examples/contacts/public/robots.txt +0 -0
- data/examples/contacts/public/stylesheets/main.css +188 -0
- data/examples/contacts/public/stylesheets/scaffold.css +57 -0
- data/examples/contacts/public/stylesheets/sh_style.css +66 -0
- data/examples/contacts/public/stylesheets/source.css +27 -0
- data/examples/shout/Rakefile +138 -0
- data/examples/shout/WEB-INF/appengine-web.xml +14 -0
- data/examples/shout/WEB-INF/web.xml +11 -0
- data/examples/shout/app.mirah +35 -0
- data/examples/shout/app.yaml +11 -0
- data/examples/shout/public/404.html +30 -0
- data/examples/shout/public/422.html +30 -0
- data/examples/shout/public/500.html +30 -0
- data/examples/shout/public/favicon.ico +0 -0
- data/examples/shout/public/images/appengine_duby.png +0 -0
- data/examples/shout/public/images/back.gif +0 -0
- data/examples/shout/public/images/dir.gif +0 -0
- data/examples/shout/public/images/file.gif +0 -0
- data/examples/shout/public/images/silver-120x30.gif +0 -0
- data/examples/shout/public/index.html +116 -0
- data/examples/shout/public/javascripts/effects.js +1128 -0
- data/examples/shout/public/javascripts/jquery.rails.min.js +117 -0
- data/examples/shout/public/javascripts/prototype.js +4320 -0
- data/examples/shout/public/robots.txt +0 -0
- data/examples/shout/public/stylesheets/main.css +185 -0
- data/examples/shout/public/stylesheets/scaffold.css +57 -0
- data/examples/shout/views/application.html.erb +10 -0
- data/examples/shout/views/list.html.erb +14 -0
- data/javalib/dubydatastore.jar +0 -0
- data/lib/dubious.jar +0 -0
- data/lib/dubious.rb +2 -0
- data/lib/dubious/cli.rb +65 -0
- data/lib/dubious/templates/base/Rakefile +169 -0
- data/lib/dubious/templates/base/WEB-INF/app.yaml.tt +9 -0
- data/lib/dubious/templates/base/app/controllers/application_controller.mirah +5 -0
- data/lib/dubious/templates/base/config/application.properties.tt +6 -0
- data/lib/dubious/templates/base/config/asset.properties +0 -0
- data/lib/dubious/templates/base/config/build.properties +0 -0
- data/lib/dubious/templates/base/config/routes.properties +1 -0
- data/lib/dubious/templates/base/public/404.html +30 -0
- data/lib/dubious/templates/base/public/422.html +30 -0
- data/lib/dubious/templates/base/public/500.html +30 -0
- data/lib/dubious/templates/base/public/favicon.ico +0 -0
- data/lib/dubious/templates/base/public/images/appengine_duby.png +0 -0
- data/lib/dubious/templates/base/public/images/back.gif +0 -0
- data/lib/dubious/templates/base/public/images/dir.gif +0 -0
- data/lib/dubious/templates/base/public/images/dubious.png +0 -0
- data/lib/dubious/templates/base/public/images/file.gif +0 -0
- data/lib/dubious/templates/base/public/images/silver-120x30.gif +0 -0
- data/lib/dubious/templates/base/public/index.html +144 -0
- data/lib/dubious/templates/base/public/javascripts/jquery.rails.min.js +117 -0
- data/lib/dubious/templates/base/public/robots.txt +0 -0
- data/lib/dubious/templates/base/public/stylesheets/main.css +188 -0
- data/lib/dubious/templates/base/public/stylesheets/scaffold.css +57 -0
- data/lib/dubious/templates/generator/controller.mirah.tt +5 -0
- data/lib/dubious/templates/generator/model.mirah.tt +6 -0
- metadata +224 -0
data/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/README.rdoc
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
=Dubious for App Engine
|
2
|
+
|
3
|
+
See the published demo: http://dubious-demo.appspot.com
|
4
|
+
|
5
|
+
===Introducing Dubious
|
6
|
+
This is a web framework written in Mirah geared towards running on App Engine.
|
7
|
+
Dubious provide a way to build apps in Mirah, with conventions familiar to
|
8
|
+
Rails developers.
|
9
|
+
Mirah has no runtime dependencies, everything is compiled ahead-of-time.
|
10
|
+
So, Mirah apps have none of the initialization costs associated with JRuby.
|
11
|
+
Dubious supports ERb and uses a simple datastore adapter that uses a syntax
|
12
|
+
similar to DataMapper.
|
13
|
+
|
14
|
+
===Introducing Mirah
|
15
|
+
Mirah is a new language with Ruby-inspired syntax that compiles to JVM bytecode.
|
16
|
+
Mirah is statically typed, with local type inference, and a simple macro system.
|
17
|
+
The goal is to make Mirah as expressive as Ruby without introducing any runtime
|
18
|
+
library and while maintaining Java's level of performance. Just write code that
|
19
|
+
looks like Ruby, but reference the Java docs to find out what method calls to
|
20
|
+
make. Mirah uses the Java type system. Join the mirah mailing list to get
|
21
|
+
involved: http://groups.google.com/group/mirah
|
22
|
+
|
23
|
+
=== Getting Started
|
24
|
+
Since Dubious relies on features of Mirah and Bitescript that have not been
|
25
|
+
released yet, you need to clone the repositories and manually build and install
|
26
|
+
the gems for each of them.
|
27
|
+
|
28
|
+
#assuming you are in a workspace directory.
|
29
|
+
git clone http://github.com/headius/bitescript.git
|
30
|
+
git clone http://github.com/mirah/mirah.git
|
31
|
+
git clone http://github.com/mirah/dubious.git
|
32
|
+
|
33
|
+
#assuming your gem and rake commands are from jruby
|
34
|
+
cd bitescript
|
35
|
+
gem build bitescript.gemspec
|
36
|
+
gem install bitescript-*
|
37
|
+
cd ../mirah
|
38
|
+
git checkout 5e98ddab33ee4d581881f7822f8148704426af1a #checkout mirah before the new parser.
|
39
|
+
rake jar:bootstrap
|
40
|
+
gem build mirah.gemspec
|
41
|
+
gem install mirah-*
|
42
|
+
cd ../dubious
|
43
|
+
rake jar #compile the mirah src and put the jar in lib
|
44
|
+
gem build dubious.gemspec
|
45
|
+
gem install dubious-*
|
46
|
+
|
47
|
+
In the future, you will be able to simply install Dubious as a JRuby gem. That will look like the following:
|
48
|
+
|
49
|
+
If your gem command is the JRuby one, run
|
50
|
+
|
51
|
+
gem install dubious
|
52
|
+
|
53
|
+
* this currently only installs Dubious and not Mirah.
|
54
|
+
|
55
|
+
If not run
|
56
|
+
|
57
|
+
jruby -S gem install dubious
|
58
|
+
|
59
|
+
This will add a `dubious` command that you can create new apps, generate controllers and models etc with.
|
60
|
+
|
61
|
+
Once dubious is installed, you can generate an app skeleton.
|
62
|
+
|
63
|
+
dubious new my-app
|
64
|
+
cd my-app
|
65
|
+
|
66
|
+
===Directory Layout
|
67
|
+
|
68
|
+
The layout is based on Rails' with some Java WAR directories, and files geared towards deploying on AppEngine.
|
69
|
+
|
70
|
+
* WEB-INF/app.yaml
|
71
|
+
contains handlers for different routes. It's like a lightweight version of web.xml--I think it actually generates it
|
72
|
+
|
73
|
+
http://code.google.com/appengine/docs/python/config/appconfig.html#About_app_yaml
|
74
|
+
|
75
|
+
==Hacking on Dubious
|
76
|
+
===Setup the Mirah development environment
|
77
|
+
|
78
|
+
Fetch App Engine Java SDK and JRuby, then install them into /usr/local
|
79
|
+
|
80
|
+
//-included in the gem-* http://googleappengine.googlecode.com/files/appengine-java-sdk-1.3.7.zip
|
81
|
+
* http://jruby.org.s3.amazonaws.com/downloads/1.5.1/jruby-bin-1.5.1.tar.gz
|
82
|
+
|
83
|
+
Make sure the appengine tools are executable
|
84
|
+
|
85
|
+
sudo chmod a+x /usr/local/appengine-java-sdk-1.3.7/bin/*.sh
|
86
|
+
|
87
|
+
Now git clone bitescript, mirah and dubious to your drive
|
88
|
+
|
89
|
+
mkdir -p ~/mystuff; cd ~/mystuff
|
90
|
+
git clone http://github.com/headius/bitescript.git
|
91
|
+
git clone http://github.com/mirah/mirah.git
|
92
|
+
git clone http://github.com/mirah/dubious.git
|
93
|
+
|
94
|
+
Edit .bash_profile to find these tools
|
95
|
+
|
96
|
+
export JRUBY_HOME=/usr/local/jruby-1.5.1
|
97
|
+
export MIRAH_HOME=~/mystuff/mirah
|
98
|
+
export APPENGINE_JAVA_SDK=/usr/local/appengine-java-sdk-1.3.7
|
99
|
+
export PATH=$PATH:$JRUBY_HOME/bin:$MIRAH_HOME/bin:$APPENGINE_JAVA_SDK/bin
|
100
|
+
|
101
|
+
Verify tools are configured properly, and check to see
|
102
|
+
that script/build.sh has the correct path to the SDK.
|
103
|
+
|
104
|
+
which appcfg.sh
|
105
|
+
which dev_appserver.sh
|
106
|
+
which mirah
|
107
|
+
which jruby
|
108
|
+
|
109
|
+
After that you should install the appengine-sdk gem
|
110
|
+
|
111
|
+
jgem install appengine-sdk
|
112
|
+
|
113
|
+
To build the gem
|
114
|
+
|
115
|
+
jgem build dubious.gemspec
|
116
|
+
|
117
|
+
===Developing your App
|
118
|
+
|
119
|
+
Install the gem
|
120
|
+
|
121
|
+
jgem install dubious
|
122
|
+
|
123
|
+
Generate your app
|
124
|
+
|
125
|
+
dubious new my-app
|
126
|
+
cd my-app
|
127
|
+
|
128
|
+
There are two ways to develop the app. The first way is to run the build script each time you make a change. The new way is to use the Rakefile. If you are using jruby's rake, the task will watch for source file changes and update the running class files. Otherwise, you need to restart the server when you have changes.
|
129
|
+
|
130
|
+
=== Use the Original Scripts
|
131
|
+
|
132
|
+
Compile the Mirah files and populate the WEB-INF/lib dir
|
133
|
+
|
134
|
+
./script/build.sh
|
135
|
+
|
136
|
+
Run the app locally
|
137
|
+
|
138
|
+
./script/server.sh
|
139
|
+
|
140
|
+
Edit the app-id in app.yaml, then publish to appspot.com
|
141
|
+
|
142
|
+
./script/publish.sh
|
143
|
+
|
144
|
+
=== Use the New Rakefile
|
145
|
+
|
146
|
+
Populate the WEB-INF/lib dir
|
147
|
+
|
148
|
+
./script/environment.rb
|
149
|
+
|
150
|
+
Run the app locally
|
151
|
+
|
152
|
+
jruby -S rake server
|
153
|
+
|
154
|
+
Edit the app-id in app.yaml, then publish to appspot.com
|
155
|
+
|
156
|
+
jruby -S rake publish
|
157
|
+
|
158
|
+
===Apache License 2.0
|
159
|
+
|
160
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
data/ROADMAP.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
=Dubious Roadmap
|
2
|
+
|
3
|
+
We want developers to be able to merge Mirah code into existing Rails apps,
|
4
|
+
so we should try to follow Rails conventions whenever possible. We also want
|
5
|
+
developers to be able to create stand-alone Dubious apps. Here is the list
|
6
|
+
of features I see as most critical.
|
7
|
+
|
8
|
+
* Cookie-based sessions with support for flash[:notice]
|
9
|
+
* Create and Validate csrf tokens (some plumbing is in place)
|
10
|
+
* Packaging system (we could use gems that include jar files)
|
11
|
+
* Generators for scaffold (as well as controllers and models)
|
12
|
+
* Command to generate a new dubious app
|
13
|
+
* Strategy to generate/publish documentation
|
14
|
+
|
15
|
+
==Mirah Features
|
16
|
+
|
17
|
+
We also need some new features from Mirah and MirahModel
|
18
|
+
|
19
|
+
====MirahModel
|
20
|
+
* The coerce_date methods should accept/parse strings
|
21
|
+
* Validations starting with syntax for :required => true
|
22
|
+
* Integrated JSON support for: respons_to :json
|
23
|
+
|
24
|
+
====Mirah
|
25
|
+
* Fix issues with Hash Literals
|
26
|
+
* Ability to add new methods to Java classes
|
27
|
+
* Strategy to generate/publish documentation
|
28
|
+
* Better syntax for 'returns'
|
data/Rakefile
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'ant'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'This Rakefile requires JRuby. Please use jruby -S rake.'
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
MIRAH_HOME = ENV['MIRAH_HOME'] ? ENV['MIRAH_HOME'] : Gem.find_files('mirah').first.sub(/lib\/mirah.rb/,'')
|
11
|
+
|
12
|
+
if ENV['MIRAH_HOME'] && File.exist?(ENV['MIRAH_HOME'] +'/lib/mirah.rb')
|
13
|
+
$: << File.expand_path(ENV['MIRAH_HOME'] +'/lib')
|
14
|
+
end
|
15
|
+
|
16
|
+
if File.exist?('../bitescript/lib/bitescript.rb')
|
17
|
+
$: << File.expand_path('../bitescript/lib/')
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'mirah/appengine_tasks'
|
21
|
+
|
22
|
+
OUTDIR = File.expand_path 'build'
|
23
|
+
SRCDIR = File.expand_path 'src'
|
24
|
+
|
25
|
+
CLEAN.include(OUTDIR)
|
26
|
+
CLOBBER.include("lib/dubious.jar")
|
27
|
+
|
28
|
+
def class_files_for files
|
29
|
+
files.map do |f|
|
30
|
+
explode = f.split('/')[1..-1]
|
31
|
+
explode.last.gsub!(/(^[a-z]|_[a-z])/) {|m|m.sub('_','').upcase}
|
32
|
+
explode.last.sub! /\.(duby|java|mirah)$/, '.class'
|
33
|
+
OUTDIR + '/' + explode.join('/')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
#MODEL_JAR = "#{OUTDIR}/dubydatastore.jar"
|
38
|
+
LIB_MIRAH_SRC = Dir["src/**/*.duby"]
|
39
|
+
LIB_JAVA_SRC = Dir["src/**/*.java"]
|
40
|
+
|
41
|
+
LIB_SRC = LIB_MIRAH_SRC + LIB_JAVA_SRC
|
42
|
+
LIB_CLASSES = class_files_for LIB_SRC
|
43
|
+
STDLIB_CLASSES= LIB_CLASSES.select{|l|l.include? 'stdlib'}
|
44
|
+
|
45
|
+
Duby.dest_paths << OUTDIR
|
46
|
+
Duby.source_paths << SRCDIR
|
47
|
+
Duby.compiler_options << '--classpath' << [File.expand_path(OUTDIR), *FileList["lib/*.jar", "javalib/*.jar"].map{|f|File.expand_path(f)}].join(':')
|
48
|
+
|
49
|
+
|
50
|
+
file "#{OUTDIR}/dubious/Inflection.class" => :'compile:java'
|
51
|
+
file "#{OUTDIR}/dubious/ScopedParameterMap.class" => :'compile:java'
|
52
|
+
file "#{OUTDIR}/dubious/ActionController.class" => ["#{OUTDIR}/dubious/Params.class",
|
53
|
+
"#{OUTDIR}/dubious/FormHelper.class",
|
54
|
+
"#{OUTDIR}/dubious/AssetTimestampsCache.class",
|
55
|
+
"#{OUTDIR}/dubious/CustomRoutes.class",
|
56
|
+
]
|
57
|
+
|
58
|
+
file "#{OUTDIR}/dubious/Inflections.class" => ["#{OUTDIR}/dubious/TextHelper.class",
|
59
|
+
"#{OUTDIR}/dubious/Inflection.class"]
|
60
|
+
file "#{OUTDIR}/dubious/FormHelper.class" => [
|
61
|
+
"#{OUTDIR}/dubious/Inflections.class",
|
62
|
+
"#{OUTDIR}/dubious/InstanceTag.class",
|
63
|
+
"#{OUTDIR}/dubious/TimeConversion.class",
|
64
|
+
*STDLIB_CLASSES]
|
65
|
+
file "#{OUTDIR}/dubious/InstanceTag.class" => "#{OUTDIR}/dubious/SanitizeHelper.class"
|
66
|
+
file "#{OUTDIR}/dubious/Params.class" => "#{OUTDIR}/dubious/ScopedParameterMap.class"
|
67
|
+
|
68
|
+
file "lib/dubious.jar" => LIB_CLASSES do
|
69
|
+
includes = FileList[OUTDIR+'/dubious/**/*', OUTDIR+'/stdlib/**/*', OUTDIR + '/testing/**/*'].map {|d|d.sub "#{OUTDIR}/",''}.join(',')
|
70
|
+
ant.jar :destfile => "lib/dubious.jar",
|
71
|
+
:basedir => OUTDIR,
|
72
|
+
:includes => includes
|
73
|
+
end
|
74
|
+
|
75
|
+
desc "compiles mirah & java lib files"
|
76
|
+
task :compile => LIB_CLASSES
|
77
|
+
|
78
|
+
desc "compiles jar for gemification"
|
79
|
+
task :jar => "lib/dubious.jar"
|
80
|
+
|
81
|
+
namespace :compile do
|
82
|
+
task :dubious => "lib/dubious.jar"
|
83
|
+
task :java => OUTDIR do
|
84
|
+
ant.javac :srcdir => SRCDIR,
|
85
|
+
:destdir => OUTDIR,
|
86
|
+
:classpath => CLASSPATH
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
CLASSPATH = [AppEngine::Rake::SERVLET, AppEngine::SDK::API_JAR].join(":")
|
91
|
+
|
92
|
+
directory OUTDIR
|
93
|
+
|
94
|
+
(LIB_CLASSES).zip(LIB_SRC).each do |klass,src|
|
95
|
+
file klass => src
|
96
|
+
end
|
97
|
+
|
98
|
+
task :generate_build_properties do
|
99
|
+
def git_data(dir, file='')
|
100
|
+
returning = nil
|
101
|
+
chdir dir do
|
102
|
+
# ["commit abc....123", "2010-06-23 12:58:06 -0700"]
|
103
|
+
IO.popen("git rev-list --pretty=format:%ci -1 HEAD #{file}") do |f|
|
104
|
+
returning = [f.gets.chomp, f.gets.chomp]
|
105
|
+
end
|
106
|
+
end
|
107
|
+
returning
|
108
|
+
end
|
109
|
+
|
110
|
+
dubious_data = git_data(".")
|
111
|
+
mirah_data = git_data(MIRAH_HOME)
|
112
|
+
bite_data = git_data(MIRAH_HOME + '/../bitescript')
|
113
|
+
model_data = git_data(File.dirname(MODEL_SRC_JAR),File.basename(MODEL_SRC_JAR))
|
114
|
+
|
115
|
+
prop_file = "config/build.properties"
|
116
|
+
File.open(prop_file, 'w') do |f|
|
117
|
+
f.write <<-EOF
|
118
|
+
# the current build environment
|
119
|
+
application.build.time=#{Time.now.xmlschema}
|
120
|
+
dubious.version.commit=#{dubious_data[0][7..-1]}
|
121
|
+
dubious.version.time=#{Time.parse(dubious_data[1]).xmlschema}
|
122
|
+
mirah.version.commit=#{mirah_data[0][7..-1]}
|
123
|
+
mirah.version.time=#{Time.parse(mirah_data[1]).xmlschema}
|
124
|
+
bitescript.version.commit=#{bite_data[0][7..-1]}
|
125
|
+
bitescript.version.time=#{Time.parse(bite_data[1]).xmlschema}
|
126
|
+
model.version.commit=#{model_data[0][7..-1]}
|
127
|
+
model.version.time=#{Time.parse(model_data[1]).xmlschema}
|
128
|
+
EOF
|
129
|
+
end
|
130
|
+
end
|