rhodes-framework 1.0.10 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +159 -30
- data/Rakefile +3 -19
- data/lib/erb.rb +1 -1
- data/lib/rho/rho.rb +94 -107
- data/lib/rho/rhofsconnector.rb +4 -0
- data/lib/rho/rhoutils.rb +26 -0
- data/lib/rho/rhoviewhelpers.rb +1 -1
- data/lib/rhodes.rb +2 -2
- data/lib/rhoframework.rb +9 -9
- data/lib/rhom/rhom.rb +1 -1
- data/lib/rhom/rhom_db_adapter.rb +36 -15
- data/lib/rhom/rhom_db_adapterME.rb +2 -3
- data/lib/rhom/rhom_object.rb +14 -2
- data/lib/rhom/rhom_object_factory.rb +42 -11
- data/lib/version.rb +2 -2
- data/spec/README +1 -0
- data/spec/Rakefile +1 -0
- data/spec/{configs/account.rb → app/Account/config.rb} +0 -0
- data/spec/{configs/case.rb → app/Case/config.rb} +0 -0
- data/spec/app/Question/config.rb +3 -0
- data/spec/app/Settings/controller.rb +10 -0
- data/spec/app/Settings/index.erb +11 -0
- data/spec/app/SpecRunner/controller.rb +15 -0
- data/spec/app/SpecRunner/index.erb +14 -0
- data/spec/app/application.rb +4 -0
- data/spec/app/index.erb +17 -0
- data/spec/app/layout.erb +27 -0
- data/spec/app/loading.html +11 -0
- data/spec/app/mspec.rb +11 -0
- data/spec/app/mspec/expectations.rb +2 -0
- data/spec/app/mspec/expectations/expectations.rb +17 -0
- data/spec/app/mspec/expectations/should.rb +25 -0
- data/spec/app/mspec/fileutils.rb +1590 -0
- data/spec/app/mspec/guards.rb +16 -0
- data/spec/app/mspec/guards/background.rb +21 -0
- data/spec/app/mspec/guards/bug.rb +24 -0
- data/spec/app/mspec/guards/compliance.rb +37 -0
- data/spec/app/mspec/guards/conflict.rb +18 -0
- data/spec/app/mspec/guards/endian.rb +44 -0
- data/spec/app/mspec/guards/extensions.rb +20 -0
- data/spec/app/mspec/guards/guard.rb +166 -0
- data/spec/app/mspec/guards/noncompliance.rb +20 -0
- data/spec/app/mspec/guards/platform.rb +43 -0
- data/spec/app/mspec/guards/quarantine.rb +17 -0
- data/spec/app/mspec/guards/runner.rb +34 -0
- data/spec/app/mspec/guards/superuser.rb +17 -0
- data/spec/app/mspec/guards/support.rb +20 -0
- data/spec/app/mspec/guards/tty.rb +20 -0
- data/spec/app/mspec/guards/version.rb +38 -0
- data/spec/app/mspec/helpers.rb +11 -0
- data/spec/app/mspec/helpers/argv.rb +43 -0
- data/spec/app/mspec/helpers/bignum.rb +5 -0
- data/spec/app/mspec/helpers/const_lookup.rb +9 -0
- data/spec/app/mspec/helpers/environment.rb +23 -0
- data/spec/app/mspec/helpers/fixture.rb +20 -0
- data/spec/app/mspec/helpers/flunk.rb +5 -0
- data/spec/app/mspec/helpers/io.rb +17 -0
- data/spec/app/mspec/helpers/language_version.rb +20 -0
- data/spec/app/mspec/helpers/ruby_exe.rb +123 -0
- data/spec/app/mspec/helpers/scratch.rb +17 -0
- data/spec/app/mspec/helpers/tmp.rb +32 -0
- data/spec/app/mspec/matchers.rb +23 -0
- data/spec/app/mspec/matchers/base.rb +95 -0
- data/spec/app/mspec/matchers/be_an_instance_of.rb +26 -0
- data/spec/app/mspec/matchers/be_ancestor_of.rb +24 -0
- data/spec/app/mspec/matchers/be_close.rb +27 -0
- data/spec/app/mspec/matchers/be_empty.rb +20 -0
- data/spec/app/mspec/matchers/be_false.rb +20 -0
- data/spec/app/mspec/matchers/be_kind_of.rb +24 -0
- data/spec/app/mspec/matchers/be_nil.rb +20 -0
- data/spec/app/mspec/matchers/be_true.rb +20 -0
- data/spec/app/mspec/matchers/complain.rb +56 -0
- data/spec/app/mspec/matchers/eql.rb +26 -0
- data/spec/app/mspec/matchers/equal.rb +26 -0
- data/spec/app/mspec/matchers/equal_element.rb +78 -0
- data/spec/app/mspec/matchers/equal_utf16.rb +34 -0
- data/spec/app/mspec/matchers/have_constant.rb +30 -0
- data/spec/app/mspec/matchers/have_instance_method.rb +24 -0
- data/spec/app/mspec/matchers/have_method.rb +24 -0
- data/spec/app/mspec/matchers/have_private_instance_method.rb +24 -0
- data/spec/app/mspec/matchers/include.rb +32 -0
- data/spec/app/mspec/matchers/match_yaml.rb +47 -0
- data/spec/app/mspec/matchers/method.rb +14 -0
- data/spec/app/mspec/matchers/output.rb +67 -0
- data/spec/app/mspec/matchers/output_to_fd.rb +71 -0
- data/spec/app/mspec/matchers/raise_error.rb +48 -0
- data/spec/app/mspec/matchers/respond_to.rb +24 -0
- data/spec/app/mspec/matchers/stringsymboladapter.rb +8 -0
- data/spec/app/mspec/mocks.rb +3 -0
- data/spec/app/mspec/mocks/mock.rb +159 -0
- data/spec/app/mspec/mocks/object.rb +20 -0
- data/spec/app/mspec/mocks/proxy.rb +136 -0
- data/spec/app/mspec/pp.rb +893 -0
- data/spec/app/mspec/runner.rb +15 -0
- data/spec/app/mspec/runner/actions.rb +8 -0
- data/spec/app/mspec/runner/actions/debug.rb +17 -0
- data/spec/app/mspec/runner/actions/filter.rb +40 -0
- data/spec/app/mspec/runner/actions/gdb.rb +17 -0
- data/spec/app/mspec/runner/actions/tag.rb +133 -0
- data/spec/app/mspec/runner/actions/taglist.rb +56 -0
- data/spec/app/mspec/runner/actions/tagpurge.rb +56 -0
- data/spec/app/mspec/runner/actions/tally.rb +116 -0
- data/spec/app/mspec/runner/actions/timer.rb +22 -0
- data/spec/app/mspec/runner/context.rb +188 -0
- data/spec/app/mspec/runner/example.rb +34 -0
- data/spec/app/mspec/runner/exception.rb +43 -0
- data/spec/app/mspec/runner/filters.rb +4 -0
- data/spec/app/mspec/runner/filters/match.rb +22 -0
- data/spec/app/mspec/runner/filters/profile.rb +54 -0
- data/spec/app/mspec/runner/filters/regexp.rb +7 -0
- data/spec/app/mspec/runner/filters/tag.rb +29 -0
- data/spec/app/mspec/runner/formatters.rb +10 -0
- data/spec/app/mspec/runner/formatters/describe.rb +24 -0
- data/spec/app/mspec/runner/formatters/dotted.rb +98 -0
- data/spec/app/mspec/runner/formatters/file.rb +19 -0
- data/spec/app/mspec/runner/formatters/html.rb +81 -0
- data/spec/app/mspec/runner/formatters/method.rb +93 -0
- data/spec/app/mspec/runner/formatters/specdoc.rb +41 -0
- data/spec/app/mspec/runner/formatters/spinner.rb +99 -0
- data/spec/app/mspec/runner/formatters/summary.rb +11 -0
- data/spec/app/mspec/runner/formatters/unit.rb +21 -0
- data/spec/app/mspec/runner/formatters/yaml.rb +44 -0
- data/spec/app/mspec/runner/mspec.rb +361 -0
- data/spec/app/mspec/runner/object.rb +24 -0
- data/spec/app/mspec/runner/shared.rb +12 -0
- data/spec/app/mspec/runner/tag.rb +32 -0
- data/spec/app/mspec/utils/name_map.rb +129 -0
- data/spec/app/mspec/utils/options.rb +441 -0
- data/spec/app/mspec/utils/ruby_name.rb +8 -0
- data/spec/app/mspec/utils/script.rb +220 -0
- data/spec/app/mspec/utils/version.rb +53 -0
- data/spec/app/mspec/version.rb +5 -0
- data/spec/app/spec/fixtures/client_info.txt +2 -0
- data/spec/app/spec/fixtures/object_values.txt +90 -0
- data/spec/{rho_controller_spec.rb → app/spec/rho_controller_spec.rb} +4 -7
- data/spec/{rho_spec.rb → app/spec/rho_spec.rb} +15 -36
- data/spec/{rhom_object_factory_spec.rb → app/spec/rhom_object_factory_spec.rb} +108 -72
- data/spec/{rhom_spec.rb → app/spec/rhom_spec.rb} +8 -4
- data/spec/app/spec/spec_helper.rb +15 -0
- data/spec/app/spec/webview_spec.rb +27 -0
- data/spec/app/spec_runner.rb +26 -0
- data/spec/build.yml +28 -0
- data/spec/public/css/base.css +39 -0
- data/spec/public/css/blackberry.css +99 -0
- data/spec/public/css/iphone.css +392 -0
- data/spec/public/css/rho.css +3 -0
- data/spec/public/css/xhtml.css +114 -0
- data/spec/public/images/IUI_LICENSE.txt +21 -0
- data/spec/public/images/backButton.png +0 -0
- data/spec/public/images/blueButton.png +0 -0
- data/spec/public/images/cancel.png +0 -0
- data/spec/public/images/grayButton.png +0 -0
- data/spec/public/images/iui-logo-touch-icon.png +0 -0
- data/spec/public/images/listArrow.png +0 -0
- data/spec/public/images/listArrowSel.png +0 -0
- data/spec/public/images/listGroup.png +0 -0
- data/spec/public/images/loading.gif +0 -0
- data/spec/public/images/pinstripes.png +0 -0
- data/spec/public/images/right_button.png +0 -0
- data/spec/public/images/selection.png +0 -0
- data/spec/public/images/thumb.png +0 -0
- data/spec/public/images/toggle.png +0 -0
- data/spec/public/images/toggleOn.png +0 -0
- data/spec/public/images/toolButton.png +0 -0
- data/spec/public/images/toolButton_new.png +0 -0
- data/spec/public/images/toolbar.png +0 -0
- data/spec/public/images/whiteButton.png +0 -0
- data/spec/public/js/application.js +1 -0
- data/spec/public/js/jquery-1.2.6.min.js +32 -0
- data/spec/public/js/rho.js +4 -0
- data/spec/public/js/rhogeolocation-wm.js +59 -0
- data/spec/public/js/rhogeolocation.js +11 -0
- data/spec/rhoconfig.txt +19 -0
- metadata +169 -39
- data/History.txt +0 -37
- data/README.rdoc +0 -2
- data/lib/TestServe.rb +0 -9
- data/res/sqlite3/constants.rb +0 -49
- data/res/sqlite3/database.rb +0 -715
- data/res/sqlite3/driver/dl/api.rb +0 -154
- data/res/sqlite3/driver/dl/driver.rb +0 -307
- data/res/sqlite3/driver/native/driver.rb +0 -257
- data/res/sqlite3/errors.rb +0 -68
- data/res/sqlite3/pragmas.rb +0 -271
- data/res/sqlite3/resultset.rb +0 -176
- data/res/sqlite3/sqlite3_api.rb +0 -0
- data/res/sqlite3/statement.rb +0 -230
- data/res/sqlite3/translator.rb +0 -109
- data/res/sqlite3/value.rb +0 -57
- data/res/sqlite3/version.rb +0 -14
- data/rhodes.gemspec +0 -18
- data/spec/app_manifest.txt +0 -4
- data/spec/configs/contact.rb +0 -3
- data/spec/configs/employee.rb +0 -3
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +0 -49
- data/spec/stubs.rb +0 -39
- data/spec/syncdbtest.sqlite +0 -0
data/Manifest.txt
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
.gitignore
|
2
|
-
History.txt
|
3
2
|
Manifest.txt
|
4
|
-
README.rdoc
|
5
3
|
Rakefile
|
6
4
|
lib/ServeME.rb
|
7
|
-
lib/TestServe.rb
|
8
5
|
lib/bsearch.rb
|
9
6
|
lib/builtinME.rb
|
10
7
|
lib/date.rb
|
@@ -22,6 +19,7 @@ lib/rho/rhocontact.rb
|
|
22
19
|
lib/rho/rhocontroller.rb
|
23
20
|
lib/rho/rhofsconnector.rb
|
24
21
|
lib/rho/rhosupport.rb
|
22
|
+
lib/rho/rhoutils.rb
|
25
23
|
lib/rho/rhoviewhelpers.rb
|
26
24
|
lib/rhodes-framework.rb
|
27
25
|
lib/rhodes.rb
|
@@ -37,31 +35,162 @@ lib/rhom/rhom_source.rb
|
|
37
35
|
lib/singleton.rb
|
38
36
|
lib/time.rb
|
39
37
|
lib/version.rb
|
40
|
-
res/sqlite3/constants.rb
|
41
|
-
res/sqlite3/database.rb
|
42
|
-
res/sqlite3/driver/dl/api.rb
|
43
|
-
res/sqlite3/driver/dl/driver.rb
|
44
|
-
res/sqlite3/driver/native/driver.rb
|
45
|
-
res/sqlite3/errors.rb
|
46
|
-
res/sqlite3/pragmas.rb
|
47
|
-
res/sqlite3/resultset.rb
|
48
|
-
res/sqlite3/sqlite3_api.rb
|
49
|
-
res/sqlite3/statement.rb
|
50
|
-
res/sqlite3/translator.rb
|
51
|
-
res/sqlite3/value.rb
|
52
|
-
res/sqlite3/version.rb
|
53
38
|
rhodes-framework.gemspec
|
54
|
-
|
55
|
-
spec/
|
56
|
-
spec/
|
57
|
-
spec/
|
58
|
-
spec/
|
59
|
-
spec/
|
60
|
-
spec/
|
61
|
-
spec/
|
62
|
-
spec/
|
63
|
-
spec/
|
64
|
-
spec/
|
65
|
-
spec/
|
66
|
-
spec/
|
67
|
-
spec/
|
39
|
+
spec/README
|
40
|
+
spec/Rakefile
|
41
|
+
spec/app/Account/config.rb
|
42
|
+
spec/app/Case/config.rb
|
43
|
+
spec/app/Question/config.rb
|
44
|
+
spec/app/Settings/controller.rb
|
45
|
+
spec/app/Settings/index.erb
|
46
|
+
spec/app/SpecRunner/controller.rb
|
47
|
+
spec/app/SpecRunner/index.erb
|
48
|
+
spec/app/application.rb
|
49
|
+
spec/app/index.erb
|
50
|
+
spec/app/layout.erb
|
51
|
+
spec/app/loading.html
|
52
|
+
spec/app/mspec.rb
|
53
|
+
spec/app/mspec/expectations.rb
|
54
|
+
spec/app/mspec/expectations/expectations.rb
|
55
|
+
spec/app/mspec/expectations/should.rb
|
56
|
+
spec/app/mspec/fileutils.rb
|
57
|
+
spec/app/mspec/guards.rb
|
58
|
+
spec/app/mspec/guards/background.rb
|
59
|
+
spec/app/mspec/guards/bug.rb
|
60
|
+
spec/app/mspec/guards/compliance.rb
|
61
|
+
spec/app/mspec/guards/conflict.rb
|
62
|
+
spec/app/mspec/guards/endian.rb
|
63
|
+
spec/app/mspec/guards/extensions.rb
|
64
|
+
spec/app/mspec/guards/guard.rb
|
65
|
+
spec/app/mspec/guards/noncompliance.rb
|
66
|
+
spec/app/mspec/guards/platform.rb
|
67
|
+
spec/app/mspec/guards/quarantine.rb
|
68
|
+
spec/app/mspec/guards/runner.rb
|
69
|
+
spec/app/mspec/guards/superuser.rb
|
70
|
+
spec/app/mspec/guards/support.rb
|
71
|
+
spec/app/mspec/guards/tty.rb
|
72
|
+
spec/app/mspec/guards/version.rb
|
73
|
+
spec/app/mspec/helpers.rb
|
74
|
+
spec/app/mspec/helpers/argv.rb
|
75
|
+
spec/app/mspec/helpers/bignum.rb
|
76
|
+
spec/app/mspec/helpers/const_lookup.rb
|
77
|
+
spec/app/mspec/helpers/environment.rb
|
78
|
+
spec/app/mspec/helpers/fixture.rb
|
79
|
+
spec/app/mspec/helpers/flunk.rb
|
80
|
+
spec/app/mspec/helpers/io.rb
|
81
|
+
spec/app/mspec/helpers/language_version.rb
|
82
|
+
spec/app/mspec/helpers/ruby_exe.rb
|
83
|
+
spec/app/mspec/helpers/scratch.rb
|
84
|
+
spec/app/mspec/helpers/tmp.rb
|
85
|
+
spec/app/mspec/matchers.rb
|
86
|
+
spec/app/mspec/matchers/base.rb
|
87
|
+
spec/app/mspec/matchers/be_an_instance_of.rb
|
88
|
+
spec/app/mspec/matchers/be_ancestor_of.rb
|
89
|
+
spec/app/mspec/matchers/be_close.rb
|
90
|
+
spec/app/mspec/matchers/be_empty.rb
|
91
|
+
spec/app/mspec/matchers/be_false.rb
|
92
|
+
spec/app/mspec/matchers/be_kind_of.rb
|
93
|
+
spec/app/mspec/matchers/be_nil.rb
|
94
|
+
spec/app/mspec/matchers/be_true.rb
|
95
|
+
spec/app/mspec/matchers/complain.rb
|
96
|
+
spec/app/mspec/matchers/eql.rb
|
97
|
+
spec/app/mspec/matchers/equal.rb
|
98
|
+
spec/app/mspec/matchers/equal_element.rb
|
99
|
+
spec/app/mspec/matchers/equal_utf16.rb
|
100
|
+
spec/app/mspec/matchers/have_constant.rb
|
101
|
+
spec/app/mspec/matchers/have_instance_method.rb
|
102
|
+
spec/app/mspec/matchers/have_method.rb
|
103
|
+
spec/app/mspec/matchers/have_private_instance_method.rb
|
104
|
+
spec/app/mspec/matchers/include.rb
|
105
|
+
spec/app/mspec/matchers/match_yaml.rb
|
106
|
+
spec/app/mspec/matchers/method.rb
|
107
|
+
spec/app/mspec/matchers/output.rb
|
108
|
+
spec/app/mspec/matchers/output_to_fd.rb
|
109
|
+
spec/app/mspec/matchers/raise_error.rb
|
110
|
+
spec/app/mspec/matchers/respond_to.rb
|
111
|
+
spec/app/mspec/matchers/stringsymboladapter.rb
|
112
|
+
spec/app/mspec/mocks.rb
|
113
|
+
spec/app/mspec/mocks/mock.rb
|
114
|
+
spec/app/mspec/mocks/object.rb
|
115
|
+
spec/app/mspec/mocks/proxy.rb
|
116
|
+
spec/app/mspec/pp.rb
|
117
|
+
spec/app/mspec/runner.rb
|
118
|
+
spec/app/mspec/runner/actions.rb
|
119
|
+
spec/app/mspec/runner/actions/debug.rb
|
120
|
+
spec/app/mspec/runner/actions/filter.rb
|
121
|
+
spec/app/mspec/runner/actions/gdb.rb
|
122
|
+
spec/app/mspec/runner/actions/tag.rb
|
123
|
+
spec/app/mspec/runner/actions/taglist.rb
|
124
|
+
spec/app/mspec/runner/actions/tagpurge.rb
|
125
|
+
spec/app/mspec/runner/actions/tally.rb
|
126
|
+
spec/app/mspec/runner/actions/timer.rb
|
127
|
+
spec/app/mspec/runner/context.rb
|
128
|
+
spec/app/mspec/runner/example.rb
|
129
|
+
spec/app/mspec/runner/exception.rb
|
130
|
+
spec/app/mspec/runner/filters.rb
|
131
|
+
spec/app/mspec/runner/filters/match.rb
|
132
|
+
spec/app/mspec/runner/filters/profile.rb
|
133
|
+
spec/app/mspec/runner/filters/regexp.rb
|
134
|
+
spec/app/mspec/runner/filters/tag.rb
|
135
|
+
spec/app/mspec/runner/formatters.rb
|
136
|
+
spec/app/mspec/runner/formatters/describe.rb
|
137
|
+
spec/app/mspec/runner/formatters/dotted.rb
|
138
|
+
spec/app/mspec/runner/formatters/file.rb
|
139
|
+
spec/app/mspec/runner/formatters/html.rb
|
140
|
+
spec/app/mspec/runner/formatters/method.rb
|
141
|
+
spec/app/mspec/runner/formatters/specdoc.rb
|
142
|
+
spec/app/mspec/runner/formatters/spinner.rb
|
143
|
+
spec/app/mspec/runner/formatters/summary.rb
|
144
|
+
spec/app/mspec/runner/formatters/unit.rb
|
145
|
+
spec/app/mspec/runner/formatters/yaml.rb
|
146
|
+
spec/app/mspec/runner/mspec.rb
|
147
|
+
spec/app/mspec/runner/object.rb
|
148
|
+
spec/app/mspec/runner/shared.rb
|
149
|
+
spec/app/mspec/runner/tag.rb
|
150
|
+
spec/app/mspec/utils/name_map.rb
|
151
|
+
spec/app/mspec/utils/options.rb
|
152
|
+
spec/app/mspec/utils/ruby_name.rb
|
153
|
+
spec/app/mspec/utils/script.rb
|
154
|
+
spec/app/mspec/utils/version.rb
|
155
|
+
spec/app/mspec/version.rb
|
156
|
+
spec/app/spec/fixtures/client_info.txt
|
157
|
+
spec/app/spec/fixtures/object_values.txt
|
158
|
+
spec/app/spec/rho_controller_spec.rb
|
159
|
+
spec/app/spec/rho_spec.rb
|
160
|
+
spec/app/spec/rhom_object_factory_spec.rb
|
161
|
+
spec/app/spec/rhom_spec.rb
|
162
|
+
spec/app/spec/spec_helper.rb
|
163
|
+
spec/app/spec/webview_spec.rb
|
164
|
+
spec/app/spec_runner.rb
|
165
|
+
spec/build.yml
|
166
|
+
spec/public/css/base.css
|
167
|
+
spec/public/css/blackberry.css
|
168
|
+
spec/public/css/iphone.css
|
169
|
+
spec/public/css/rho.css
|
170
|
+
spec/public/css/xhtml.css
|
171
|
+
spec/public/images/IUI_LICENSE.txt
|
172
|
+
spec/public/images/backButton.png
|
173
|
+
spec/public/images/blueButton.png
|
174
|
+
spec/public/images/cancel.png
|
175
|
+
spec/public/images/grayButton.png
|
176
|
+
spec/public/images/iui-logo-touch-icon.png
|
177
|
+
spec/public/images/listArrow.png
|
178
|
+
spec/public/images/listArrowSel.png
|
179
|
+
spec/public/images/listGroup.png
|
180
|
+
spec/public/images/loading.gif
|
181
|
+
spec/public/images/pinstripes.png
|
182
|
+
spec/public/images/right_button.png
|
183
|
+
spec/public/images/selection.png
|
184
|
+
spec/public/images/thumb.png
|
185
|
+
spec/public/images/toggle.png
|
186
|
+
spec/public/images/toggleOn.png
|
187
|
+
spec/public/images/toolButton.png
|
188
|
+
spec/public/images/toolButton_new.png
|
189
|
+
spec/public/images/toolbar.png
|
190
|
+
spec/public/images/whiteButton.png
|
191
|
+
spec/public/js/application.js
|
192
|
+
spec/public/js/jquery-1.2.6.min.js
|
193
|
+
spec/public/js/rho.js
|
194
|
+
spec/public/js/rhogeolocation-wm.js
|
195
|
+
spec/public/js/rhogeolocation.js
|
196
|
+
spec/rhoconfig.txt
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
%w[rubygems rake rake/clean fileutils newgem
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem].each { |f| require f }
|
2
2
|
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
3
3
|
require 'lib/version.rb'
|
4
4
|
|
@@ -8,7 +8,7 @@ task :default => [:spec]
|
|
8
8
|
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
9
9
|
$hoe = Hoe.new('rhodes-framework', RhodesFramework::VERSION) do |p|
|
10
10
|
p.developer('Rhomobile Dev', 'dev@rhomobile.com')
|
11
|
-
p.changes = p.paragraphs_of("../History.txt", 0..1).join("\n\n") if File.exists? "../History.txt"
|
11
|
+
#p.changes = p.paragraphs_of("../History.txt", 0..1).join("\n\n") if File.exists? "../History.txt"
|
12
12
|
#p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
13
13
|
p.rubyforge_name = p.name # TODO this is default value
|
14
14
|
p.extra_deps = [
|
@@ -30,20 +30,4 @@ $hoe = Hoe.new('rhodes-framework', RhodesFramework::VERSION) do |p|
|
|
30
30
|
|
31
31
|
end
|
32
32
|
|
33
|
-
require 'newgem/tasks'
|
34
|
-
# remove test task TODO: why does this run anyway?
|
35
|
-
Rake.application.remove_task(:test)
|
36
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
37
|
-
|
38
|
-
desc "Run the specs under spec"
|
39
|
-
Spec::Rake::SpecTask.new do |t|
|
40
|
-
t.spec_opts = ['--options', "spec/spec.opts"]
|
41
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
42
|
-
t.rcov = true
|
43
|
-
t.rcov_opts = ['--include',
|
44
|
-
'"lib/rhom/*,lib/rho/*"',
|
45
|
-
'-x',
|
46
|
-
'spec,gems,sqlite3/*,lib/date.rb,lib/rational.rb,lib/time.rb,lib/find.rb,config.rb,lib/erb.rb,lib/singleton.rb,lib/pairparser.rb',
|
47
|
-
'--text-report',
|
48
|
-
'--html']
|
49
|
-
end
|
33
|
+
require 'newgem/tasks'
|
data/lib/erb.rb
CHANGED
data/lib/rho/rho.rb
CHANGED
@@ -7,9 +7,10 @@ require 'rhofsconnector'
|
|
7
7
|
module Rho
|
8
8
|
class RHO
|
9
9
|
APPLICATIONS = {}
|
10
|
-
|
10
|
+
|
11
11
|
def initialize(app_manifest_filename=nil)
|
12
12
|
puts "Calling RHO.initialize"
|
13
|
+
process_rhoconfig
|
13
14
|
Rhom::RhomDbAdapter::open(Rho::RhoFSConnector::get_db_fullpathname)
|
14
15
|
if app_manifest_filename
|
15
16
|
process_model_dirs(app_manifest_filename)
|
@@ -31,6 +32,23 @@ module Rho
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
35
|
+
# Return the directories where we need to load configuration files
|
36
|
+
def process_rhoconfig
|
37
|
+
begin
|
38
|
+
File.open(Rho::RhoFSConnector.get_rhoconfig_filename).each do |line|
|
39
|
+
parts = line.chop.split('=')
|
40
|
+
key = parts[0]
|
41
|
+
value = parts[1..parts.length-1].join('=') if parts and parts.length > 1
|
42
|
+
if key and value
|
43
|
+
tmp = value.strip!
|
44
|
+
Rho::RhoConfig.config[key.strip] = tmp.gsub(/'|"/,'') if tmp
|
45
|
+
end
|
46
|
+
end
|
47
|
+
rescue Exception => e
|
48
|
+
puts "Error opening rhoconfig.txt: #{e}, using defaults."
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
34
52
|
# setup the sources table and model attributes for all applications
|
35
53
|
def init_sources
|
36
54
|
if defined? Rho::RhoConfig::sources
|
@@ -39,7 +57,7 @@ module Rho
|
|
39
57
|
uniq_sources = Rho::RhoConfig::sources.values.inject([]) { |result,h|
|
40
58
|
result << h unless result.include?(h); result
|
41
59
|
}
|
42
|
-
|
60
|
+
|
43
61
|
# generate unique source list in database for sync
|
44
62
|
uniq_sources.each do |source|
|
45
63
|
|
@@ -56,7 +74,7 @@ module Rho
|
|
56
74
|
def source_initialized?(source_id)
|
57
75
|
Rhom::RhomDbAdapter::select_from_table('sources','*', 'source_id'=>source_id).size > 0 ? true : false
|
58
76
|
end
|
59
|
-
|
77
|
+
|
60
78
|
def get_app(appname)
|
61
79
|
if (APPLICATIONS[appname].nil?)
|
62
80
|
require RhoApplication::get_app_path(appname)+'application'
|
@@ -66,66 +84,50 @@ module Rho
|
|
66
84
|
APPLICATIONS[appname]
|
67
85
|
end
|
68
86
|
|
69
|
-
def get_start_path
|
70
|
-
Rho::RhoConfig.start_path
|
71
|
-
end
|
72
|
-
|
73
|
-
def get_options_path
|
74
|
-
Rho::RhoConfig.options_path
|
75
|
-
end
|
76
|
-
|
77
|
-
def get_rhobundle_zip_url
|
78
|
-
Rho::RhoConfig.rhobundle_zip_url
|
79
|
-
end
|
80
|
-
|
81
|
-
def get_rhobundle_zip_pwd
|
82
|
-
Rho::RhoConfig.rhobundle_zip_pwd
|
83
|
-
end
|
84
|
-
|
85
87
|
def serve(req)
|
86
88
|
begin
|
87
|
-
|
89
|
+
puts 'inside RHO.serve...'
|
88
90
|
res = init_response
|
89
91
|
get_app(req['application']).send :serve, req, res
|
90
92
|
return send_response(res)
|
91
93
|
rescue Exception => e
|
92
94
|
return send_error(e)
|
93
|
-
end
|
95
|
+
end
|
94
96
|
end
|
95
97
|
|
96
98
|
def serve_hash(req)
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
99
|
+
begin
|
100
|
+
puts 'inside RHO.serve...'
|
101
|
+
res = init_response
|
102
|
+
get_app(req['application']).send :serve, req, res
|
103
|
+
return send_response_hash(res)
|
104
|
+
rescue Exception => e
|
105
|
+
return send_error(e,500,true)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def serve_index(index_name)
|
110
|
+
begin
|
111
|
+
puts 'inside RHO.serve_index: ' + index_name
|
112
|
+
res = init_response
|
113
|
+
res['request-body'] = RhoController::renderfile(index_name)
|
114
|
+
return send_response(res)
|
115
|
+
rescue Exception => e
|
116
|
+
return send_error(e)
|
117
|
+
end
|
118
|
+
end
|
117
119
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
120
|
+
def serve_index_hash(index_name)
|
121
|
+
begin
|
122
|
+
puts 'inside RHO.serve_index: ' + index_name
|
123
|
+
res = init_response
|
124
|
+
res['request-body'] = RhoController::renderfile(index_name)
|
125
|
+
return send_response_hash(res)
|
126
|
+
rescue Exception => e
|
127
|
+
return send_error(e.message, 500, true)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
129
131
|
def init_response(status=200,message="OK",body="")
|
130
132
|
res = Hash.new
|
131
133
|
res['status'] = status
|
@@ -144,7 +146,7 @@ module Rho
|
|
144
146
|
CR = "\x0d"
|
145
147
|
LF = "\x0a"
|
146
148
|
CRLF = "\x0d\x0a"
|
147
|
-
|
149
|
+
|
148
150
|
def send_response(res)
|
149
151
|
res['headers']['Content-Length'] = res['request-body'].nil? ? 0 : res['request-body'].length
|
150
152
|
data = "HTTP/1.1 #{res['status'].to_s} #{res['message']}" + CRLF
|
@@ -152,43 +154,52 @@ module Rho
|
|
152
154
|
tmp = key.gsub(/\bwww|^te$|\b\w/){|s| s.upcase }
|
153
155
|
data << "#{tmp}: #{value}" << CRLF
|
154
156
|
}
|
157
|
+
data << "Pragma: no-cache" << CRLF
|
158
|
+
data << "Cache-Control: must-revalidate" << CRLF
|
159
|
+
data << "Cache-Control: no-cache" << CRLF
|
160
|
+
data << "Cache-Control: no-store" << CRLF
|
161
|
+
data << "Expires: 0" << CRLF
|
162
|
+
|
155
163
|
data << CRLF
|
156
|
-
|
164
|
+
if ( !res['request-body'].nil? )
|
165
|
+
data << res['request-body']
|
166
|
+
end
|
167
|
+
|
157
168
|
data
|
158
169
|
end
|
159
170
|
|
160
171
|
def send_response_hash(res)
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
172
|
+
resp = Hash.new
|
173
|
+
res['headers']['Content-Length'] = res['request-body'].nil? ? 0 : res['request-body'].length
|
174
|
+
res['headers'].each{|key, value|
|
175
|
+
tmp = key.gsub(/\bwww|^te$|\b\w/){|s| s.upcase }
|
176
|
+
resp[tmp] = value
|
177
|
+
}
|
167
178
|
resp['request-body'] = res['request-body']
|
168
179
|
resp['status'] = res['status']
|
169
180
|
resp['message'] = res['message']
|
170
181
|
|
171
|
-
|
182
|
+
resp
|
172
183
|
end
|
173
|
-
|
184
|
+
|
174
185
|
def send_error(exception=nil,status=500,hash=false)
|
175
186
|
body=''
|
176
187
|
body << <<-_HTML_STRING_
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
188
|
+
<html>
|
189
|
+
<head>
|
190
|
+
<title>Server Error</title>
|
191
|
+
<meta name="viewport" content="width=320"/>
|
192
|
+
</head>
|
193
|
+
<body>
|
194
|
+
<p>
|
184
195
|
_HTML_STRING_
|
185
196
|
body << 'Error: ' << exception.message << "<br/>" if exception
|
186
197
|
body << 'Trace: ' << exception.backtrace.join("\n") if exception
|
187
198
|
body << <<-_HTML_STRING_
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
199
|
+
</p>
|
200
|
+
</body>
|
201
|
+
</html>
|
202
|
+
|
192
203
|
_HTML_STRING_
|
193
204
|
if ( hash )
|
194
205
|
send_response_hash(init_response(status,"Server error",body))
|
@@ -200,47 +211,23 @@ module Rho
|
|
200
211
|
|
201
212
|
# Generic configuration class which accepts hashes with unique keys
|
202
213
|
class RhoConfig
|
214
|
+
|
203
215
|
@@sources = {}
|
204
|
-
@@
|
205
|
-
|
206
|
-
@@rhobundle_zip_url = nil
|
207
|
-
@@rhobundle_zip_pwd = nil
|
216
|
+
@@config = {'start_path' => '/app',
|
217
|
+
'options_path' => '/app/Settings'}
|
208
218
|
|
209
219
|
class << self
|
210
|
-
def
|
211
|
-
|
220
|
+
def method_missing(name, *args)
|
221
|
+
varname = name.to_s.sub(/=/,'')
|
222
|
+
@@config[varname]
|
212
223
|
end
|
213
224
|
|
214
|
-
def
|
215
|
-
@@
|
216
|
-
end
|
217
|
-
|
218
|
-
def options_path=(path=nil)
|
219
|
-
@@options_path = path if path
|
220
|
-
end
|
221
|
-
|
222
|
-
def start_path
|
223
|
-
@@start_path
|
224
|
-
end
|
225
|
-
|
226
|
-
def start_path=(path=nil)
|
227
|
-
@@start_path = path if path
|
228
|
-
end
|
229
|
-
|
230
|
-
def rhobundle_zip_url
|
231
|
-
@@rhobundle_zip_url
|
232
|
-
end
|
233
|
-
|
234
|
-
def rhobundle_zip_url=(url=nil)
|
235
|
-
@@rhobundle_zip_url = url
|
225
|
+
def sources
|
226
|
+
@@sources
|
236
227
|
end
|
237
228
|
|
238
|
-
def
|
239
|
-
@@
|
240
|
-
end
|
241
|
-
|
242
|
-
def rhobundle_zip_pwd=(pwd=nil)
|
243
|
-
@@rhobundle_zip_pwd = pwd
|
229
|
+
def config
|
230
|
+
@@config
|
244
231
|
end
|
245
232
|
|
246
233
|
def add_source(modelname, new_source=nil)
|