calatrava 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/CHANGES.markdown +40 -0
  2. data/README.md +5 -0
  3. data/calatrava.gemspec +2 -3
  4. data/lib/calatrava/apache.rb +126 -0
  5. data/lib/calatrava/app.rb +2 -2
  6. data/lib/calatrava/app_builder.rb +68 -0
  7. data/lib/calatrava/configuration.rb +73 -0
  8. data/lib/calatrava/droid_app.rb +46 -0
  9. data/lib/calatrava/ios_app.rb +40 -0
  10. data/lib/calatrava/kernel.rb +79 -0
  11. data/lib/calatrava/manifest.rb +34 -11
  12. data/lib/calatrava/mobile_web_app.rb +74 -0
  13. data/lib/calatrava/project.rb +7 -191
  14. data/lib/calatrava/project_script.rb +186 -0
  15. data/lib/calatrava/shell.rb +43 -0
  16. data/lib/calatrava/tasks/assets.rb +4 -0
  17. data/lib/calatrava/tasks/automation.rb +4 -10
  18. data/lib/calatrava/tasks/haml.rb +9 -10
  19. data/lib/calatrava/tasks.rb +9 -85
  20. data/lib/calatrava/templates/config/templates/httpd.conf.erb +9 -9
  21. data/lib/calatrava/templates/droid/app/bridge.coffee +3 -0
  22. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/CalatravaPlugin.java +13 -0
  23. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AlertPlugin.java +61 -0
  24. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AnnotationRegistrar.java +71 -0
  25. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/KernelBridge.java +3 -4
  26. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Launcher.java +2 -1
  27. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PageRegistry.java +8 -29
  28. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginCommand.java +8 -0
  29. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginRegistry.java +112 -0
  30. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredActivity.java +3 -14
  31. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredPlugin.java +10 -0
  32. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Registration.java +8 -0
  33. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RhinoService.java +1 -0
  34. data/lib/calatrava/templates/droid/calatrava/src/com/calatrava/shell/WebViewActivity.java +1 -1
  35. data/lib/calatrava/templates/ios/Podfile.calatrava +6 -1
  36. data/lib/calatrava/templates/ios/src/ConversionFormViewController.m +1 -1
  37. data/lib/calatrava/templates/kernel/app/calatrava.coffee +32 -5
  38. data/lib/calatrava/templates/kernel/app/converter/controller.converter.coffee +11 -4
  39. data/lib/calatrava/templates/kernel/plugins/alert.coffee +9 -0
  40. data/lib/calatrava/templates/shell/layouts/single_page.haml +3 -3
  41. data/lib/calatrava/templates/web/app/source/alert.web.coffee +13 -0
  42. data/lib/calatrava/templates/web/app/source/bridge.coffee +10 -0
  43. data/lib/calatrava/templates/web/app/views/index.haml +5 -5
  44. data/lib/calatrava/version.rb +1 -1
  45. data/lib/calatrava.rb +15 -1
  46. data/spec/app_builder_spec.rb +46 -0
  47. data/spec/kernel_spec.rb +51 -0
  48. data/spec/manifest_spec.rb +62 -0
  49. data/spec/mobile_web_app_spec.rb +49 -0
  50. data/spec/shell_spec.rb +54 -0
  51. data/spec/spec_helper.rb +4 -0
  52. metadata +60 -49
  53. data/Plans.md +0 -20
  54. data/lib/calatrava/tasks/apache.rb +0 -54
  55. data/lib/calatrava/tasks/build.rb +0 -1
  56. data/lib/calatrava/tasks/configuration.rb +0 -41
  57. data/lib/calatrava/tasks/droid.rb +0 -83
  58. data/lib/calatrava/tasks/ios.rb +0 -73
  59. data/lib/calatrava/tasks/kernel.rb +0 -52
  60. data/lib/calatrava/tasks/shell.rb +0 -17
  61. data/lib/calatrava/tasks/web.rb +0 -87
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+
3
+ describe Calatrava::AppBuilder do
4
+ include Aruba::Api
5
+
6
+ before(:each) do
7
+ create_dir 'app'
8
+
9
+ proj = double('current project', :config => double('cfg', :path => 'env.coffee'))
10
+ Calatrava::Project.stub(:current).and_return(proj)
11
+ end
12
+
13
+ let(:manifest) { double('web mf',
14
+ :coffee_files => ['path/to/kernel.coffee', 'diff/path/shell.coffee'],
15
+ :kernel_bootstrap => ['path/to/kernel.coffee'],
16
+ :haml_files => ['diff/path/shell.haml']) }
17
+
18
+ let(:app) { Calatrava::AppBuilder.new('app/build', manifest) }
19
+
20
+ context '#coffee_files' do
21
+ subject { app.coffee_files }
22
+
23
+ it { should include 'path/to/kernel.coffee' }
24
+ it { should include 'diff/path/shell.coffee' }
25
+ it { should include 'env.coffee' }
26
+ end
27
+
28
+ context '#js_file' do
29
+ subject { app.js_file('path/to/sample.coffee') }
30
+
31
+ it { should == 'app/build/scripts/sample.js' }
32
+ end
33
+
34
+ context '#load_file' do
35
+ subject { app.load_instructions.lines.to_a }
36
+
37
+ it { should include 'build/scripts/kernel.js' }
38
+ it { should_not include 'build/scripts/shell.js' }
39
+ end
40
+
41
+ context '#haml_files' do
42
+ subject { app.haml_files }
43
+
44
+ it { should include 'diff/path/shell.haml' }
45
+ end
46
+ end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+
3
+ describe Calatrava::Kernel do
4
+ include Aruba::Api
5
+
6
+ before(:each) do
7
+ create_dir 'kernel'
8
+ create_dir 'kernel/app'
9
+ write_file 'kernel/app/support.coffee', ''
10
+
11
+ create_dir 'kernel/app/mod1'
12
+ write_file 'kernel/app/mod1/first.coffee', ''
13
+
14
+ create_dir 'kernel/plugins'
15
+ write_file 'kernel/plugins/plugin.one.coffee', ''
16
+ write_file 'kernel/plugins/two.coffee', ''
17
+ end
18
+
19
+ let(:kernel) { Calatrava::Kernel.new(current_dir) }
20
+
21
+ context '#features' do
22
+ subject { kernel.features }
23
+
24
+ it { should have(1).features }
25
+
26
+ context 'a single feature' do
27
+ subject { kernel.features[0] }
28
+
29
+ it { should include :name => 'mod1' }
30
+ it { should include :coffee => ['kernel/app/mod1/first.coffee'] }
31
+ end
32
+ end
33
+
34
+ context '#coffee_files' do
35
+ subject { kernel.coffee_files }
36
+
37
+ it { should have(3).files }
38
+ it { should include 'kernel/app/support.coffee' }
39
+ it { should include 'kernel/plugins/plugin.one.coffee' }
40
+ it { should include 'kernel/plugins/two.coffee' }
41
+ end
42
+
43
+ context '#coffee_path' do
44
+ subject { kernel.coffee_path }
45
+
46
+ it { should include 'app:' }
47
+ it { should include 'app/mod1' }
48
+ it { should include 'app/plugins' }
49
+ end
50
+
51
+ end
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+ require 'yaml'
3
+
4
+ describe Calatrava::Manifest do
5
+ include Aruba::Api
6
+
7
+ before(:each) do
8
+ create_dir 'app'
9
+ write_file 'app/manifest.yml', ['included'].to_yaml
10
+ end
11
+
12
+ let(:features) { }
13
+ let(:kernel) { double('kernel',
14
+ :coffee_files => ['kernel_everywhere'],
15
+ :features => [{:name => 'included', :coffee => 'k_inc', :haml => 'inc'},
16
+ {:name => 'excluded', :coffee => 'k_exc', :haml => 'exc'}]) }
17
+ let(:shell) { double('shell',
18
+ :coffee_files => ['shell_everywhere'],
19
+ :haml_files => ['fragment'],
20
+ :css_files => ['styles'],
21
+ :features => [{:name => 'included', :coffee => 'shell_inc', :haml => 'inc'},
22
+ {:name => 'excluded', :coffee => 'shell_exc', :haml => 'exc'}]) }
23
+ let(:manifest) { Calatrava::Manifest.new(current_dir, 'app', kernel, shell) }
24
+
25
+ context 'coffee files' do
26
+ subject { manifest.coffee_files }
27
+
28
+ it { should include 'kernel_everywhere' }
29
+ it { should include 'shell_everywhere' }
30
+
31
+ it { should include 'k_inc' }
32
+ it { should_not include 'k_exc' }
33
+ it { should include 'shell_inc' }
34
+ it { should_not include 'shell_exc' }
35
+ end
36
+
37
+ context 'haml files' do
38
+ subject { manifest.haml_files }
39
+
40
+ it { should include 'fragment' }
41
+ it { should include 'inc' }
42
+ it { should_not include 'exc' }
43
+ end
44
+
45
+ context '#css_files' do
46
+ subject { manifest.css_files }
47
+
48
+ it { should include 'styles' }
49
+ end
50
+
51
+ context '#kernel_bootstrap' do
52
+ subject { manifest.kernel_bootstrap }
53
+
54
+ it { should include 'k_inc' }
55
+ it { should include 'kernel_everywhere' }
56
+
57
+ it { should_not include 'k_exc' }
58
+ it { should_not include 'shell_everywhere' }
59
+ it { should_not include 'shell_inc' }
60
+ end
61
+
62
+ end
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe Calatrava::MobileWebApp do
4
+ include Aruba::Api
5
+
6
+ before(:each) do
7
+ create_dir 'web'
8
+ create_dir 'web/app/source'
9
+ write_file 'web/app/source/support.coffee', ''
10
+
11
+ proj = double('current project', :config => double('cfg', :path => 'env.coffee'))
12
+ Calatrava::Project.stub(:current).and_return(proj)
13
+ end
14
+
15
+ let(:manifest) { double('web mf',
16
+ :coffee_files => ['path/to/kernel.coffee', 'diff/path/shell.coffee'],
17
+ :haml_files => ['diff/path/shell.haml']) }
18
+
19
+ let(:mobile_web) { Calatrava::MobileWebApp.new(current_dir, manifest) }
20
+
21
+ it 'should define the correct output directories' do
22
+ mobile_web.build_dir.should match %r{web/public$}
23
+ mobile_web.scripts_build_dir.should match %r{web/public/scripts$}
24
+ end
25
+
26
+ context '#coffee_files' do
27
+ subject { mobile_web.coffee_files }
28
+
29
+ it { should include 'path/to/kernel.coffee' }
30
+ it { should include 'diff/path/shell.coffee' }
31
+ it { should include 'web/app/source/support.coffee' }
32
+ it { should include 'env.coffee' }
33
+ end
34
+
35
+ context '#scripts' do
36
+ subject { mobile_web.scripts }
37
+
38
+ it { should include 'scripts/kernel.js' }
39
+ it { should include 'scripts/shell.js' }
40
+ it { should include 'scripts/support.js' }
41
+ end
42
+
43
+ context '#haml_files' do
44
+ subject { mobile_web.haml_files }
45
+
46
+ it { should include 'diff/path/shell.haml' }
47
+ end
48
+
49
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe Calatrava::Shell do
4
+ include Aruba::Api
5
+
6
+ let(:shell) { Calatrava::Shell.new(current_dir) }
7
+
8
+ before(:each) do
9
+ create_dir 'shell/support'
10
+ write_file 'shell/support/shell.coffee', ''
11
+ write_file 'shell/support/fragment.haml', ''
12
+ create_dir 'shell/pages/example'
13
+ write_file 'shell/pages/example/page.coffee', ''
14
+ write_file 'shell/pages/example/page.haml', ''
15
+
16
+ create_dir 'shell/stylesheets'
17
+ write_file 'shell/stylesheets/shell.css', ''
18
+ write_file 'shell/stylesheets/template.sass', ''
19
+ end
20
+
21
+ context 'coffee files' do
22
+ subject { shell.coffee_files }
23
+
24
+ it { should include 'shell/support/shell.coffee' }
25
+ end
26
+
27
+ context 'haml files' do
28
+ subject { shell.haml_files }
29
+
30
+ it { should include 'shell/support/fragment.haml' }
31
+ end
32
+
33
+ context 'css files' do
34
+ subject { shell.css_files }
35
+
36
+ it { should include 'shell/stylesheets/shell.css' }
37
+ it { should include 'shell/stylesheets/template.sass' }
38
+ end
39
+
40
+ context 'features' do
41
+ subject { shell.features }
42
+
43
+ it { should have(1).feature }
44
+
45
+ context 'a single feature' do
46
+ subject { shell.features[0] }
47
+
48
+ it { should include :name => 'example' }
49
+ it { should include :coffee => ['shell/pages/example/page.coffee'] }
50
+ it { should include :haml => ['shell/pages/example/page.haml'] }
51
+ end
52
+ end
53
+
54
+ end
@@ -0,0 +1,4 @@
1
+ $: << File.join(File.dirname(__FILE__), '..', 'lib')
2
+
3
+ require 'aruba/api'
4
+ require 'calatrava'
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.5.0
4
+ version: 0.6.0
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-10-02 00:00:00.000000000 Z
12
+ date: 2012-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70314197260240 !ruby/object:Gem::Requirement
16
+ requirement: &70224599001040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70314197260240
24
+ version_requirements: *70224599001040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: aruba
27
- requirement: &70314197259820 !ruby/object:Gem::Requirement
27
+ requirement: &70224599000620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70314197259820
35
+ version_requirements: *70224599000620
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70314197259400 !ruby/object:Gem::Requirement
38
+ requirement: &70224599000200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70314197259400
46
+ version_requirements: *70224599000200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: thor
49
- requirement: &70314197258980 !ruby/object:Gem::Requirement
49
+ requirement: &70224598999780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70314197258980
57
+ version_requirements: *70224598999780
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: haml
60
- requirement: &70314197258560 !ruby/object:Gem::Requirement
60
+ requirement: &70224598999360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70314197258560
68
+ version_requirements: *70224598999360
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sass
71
- requirement: &70314197258140 !ruby/object:Gem::Requirement
71
+ requirement: &70224598998940 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70314197258140
79
+ version_requirements: *70224598998940
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: mustache
82
- requirement: &70314197257720 !ruby/object:Gem::Requirement
82
+ requirement: &70224598998520 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,21 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70314197257720
90
+ version_requirements: *70224598998520
91
91
  - !ruby/object:Gem::Dependency
92
- name: xcoder
93
- requirement: &70314197257300 !ruby/object:Gem::Requirement
94
- none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- type: :runtime
100
- prerelease: false
101
- version_requirements: *70314197257300
102
- - !ruby/object:Gem::Dependency
103
- name: xcodeproj
104
- requirement: &70314197256880 !ruby/object:Gem::Requirement
92
+ name: cucumber
93
+ requirement: &70224598998100 !ruby/object:Gem::Requirement
105
94
  none: false
106
95
  requirements:
107
96
  - - ! '>='
@@ -109,10 +98,10 @@ dependencies:
109
98
  version: '0'
110
99
  type: :runtime
111
100
  prerelease: false
112
- version_requirements: *70314197256880
101
+ version_requirements: *70224598998100
113
102
  - !ruby/object:Gem::Dependency
114
- name: cucumber
115
- requirement: &70314197256460 !ruby/object:Gem::Requirement
103
+ name: watir-webdriver
104
+ requirement: &70224598997680 !ruby/object:Gem::Requirement
116
105
  none: false
117
106
  requirements:
118
107
  - - ! '>='
@@ -120,10 +109,10 @@ dependencies:
120
109
  version: '0'
121
110
  type: :runtime
122
111
  prerelease: false
123
- version_requirements: *70314197256460
112
+ version_requirements: *70224598997680
124
113
  - !ruby/object:Gem::Dependency
125
114
  name: frank-cucumber
126
- requirement: &70314197256040 !ruby/object:Gem::Requirement
115
+ requirement: &70224598997260 !ruby/object:Gem::Requirement
127
116
  none: false
128
117
  requirements:
129
118
  - - ! '>='
@@ -131,10 +120,10 @@ dependencies:
131
120
  version: '0'
132
121
  type: :runtime
133
122
  prerelease: false
134
- version_requirements: *70314197256040
123
+ version_requirements: *70224598997260
135
124
  - !ruby/object:Gem::Dependency
136
- name: watir-webdriver
137
- requirement: &70314197255620 !ruby/object:Gem::Requirement
125
+ name: xcodeproj
126
+ requirement: &70224598996840 !ruby/object:Gem::Requirement
138
127
  none: false
139
128
  requirements:
140
129
  - - ! '>='
@@ -142,10 +131,10 @@ dependencies:
142
131
  version: '0'
143
132
  type: :runtime
144
133
  prerelease: false
145
- version_requirements: *70314197255620
134
+ version_requirements: *70224598996840
146
135
  - !ruby/object:Gem::Dependency
147
136
  name: cocoapods
148
- requirement: &70314197255200 !ruby/object:Gem::Requirement
137
+ requirement: &70224598996420 !ruby/object:Gem::Requirement
149
138
  none: false
150
139
  requirements:
151
140
  - - ! '>='
@@ -153,7 +142,7 @@ dependencies:
153
142
  version: '0'
154
143
  type: :runtime
155
144
  prerelease: false
156
- version_requirements: *70314197255200
145
+ version_requirements: *70224598996420
157
146
  description: A framework to build cross-platform mobile apps with high quality native
158
147
  UIs.
159
148
  email:
@@ -165,9 +154,9 @@ extra_rdoc_files: []
165
154
  files:
166
155
  - .gitignore
167
156
  - .rvmrc
157
+ - CHANGES.markdown
168
158
  - Gemfile
169
159
  - LICENSE.txt
170
- - Plans.md
171
160
  - README.md
172
161
  - Rakefile
173
162
  - bin/calatrava
@@ -180,26 +169,27 @@ files:
180
169
  - features/support/calatrava_app.rb
181
170
  - features/support/env.rb
182
171
  - lib/calatrava.rb
172
+ - lib/calatrava/apache.rb
183
173
  - lib/calatrava/app.rb
174
+ - lib/calatrava/app_builder.rb
175
+ - lib/calatrava/configuration.rb
176
+ - lib/calatrava/droid_app.rb
177
+ - lib/calatrava/ios_app.rb
178
+ - lib/calatrava/kernel.rb
184
179
  - lib/calatrava/manifest.rb
180
+ - lib/calatrava/mobile_web_app.rb
185
181
  - lib/calatrava/project.rb
182
+ - lib/calatrava/project_script.rb
186
183
  - lib/calatrava/resources_build_phase.rb
184
+ - lib/calatrava/shell.rb
187
185
  - lib/calatrava/tasks.rb
188
- - lib/calatrava/tasks/apache.rb
189
186
  - lib/calatrava/tasks/artifact.rb
190
187
  - lib/calatrava/tasks/assets.rb
191
188
  - lib/calatrava/tasks/automation.rb
192
189
  - lib/calatrava/tasks/bootstrap.rb
193
- - lib/calatrava/tasks/build.rb
194
- - lib/calatrava/tasks/configuration.rb
195
- - lib/calatrava/tasks/droid.rb
196
190
  - lib/calatrava/tasks/haml.rb
197
- - lib/calatrava/tasks/ios.rb
198
- - lib/calatrava/tasks/kernel.rb
199
191
  - lib/calatrava/tasks/precommit.rb
200
192
  - lib/calatrava/tasks/release.rb
201
- - lib/calatrava/tasks/shell.rb
202
- - lib/calatrava/tasks/web.rb
203
193
  - lib/calatrava/template.rb
204
194
  - lib/calatrava/templates/.rvmrc.calatrava
205
195
  - lib/calatrava/templates/Gemfile.calatrava
@@ -220,12 +210,19 @@ files:
220
210
  - lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/ConversionForm.java.calatrava
221
211
  - lib/calatrava/templates/droid/calatrava/src/com/CALATRAVA_TMPL/Title.java.calatrava
222
212
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/CalatravaPage.java
213
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/CalatravaPlugin.java
223
214
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AjaxRequestManager.java
215
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AlertPlugin.java
216
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AnnotationRegistrar.java
224
217
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/AssetRepository.java
225
218
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/KernelBridge.java
226
219
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Launcher.java
227
220
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PageRegistry.java
221
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginCommand.java
222
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/PluginRegistry.java
228
223
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredActivity.java
224
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RegisteredPlugin.java
225
+ - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/Registration.java
229
226
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RequestLoader.java
230
227
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/bridge/RhinoService.java
231
228
  - lib/calatrava/templates/droid/calatrava/src/com/calatrava/shell/WebViewActivity.java
@@ -255,6 +252,7 @@ files:
255
252
  - lib/calatrava/templates/kernel/app/pageHelper.coffee
256
253
  - lib/calatrava/templates/kernel/features/support/bridge.coffee
257
254
  - lib/calatrava/templates/kernel/features/support/spec_helper.js
255
+ - lib/calatrava/templates/kernel/plugins/alert.coffee
258
256
  - lib/calatrava/templates/kernel/spec/converter/controller.converter.spec.coffee
259
257
  - lib/calatrava/templates/kernel/spec/environment.spec_helper.coffee
260
258
  - lib/calatrava/templates/kernel/spec/spec_helper.js
@@ -267,12 +265,19 @@ files:
267
265
  - lib/calatrava/templates/shell/stylesheets/shell.scss
268
266
  - lib/calatrava/templates/shell/support/shell.coffee
269
267
  - lib/calatrava/templates/web/apache/conf/mime.types
268
+ - lib/calatrava/templates/web/app/source/alert.web.coffee
270
269
  - lib/calatrava/templates/web/app/source/bridge.coffee
271
270
  - lib/calatrava/templates/web/app/source/init.coffee
272
271
  - lib/calatrava/templates/web/app/views/index.haml
273
272
  - lib/calatrava/templates/web/deploy/instance.sh
274
273
  - lib/calatrava/templates/web/manifest.yml
275
274
  - lib/calatrava/version.rb
275
+ - spec/app_builder_spec.rb
276
+ - spec/kernel_spec.rb
277
+ - spec/manifest_spec.rb
278
+ - spec/mobile_web_app_spec.rb
279
+ - spec/shell_spec.rb
280
+ - spec/spec_helper.rb
276
281
  homepage: http://calatrava.github.com
277
282
  licenses: []
278
283
  post_install_message:
@@ -305,3 +310,9 @@ test_files:
305
310
  - features/step_definitions/template_steps.rb
306
311
  - features/support/calatrava_app.rb
307
312
  - features/support/env.rb
313
+ - spec/app_builder_spec.rb
314
+ - spec/kernel_spec.rb
315
+ - spec/manifest_spec.rb
316
+ - spec/mobile_web_app_spec.rb
317
+ - spec/shell_spec.rb
318
+ - spec/spec_helper.rb
data/Plans.md DELETED
@@ -1,20 +0,0 @@
1
- Calatrava will be a Ruby gem that you use to create projects. Running
2
- `calatrava <app>` will create a directory for a new app.
3
-
4
- This directory will contain the recommended directory tree, and a
5
- Rakefile that uses the Calatrava build tasks.
6
-
7
- The directory tree will contain the following directories:
8
-
9
- * `kernel`: the shared logic re-used across all platforms.
10
- * `shell`: the HTML UI that may be shared across many platforms.
11
- * `ios`: a directory containing an Xcode project for the iOS app.
12
- * `droid`: a directory containing the Android project.
13
- * `web`: a directory containing a single-page JavaScript application
14
- built from the `kernel` and `shell`.
15
- * `features`: a directory to put your cucumber features in.
16
-
17
- The rake tasks will be responsible for building the kernel and shell,
18
- and it's expected that these tasks will be used to build the other
19
- applications.
20
-
@@ -1,54 +0,0 @@
1
- require 'erb'
2
-
3
- directory APACHE_LOGS_DIR
4
-
5
- if `uname -a`.chomp["amzn1"]
6
- HTTPD = "httpd"
7
- MODULES_PATH = "/usr/lib64/httpd/modules"
8
- LOAD_LOG_MODULE = true
9
- elsif `uname`.chomp == "Linux"
10
- HTTPD = "apache2"
11
- MODULES_PATH = "/usr/lib/apache2/modules"
12
- LOAD_LOG_MODULE = false
13
- else
14
- HTTPD = "httpd"
15
- MODULES_PATH = "/usr/libexec/apache2"
16
- LOAD_LOG_MODULE = true
17
- end
18
-
19
- def httpd(command, opts = {})
20
- cmd = %Q{#{HTTPD} -d #{APACHE_DIR} -f conf/httpd.conf -e DEBUG -k #{command} -DNO_DETACH -DFOREGROUND}
21
- puts cmd
22
- if opts[:background]
23
- fork do
24
- exec cmd
25
- end
26
- else
27
- exec cmd
28
- end
29
- end
30
-
31
- def configure_apache
32
- cp config_path("httpd.conf"), File.join(APACHE_DIR, 'conf')
33
- end
34
-
35
- def launch_apache(opts = {})
36
- if !opts[:background]
37
- puts
38
- puts "\t\t" + "*"*40
39
- puts "\t\t" + "*** STARTING APACHE ON PORT 8888 ***"
40
- puts "\t\t" + "*"*40
41
- puts
42
- end
43
-
44
- httpd :start, opts
45
- end
46
-
47
- def stop_apache
48
- httpd 'graceful-stop'
49
- end
50
-
51
- def reload_apache
52
- httpd :restart
53
- end
54
-
@@ -1 +0,0 @@
1
- task :build => ['web:build', 'ios:build', 'droid:build']
@@ -1,41 +0,0 @@
1
- def config_for(environment)
2
- YAML::load(File.open(CONFIG_YAML))[environment]
3
- end
4
-
5
- def evaluate_template(template_path, configuration)
6
- file_path = File.join(CONFIG_RESULT_DIR, File.basename(template_path).gsub(".erb", ''))
7
- puts "Config: #{File.basename(template_path)} -> #{File.basename(file_path)}"
8
- result = ERB.new(IO.read(template_path)).result(binding)
9
- IO.write(file_path, result)
10
- end
11
-
12
- def config_path(file)
13
- env = ENV['CALATRAVA_ENV'] || "development"
14
- puts "CALATRAVA_ENV = '#{env}'"
15
- full_path = artifact_path(File.join(env, file))
16
- fail "Could not find '#{file}' in environment '#{env}'" unless File.exists? full_path
17
- full_path
18
- end
19
-
20
- def app_name
21
- end
22
-
23
- TEMPLATES = FileList["#{CONFIG_TEMPLATE_DIR}/*.erb"]
24
-
25
- namespace :configure do
26
-
27
- %w{local development test automation production}.each do |environment|
28
- desc "Create config files for #{environment} environment"
29
- task environment.to_sym => [:clean, CONFIG_RESULT_DIR] do
30
- configuration = config_for(environment)
31
- TEMPLATES.each do |template|
32
- evaluate_template(template, configuration)
33
- end
34
- artifact_dir(CONFIG_RESULT_DIR, environment)
35
- end
36
- end
37
-
38
- task :clean do
39
- rm_rf CONFIG_RESULT_DIR
40
- end
41
- end