calatrava 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/.gitignore +1 -1
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +4 -0
  5. data/CHANGES.markdown +67 -0
  6. data/Gemfile +1 -1
  7. data/Gemfile.lock +100 -0
  8. data/README.md +39 -3
  9. data/Rakefile +4 -0
  10. data/Vagrantfile +106 -0
  11. data/calatrava.gemspec +9 -4
  12. data/features/cli.feature +9 -0
  13. data/features/project.feature +15 -3
  14. data/features/sample_app.feature +5 -1
  15. data/features/support/calatrava_app.rb +1 -1
  16. data/features/support/env.rb +1 -1
  17. data/lib/calatrava/apache.rb +10 -31
  18. data/lib/calatrava/app.rb +7 -3
  19. data/lib/calatrava/app_builder.rb +11 -12
  20. data/lib/calatrava/configuration.rb +23 -6
  21. data/lib/calatrava/droid_app.rb +11 -2
  22. data/lib/calatrava/ios_app.rb +8 -1
  23. data/lib/calatrava/manifest.rb +0 -20
  24. data/lib/calatrava/mobile_web_app.rb +13 -9
  25. data/lib/calatrava/output_file.rb +53 -0
  26. data/lib/calatrava/platform.rb +12 -0
  27. data/lib/calatrava/project.rb +31 -3
  28. data/lib/calatrava/project_script.rb +15 -6
  29. data/lib/calatrava/tasks/assets.rb +2 -1
  30. data/lib/calatrava/tasks/bootstrap.rb +2 -3
  31. data/lib/calatrava/tasks/rake.rb +24 -0
  32. data/lib/calatrava/tasks.rb +1 -9
  33. data/lib/calatrava/templates/.ruby-gemset.calatrava +1 -0
  34. data/lib/calatrava/templates/.ruby-version +1 -0
  35. data/lib/calatrava/templates/droid/app/bridge.coffee +1 -1
  36. data/lib/calatrava/templates/droid/calatrava/CALATRAVA_TMPL/AndroidManifest.xml.calatrava +3 -4
  37. data/lib/calatrava/templates/droid/calatrava/CALATRAVA_TMPL/build.xml.calatrava +0 -4
  38. data/lib/calatrava/templates/droid/calatrava/ant/calatrava.xml +7 -3
  39. data/lib/calatrava/templates/droid/calatrava/{ivy.xml → ivy/ivy.xml} +0 -0
  40. data/lib/calatrava/templates/droid/calatrava/{ivysettings.xml → ivy/ivysettings.xml} +0 -0
  41. data/lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/Bootstrap.java.calatrava +21 -0
  42. data/lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/Title.java.calatrava +8 -15
  43. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/CalatravaApplication.java +87 -0
  44. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PageRegistry.java +12 -9
  45. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginRegistry.java +11 -5
  46. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredActivity.java +6 -15
  47. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredPlugin.java +1 -1
  48. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RhinoService.java +27 -41
  49. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/shell/WebViewActivity.java +7 -8
  50. data/lib/calatrava/templates/ios/Podfile.calatrava +1 -1
  51. data/lib/calatrava/templates/ios/src/AppDelegate.h +6 -1
  52. data/lib/calatrava/templates/ios/src/AppDelegate.m +20 -0
  53. data/lib/calatrava/templates/kernel/app/calatrava.coffee +13 -5
  54. data/lib/calatrava/templates/kernel/plugins/alert.coffee +4 -1
  55. data/lib/calatrava/templates/kernel/spec/converter/controller.converter.spec.coffee +1 -1
  56. data/lib/calatrava/templates/kernel/spec/stubView.coffee +17 -3
  57. data/lib/calatrava/templates/package.json +0 -1
  58. data/lib/calatrava/templates/shell/pages/converter/page.conversionForm.coffee +7 -2
  59. data/lib/calatrava/templates/web/app/source/bridge.coffee +7 -7
  60. data/lib/calatrava/templates/web/app/source/init.coffee +1 -1
  61. data/lib/calatrava/version.rb +1 -1
  62. data/lib/calatrava.rb +4 -0
  63. data/spec/app_builder_spec.rb +2 -2
  64. data/spec/mobile_web_app_spec.rb +1 -1
  65. data/spec/output_file_spec.rb +33 -0
  66. metadata +104 -35
  67. data/.rvmrc +0 -2
  68. data/lib/calatrava/templates/.rvmrc.calatrava +0 -2
  69. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Launcher.java +0 -86
  70. data/lib/calatrava/templates/ios/res/xibs/ProgressViewController.xib +0 -334
  71. data/lib/calatrava/templates/ios/res/xibs/WebViewController.xib +0 -173
  72. data/lib/calatrava/templates/web/deploy/instance.sh +0 -10
data/lib/calatrava.rb CHANGED
@@ -3,6 +3,9 @@ require 'rake/file_list'
3
3
 
4
4
  require 'calatrava/configuration'
5
5
 
6
+ require 'calatrava/tasks/rake'
7
+
8
+ require 'calatrava/platform'
6
9
  require 'calatrava/version'
7
10
  require 'calatrava/apache'
8
11
  require 'calatrava/app'
@@ -12,6 +15,7 @@ require 'calatrava/ios_app'
12
15
  require 'calatrava/kernel'
13
16
  require 'calatrava/manifest'
14
17
  require 'calatrava/mobile_web_app'
18
+ require 'calatrava/output_file'
15
19
  require 'calatrava/project'
16
20
  require 'calatrava/project_script'
17
21
  require 'calatrava/shell'
@@ -15,10 +15,10 @@ describe Calatrava::AppBuilder do
15
15
  :kernel_bootstrap => ['path/to/kernel.coffee'],
16
16
  :haml_files => ['diff/path/shell.haml']) }
17
17
 
18
- let(:app) { Calatrava::AppBuilder.new('app/build', manifest) }
18
+ let(:app) { Calatrava::AppBuilder.new('app', 'app/build', manifest) }
19
19
 
20
20
  context '#coffee_files' do
21
- subject { app.coffee_files }
21
+ subject { app.coffee_files.collect { |cf| cf.source_file.to_s } }
22
22
 
23
23
  it { should include 'path/to/kernel.coffee' }
24
24
  it { should include 'diff/path/shell.coffee' }
@@ -24,7 +24,7 @@ describe Calatrava::MobileWebApp do
24
24
  end
25
25
 
26
26
  context '#coffee_files' do
27
- subject { mobile_web.coffee_files }
27
+ subject { mobile_web.coffee_files.collect { |cf| cf.source_file.to_s } }
28
28
 
29
29
  it { should include 'path/to/kernel.coffee' }
30
30
  it { should include 'diff/path/shell.coffee' }
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Calatrava::OutputFile do
4
+ let(:file) { Calatrava::OutputFile.new("output directory", source_file, dependencies) }
5
+
6
+ context 'coffee file source' do
7
+ let(:source_file) { "coffee file.coffee" }
8
+ let(:dependencies) { [] }
9
+
10
+ describe '#output_path' do
11
+ subject { file.output_path }
12
+
13
+ it { should start_with("output directory/") }
14
+ it { should end_with("coffee file.js") }
15
+ end
16
+
17
+ describe '#dependencies' do
18
+ subject { file.dependencies }
19
+
20
+ it { should have(2).dependencies }
21
+ it { should include('coffee file.coffee') }
22
+ it { should include('output directory') }
23
+
24
+ context 'with additional' do
25
+ let(:dependencies) { [:environment] }
26
+
27
+ it { should have(3).dependencies }
28
+ it { should include(:environment) }
29
+ end
30
+ end
31
+ end
32
+
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calatrava
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-18 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70114091946480 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70114091946480
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: aruba
27
- requirement: &70114091968780 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,21 +37,31 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70114091968780
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rake
38
- requirement: &70114091968260 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
- - - ~>
51
+ - - ! '>='
42
52
  - !ruby/object:Gem::Version
43
53
  version: 0.9.5
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70114091968260
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.5
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: thor
49
- requirement: &70114091967760 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 0.16.0
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70114091967760
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.16.0
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: haml
60
- requirement: &70114091967300 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: 3.1.7
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *70114091967300
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 3.1.7
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: sass
71
- requirement: &70114091966840 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ~>
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 3.2.3
77
102
  type: :runtime
78
103
  prerelease: false
79
- version_requirements: *70114091966840
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 3.2.3
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: mustache
82
- requirement: &70114091966360 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ~>
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: 0.99.4
88
118
  type: :runtime
89
119
  prerelease: false
90
- version_requirements: *70114091966360
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.99.4
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: cucumber
93
- requirement: &70114091965860 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ~>
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: 1.2.1
99
134
  type: :runtime
100
135
  prerelease: false
101
- version_requirements: *70114091965860
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 1.2.1
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: watir-webdriver
104
- requirement: &70114091965280 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ~>
@@ -109,21 +149,31 @@ dependencies:
109
149
  version: 0.6.1
110
150
  type: :runtime
111
151
  prerelease: false
112
- version_requirements: *70114091965280
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: 0.6.1
113
158
  - !ruby/object:Gem::Dependency
114
159
  name: xcodeproj
115
- requirement: &70114091964660 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
116
161
  none: false
117
162
  requirements:
118
- - - ~>
163
+ - - ! '>='
119
164
  - !ruby/object:Gem::Version
120
165
  version: 0.4.0
121
166
  type: :runtime
122
167
  prerelease: false
123
- version_requirements: *70114091964660
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: 0.4.0
124
174
  - !ruby/object:Gem::Dependency
125
175
  name: cocoapods
126
- requirement: &70114091963860 !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
127
177
  none: false
128
178
  requirements:
129
179
  - - ~>
@@ -131,7 +181,12 @@ dependencies:
131
181
  version: 0.16.0
132
182
  type: :runtime
133
183
  prerelease: false
134
- version_requirements: *70114091963860
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ~>
188
+ - !ruby/object:Gem::Version
189
+ version: 0.16.0
135
190
  description: A framework to build cross-platform mobile apps with high quality native
136
191
  UIs.
137
192
  email:
@@ -142,12 +197,16 @@ extensions: []
142
197
  extra_rdoc_files: []
143
198
  files:
144
199
  - .gitignore
145
- - .rvmrc
200
+ - .ruby-gemset
201
+ - .ruby-version
202
+ - .travis.yml
146
203
  - CHANGES.markdown
147
204
  - Gemfile
205
+ - Gemfile.lock
148
206
  - LICENSE.txt
149
207
  - README.md
150
208
  - Rakefile
209
+ - Vagrantfile
151
210
  - bin/calatrava
152
211
  - calatrava.gemspec
153
212
  - features/cli.feature
@@ -167,6 +226,8 @@ files:
167
226
  - lib/calatrava/kernel.rb
168
227
  - lib/calatrava/manifest.rb
169
228
  - lib/calatrava/mobile_web_app.rb
229
+ - lib/calatrava/output_file.rb
230
+ - lib/calatrava/platform.rb
170
231
  - lib/calatrava/project.rb
171
232
  - lib/calatrava/project_script.rb
172
233
  - lib/calatrava/shell.rb
@@ -177,9 +238,11 @@ files:
177
238
  - lib/calatrava/tasks/bootstrap.rb
178
239
  - lib/calatrava/tasks/haml.rb
179
240
  - lib/calatrava/tasks/precommit.rb
241
+ - lib/calatrava/tasks/rake.rb
180
242
  - lib/calatrava/tasks/release.rb
181
243
  - lib/calatrava/template.rb
182
- - lib/calatrava/templates/.rvmrc.calatrava
244
+ - lib/calatrava/templates/.ruby-gemset.calatrava
245
+ - lib/calatrava/templates/.ruby-version
183
246
  - lib/calatrava/templates/Gemfile.calatrava
184
247
  - lib/calatrava/templates/Rakefile
185
248
  - lib/calatrava/templates/assets/lib/ICanHaz.js
@@ -193,8 +256,9 @@ files:
193
256
  - lib/calatrava/templates/droid/calatrava/CALATRAVA_TMPL/AndroidManifest.xml.calatrava
194
257
  - lib/calatrava/templates/droid/calatrava/CALATRAVA_TMPL/build.xml.calatrava
195
258
  - lib/calatrava/templates/droid/calatrava/ant/calatrava.xml
196
- - lib/calatrava/templates/droid/calatrava/ivy.xml
197
- - lib/calatrava/templates/droid/calatrava/ivysettings.xml
259
+ - lib/calatrava/templates/droid/calatrava/ivy/ivy.xml
260
+ - lib/calatrava/templates/droid/calatrava/ivy/ivysettings.xml
261
+ - lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/Bootstrap.java.calatrava
198
262
  - lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/ConversionForm.java.calatrava
199
263
  - lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/Title.java.calatrava
200
264
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/CalatravaPage.java
@@ -203,8 +267,8 @@ files:
203
267
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AlertPlugin.java
204
268
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AnnotationRegistrar.java
205
269
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AssetRepository.java
270
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/CalatravaApplication.java
206
271
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/KernelBridge.java
207
- - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Launcher.java
208
272
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PageRegistry.java
209
273
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginCommand.java
210
274
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginRegistry.java
@@ -217,8 +281,6 @@ files:
217
281
  - lib/calatrava/templates/droid/manifest.yml
218
282
  - lib/calatrava/templates/ios/Podfile.calatrava
219
283
  - lib/calatrava/templates/ios/manifest.yml
220
- - lib/calatrava/templates/ios/res/xibs/ProgressViewController.xib
221
- - lib/calatrava/templates/ios/res/xibs/WebViewController.xib
222
284
  - lib/calatrava/templates/ios/src/AppDelegate.h
223
285
  - lib/calatrava/templates/ios/src/AppDelegate.m
224
286
  - lib/calatrava/templates/ios/src/CALATRAVA_TMPL-Info.plist
@@ -257,13 +319,13 @@ files:
257
319
  - lib/calatrava/templates/web/app/source/bridge.coffee
258
320
  - lib/calatrava/templates/web/app/source/init.coffee
259
321
  - lib/calatrava/templates/web/app/views/index.haml
260
- - lib/calatrava/templates/web/deploy/instance.sh
261
322
  - lib/calatrava/templates/web/manifest.yml
262
323
  - lib/calatrava/version.rb
263
324
  - spec/app_builder_spec.rb
264
325
  - spec/kernel_spec.rb
265
326
  - spec/manifest_spec.rb
266
327
  - spec/mobile_web_app_spec.rb
328
+ - spec/output_file_spec.rb
267
329
  - spec/shell_spec.rb
268
330
  - spec/spec_helper.rb
269
331
  homepage: http://calatrava.github.com
@@ -278,15 +340,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
340
  - - ! '>='
279
341
  - !ruby/object:Gem::Version
280
342
  version: '0'
343
+ segments:
344
+ - 0
345
+ hash: -275265347738837271
281
346
  required_rubygems_version: !ruby/object:Gem::Requirement
282
347
  none: false
283
348
  requirements:
284
349
  - - ! '>='
285
350
  - !ruby/object:Gem::Version
286
351
  version: '0'
352
+ segments:
353
+ - 0
354
+ hash: -275265347738837271
287
355
  requirements: []
288
356
  rubyforge_project: calatrava
289
- rubygems_version: 1.8.10
357
+ rubygems_version: 1.8.25
290
358
  signing_key:
291
359
  specification_version: 3
292
360
  summary: Cross-platform mobile apps with native UIs
@@ -302,5 +370,6 @@ test_files:
302
370
  - spec/kernel_spec.rb
303
371
  - spec/manifest_spec.rb
304
372
  - spec/mobile_web_app_spec.rb
373
+ - spec/output_file_spec.rb
305
374
  - spec/shell_spec.rb
306
375
  - spec/spec_helper.rb
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm_install_on_use_flag=1
2
- rvm --create use ruby-1.9.3@calatrava
@@ -1,2 +0,0 @@
1
- rvm_install_on_use_flag=1
2
- rvm --create use ruby-1.9.3@{{ project_slug }}
@@ -1,86 +0,0 @@
1
- package com.calatrava.bridge;
2
-
3
- import android.app.Application;
4
- import android.content.ComponentName;
5
- import android.content.Context;
6
- import android.content.Intent;
7
- import android.content.ServiceConnection;
8
- import android.os.IBinder;
9
- import android.util.Log;
10
-
11
- import java.io.IOException;
12
- import java.io.BufferedReader;
13
- import java.io.InputStreamReader;
14
-
15
- public class Launcher {
16
- private static String TAG = Launcher.class.getSimpleName();
17
-
18
- private static String appName;
19
- private static RhinoService rhino;
20
- private static Context appContext;
21
- private static Application application;
22
- private static Runnable startUp;
23
-
24
- static ServiceConnection connection = new ServiceConnection() {
25
- public void onServiceConnected(ComponentName componentName, IBinder iBinder)
26
- {
27
- try
28
- {
29
- rhino = ((RhinoService.LocalBinder) iBinder).getService();
30
- PageRegistry.setSharedRegistry(new PageRegistry(appName, appContext, application, rhino));
31
- PluginRegistry.setSharedRegistry(new PluginRegistry(appName, appContext, rhino));
32
- AjaxRequestManager.setSharedManager(new AjaxRequestManager(appContext, rhino));
33
- initBridge();
34
- startUp.run();
35
- }
36
- catch (Exception e)
37
- {
38
- Log.e(TAG, "Unable to start.", e);
39
- }
40
- }
41
-
42
- public void onServiceDisconnected(ComponentName componentName) {
43
-
44
- }
45
- };
46
-
47
- public static void launchKernel(String appName,
48
- Context appContext,
49
- Application application,
50
- Runnable startUp) {
51
- Launcher.appName = appName;
52
- Launcher.appContext = appContext;
53
- Launcher.application = application;
54
- Launcher.startUp = startUp;
55
-
56
- Intent serviceIntent = new Intent(appContext, RhinoService.class);
57
- appContext.bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
58
- }
59
-
60
- public static void launchFlow(String flow)
61
- {
62
- rhino.callJsFunction(flow);
63
- }
64
-
65
- private static void initBridge() {
66
- AssetRepository assets = new AssetRepository(appContext);
67
-
68
- try {
69
- Log.d(TAG, "About to prep the rhino");
70
- rhino.initRhino();
71
-
72
- Log.d(TAG, "About to load and start kernel");
73
- // Load all the application JS
74
- KernelBridge bridge = new KernelBridge(assets, rhino);
75
- BufferedReader loadFileReader = new BufferedReader(new InputStreamReader(appContext.getAssets().open("calatrava/load_file.txt")), 8192);
76
- String line = null;
77
- while ((line = loadFileReader.readLine()) != null)
78
- {
79
- bridge.loadLibrary(line);
80
- }
81
-
82
- } catch (IOException e) {
83
- Log.d(TAG, "LauncherActivity failed to start: " + e);
84
- }
85
- }
86
- }