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/.gitignore CHANGED
@@ -1,9 +1,9 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
4
3
  pkg/*
5
4
  .DS_Store
6
5
  /lib/calatrava/templates/ios/App/App.xcodeproj/project.xcworkspace/xcuserdata/*
7
6
  tmp/*
8
7
  test/*
9
8
  currencyConverter/*
9
+ /.rake
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ calatrava
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p392
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm: 1.9.3
3
+ script:
4
+ - bundle exec rake test:rspec test:features:travis
data/CHANGES.markdown CHANGED
@@ -1,3 +1,50 @@
1
+ ## v0.6.4
2
+
3
+ New features:
4
+ * All app types are now optional: disable app types with `--no-web`,
5
+ `--no-droid` and `--no-ios` when creating your Calatrava project.
6
+ * You can specify the Android API version when creating a project with
7
+ `--android-api <version>`. It currently defaults to API 17.
8
+
9
+ Minor improvements:
10
+ * The `stubView` for stubbing pages when testing controllers now
11
+ provides more direct access to the last render view message.
12
+ * Android dependencies are resolved during bootstrap, and then
13
+ externally to the `ant` build to avoid `CLASSPATH` issues.
14
+ * Fail the build if a CoffeeScript file fails to compile.
15
+
16
+ Bugs fixed:
17
+ * [Issue #28][i28]: Support Linux for creating projects and running
18
+ the build.
19
+ * [Issue #35][i35]: Allow app specific environment keys.
20
+ * [Issue #31][i31]: Working with image assets will break the
21
+ web:apache:start task. Now creates the `images` output directory as
22
+ required.
23
+ * [Issue #26][i26]: Empty JS strings passed to JS functions are not
24
+ escaped properly.
25
+ * [iOS Issue #3][ios-i3]: Prevent app from crashing when invoking
26
+ plugin callback.
27
+ * [Issue #34][i34]: [web] Custom headers are not propagated to the
28
+ ajax request.
29
+ * [Issue #32][i32]: calatrava.bridge.request() seems to require an
30
+ optional "body" under iOS. One of `contentType` or `customHeaders`
31
+ was also required, this too has been fixed.
32
+ * [Issue #39][i39]: [ios] Network activity spinner
33
+ * [Issue #40][i40]: calatrava.bridge.request() seems to require a
34
+ "failure" callback in the browser, although documented as "optional"
35
+ * [Issue #42][i42]: Fixes the MobileWeb app loading issue. Pages were
36
+ hidden by default, but the `show` and `hide` implementations for the
37
+ converter page were incomplete.
38
+ * [Issue #43][i43]: Close the load_file.txt reader after loading
39
+ files, on Android.
40
+ * [iOS Issue #1][ios-i1]: Don't trigger all JS file loads at the same
41
+ time as this can fail to load some files in large sets.
42
+ * [iOS Issue #4][ios-i4]: Calatrava apps should be able to open URLs
43
+ using other apps on iOS.
44
+ * [Issue #25][i25]: Recreate `load_file.txt` during the build, if new
45
+ files have been added. Also will re-copy configuration files if you
46
+ change environments.
47
+
1
48
  ## v0.6.3
2
49
 
3
50
  Bugs fixed:
@@ -52,8 +99,15 @@ Changes that will affect existing projects:
52
99
 
53
100
  ## Contributors:
54
101
  * [Giles Alexander](https://github.com/gga)
102
+ * [Pete Hodgson](https://github.com/moredip)
55
103
  * [Vivek Jain](https://github.com/vivekjain10)
56
104
  * [Renaud Tircher](https://github.com/rtircher)
105
+ * [Marcin Kwiatkowski](https://github.com/marcinkwiatkowski)
106
+ * [Pat Kua](https://github.com/thekua)
107
+ * [Maria Gomez](https://github.com/mariagomez)
108
+ * [Kalyan Akella](https://github.com/KalyanAkella)
109
+ * [Filipe Esperandio](https://github.com/filipesperandio)
110
+ * [Christoph Burgmer](https://github.com/cburgmer)
57
111
 
58
112
  [i5]: https://github.com/calatrava/calatrava/issues/5
59
113
  [i12]: https://github.com/calatrava/calatrava/issues/12
@@ -64,3 +118,16 @@ Changes that will affect existing projects:
64
118
  [i23]: https://github.com/calatrava/calatrava/issues/23
65
119
  [i24]: https://github.com/calatrava/calatrava/issues/24
66
120
  [i25]: https://github.com/calatrava/calatrava/issues/25
121
+ [i28]: https://github.com/calatrava/calatrava/pull/28
122
+ [i35]: https://github.com/calatrava/calatrava/pull/35
123
+ [i31]: https://github.com/calatrava/calatrava/issues/31
124
+ [i26]: https://github.com/calatrava/calatrava/issues/26
125
+ [ios-i3]: https://github.com/calatrava/calatrava-ios/pull/3
126
+ [i34]: https://github.com/calatrava/calatrava/issues/34
127
+ [i32]: https://github.com/calatrava/calatrava/issues/32
128
+ [i39]: https://github.com/calatrava/calatrava/issues/39
129
+ [i40]: https://github.com/calatrava/calatrava/issues/40
130
+ [i42]: https://github.com/calatrava/calatrava/issues/42
131
+ [i43]: https://github.com/calatrava/calatrava/issues/43
132
+ [ios-i1]: https://github.com/calatrava/calatrava-ios/issues/1
133
+ [ios-i4]: https://github.com/calatrava/calatrava-ios/pull/4
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in calatrava.gemspec
4
4
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ calatrava (0.6.4)
5
+ cocoapods (~> 0.16.0)
6
+ cucumber (~> 1.2.1)
7
+ haml (~> 3.1.7)
8
+ mustache (~> 0.99.4)
9
+ rake (>= 0.9.5)
10
+ sass (~> 3.2.3)
11
+ thor (~> 0.16.0)
12
+ watir-webdriver (~> 0.6.1)
13
+ xcodeproj (>= 0.4.0)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activesupport (3.2.13)
19
+ i18n (= 0.6.1)
20
+ multi_json (~> 1.0)
21
+ addressable (2.3.4)
22
+ aruba (0.5.1)
23
+ childprocess (~> 0.3.6)
24
+ cucumber (>= 1.1.1)
25
+ rspec-expectations (>= 2.7.0)
26
+ builder (3.1.4)
27
+ childprocess (0.3.6)
28
+ ffi (~> 1.0, >= 1.0.6)
29
+ cocoapods (0.16.4)
30
+ activesupport (~> 3.2.6)
31
+ colored (~> 1.2)
32
+ escape (~> 0.0.4)
33
+ faraday (~> 0.8.1)
34
+ json (~> 1.7.3)
35
+ octokit (~> 1.7)
36
+ open4 (~> 1.3.0)
37
+ rake (~> 10.0.0)
38
+ xcodeproj (~> 0.5.0)
39
+ colored (1.2)
40
+ cucumber (1.2.1)
41
+ builder (>= 2.1.2)
42
+ diff-lcs (>= 1.1.3)
43
+ gherkin (~> 2.11.0)
44
+ json (>= 1.4.6)
45
+ diff-lcs (1.1.3)
46
+ escape (0.0.4)
47
+ faraday (0.8.7)
48
+ multipart-post (~> 1.1)
49
+ faraday_middleware (0.9.0)
50
+ faraday (>= 0.7.4, < 0.9)
51
+ ffi (1.2.0)
52
+ gherkin (2.11.5)
53
+ json (>= 1.4.6)
54
+ haml (3.1.8)
55
+ hashie (2.0.4)
56
+ i18n (0.6.1)
57
+ json (1.7.5)
58
+ multi_json (1.7.2)
59
+ multipart-post (1.2.0)
60
+ mustache (0.99.4)
61
+ netrc (0.7.7)
62
+ octokit (1.24.0)
63
+ addressable (~> 2.2)
64
+ faraday (~> 0.8)
65
+ faraday_middleware (~> 0.9)
66
+ hashie (~> 2.0)
67
+ multi_json (~> 1.3)
68
+ netrc (~> 0.7.7)
69
+ open4 (1.3.0)
70
+ rake (10.0.4)
71
+ rspec (2.12.0)
72
+ rspec-core (~> 2.12.0)
73
+ rspec-expectations (~> 2.12.0)
74
+ rspec-mocks (~> 2.12.0)
75
+ rspec-core (2.12.0)
76
+ rspec-expectations (2.12.0)
77
+ diff-lcs (~> 1.1.3)
78
+ rspec-mocks (2.12.0)
79
+ rubyzip (0.9.9)
80
+ sass (3.2.8)
81
+ selenium-webdriver (2.32.1)
82
+ childprocess (>= 0.2.5)
83
+ multi_json (~> 1.0)
84
+ rubyzip
85
+ websocket (~> 1.0.4)
86
+ thor (0.16.0)
87
+ watir-webdriver (0.6.3)
88
+ selenium-webdriver (>= 2.18.0)
89
+ websocket (1.0.7)
90
+ xcodeproj (0.5.5)
91
+ activesupport (~> 3.2.13)
92
+ colored (~> 1.2)
93
+
94
+ PLATFORMS
95
+ ruby
96
+
97
+ DEPENDENCIES
98
+ aruba
99
+ calatrava!
100
+ rspec
data/README.md CHANGED
@@ -1,14 +1,18 @@
1
+ [![Build Status](https://travis-ci.org/calatrava/calatrava.png)](https://travis-ci.org/calatrava/calatrava)
2
+
1
3
  # Dependencies
2
4
 
3
5
  It should be as easy to get started with Calatrava as
4
6
  possible. However, there are still a small number of dependencies that
5
7
  need to be installed beforehand.
6
8
 
7
- *Note*: Currently, Calatrava only supports development on Macs. this
8
- will probably always be the case for iOS apps, but there are plans to
9
- at least support Linux for Android and Mobile Web. Windows is a
9
+ *Note*: Currently, Calatrava only supports fully-featured development
10
+ on Macs. This will probably always be the case for iOS apps. Linux
11
+ support for Android and Mobile Web is in progress. Windows is a
10
12
  little further off. Pull requests welcomed.
11
13
 
14
+ ## Mac dependencies
15
+
12
16
  1. [rvm](http://rvm.io). Calatrava projects are configured to use
13
17
  `rvm` by default. You could use Calatrava without it, but you will
14
18
  then need to make sure you have Ruby 1.9.3 installed however you
@@ -32,6 +36,37 @@ need to be installed beforehand.
32
36
  5. [Node.js](http://nodejs.org/). Only used to run tests, not part of
33
37
  any production code. Again, if you're on a Mac I recommend
34
38
  installing using homebrew.
39
+
40
+ ## Linux
41
+
42
+ *Note:* Support for Linux is limited to running the Android and Mobile
43
+ Web builds. Please note the following restrictions:
44
+
45
+ * If you generate a new project using calatrava, the iOS part will not
46
+ be generated.
47
+ * Only the `web:\*` and `droid:\*` and `kernel:\*` tasks will work.
48
+
49
+ Here are the dependencies for Linux:
50
+
51
+ 1. [rvm](http://rvm.io). Calatrava projects are configured to use
52
+ `rvm` by default. You could use Calatrava without it, but you will
53
+ then need to make sure you have Ruby 1.9.3 installed however you
54
+ prefer.
55
+
56
+ 2. [bundler](http://gembundler.com/). Install in either your `rvm`
57
+ global gemset, or wherever else makes sense for your setup.
58
+
59
+ 4. [Android SDK](http://developer.android.com/sdk/index.html) &mdash;
60
+ the `android` command is expected to be on the path.
61
+
62
+ 5. [Node.js](http://nodejs.org/) and [NPM](https://npmjs.org/). Only
63
+ used to run tests, not part of any production code.
64
+
65
+ 6. [Apache2](http://httpd.apache.org/). Used for hosting the mobile
66
+ web versions. Some flavours of Linux will not come with this
67
+ shipped. On Ubuntu systems, this can be installed with the
68
+ following command: `sudo apt-get install apache2` (from
69
+ [this page](https://help.ubuntu.com/10.04/serverguide/httpd.html))
35
70
 
36
71
  # Getting Started
37
72
 
@@ -76,3 +111,4 @@ mobile app.
76
111
  The `--dev` switch will create a new project that refers to the
77
112
  `calatrava` gem as a path on disk. This is much more convenient if
78
113
  you're experimenting with Calatrava, or working on it.
114
+
data/Rakefile CHANGED
@@ -16,6 +16,10 @@ namespace :test do
16
16
  Cucumber::Rake::Task.new(:wip) do |t|
17
17
  t.cucumber_opts = "features --format pretty --tags @wip --wip"
18
18
  end
19
+
20
+ Cucumber::Rake::Task.new(:travis) do |t|
21
+ t.cucumber_opts = "features --format pretty --tags @travis"
22
+ end
19
23
  end
20
24
  end
21
25
 
data/Vagrantfile ADDED
@@ -0,0 +1,106 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure("2") do |config|
5
+ config.vm.box = "quantal64"
6
+
7
+ # The url from where the 'config.vm.box' box will be fetched if it
8
+ # doesn't already exist on the user's system.
9
+ config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-amd64-vagrant-disk1.box"
10
+
11
+ # Create a forwarded port mapping which allows access to a specific port
12
+ # within the machine from a port on the host machine. In the example below,
13
+ # accessing "localhost:8080" will access port 80 on the guest machine.
14
+ # config.vm.network :forwarded_port, guest: 80, host: 8080
15
+
16
+ # Create a private network, which allows host-only access to the machine
17
+ # using a specific IP.
18
+ # config.vm.network :private_network, ip: "192.168.33.10"
19
+
20
+ # Create a public network, which generally matched to bridged network.
21
+ # Bridged networks make the machine appear as another physical device on
22
+ # your network.
23
+ # config.vm.network :public_network
24
+
25
+ # Share an additional folder to the guest VM. The first argument is
26
+ # the path on the host to the actual folder. The second argument is
27
+ # the path on the guest to mount the folder. And the optional third
28
+ # argument is a set of non-required options.
29
+ # config.vm.synced_folder "../data", "/vagrant_data"
30
+
31
+ # Provider-specific configuration so you can fine-tune various
32
+ # backing providers for Vagrant. These expose provider-specific options.
33
+ # Example for VirtualBox:
34
+ #
35
+ # config.vm.provider :virtualbox do |vb|
36
+ # # Don't boot with headless mode
37
+ # vb.gui = true
38
+ #
39
+ # # Use VBoxManage to customize the VM. For example to change memory:
40
+ # vb.customize ["modifyvm", :id, "--memory", "1024"]
41
+ # end
42
+ #
43
+ # View the documentation for the provider you're using for more
44
+ # information on available options.
45
+
46
+ # Enable provisioning with Puppet stand alone. Puppet manifests
47
+ # are contained in a directory path relative to this Vagrantfile.
48
+ # You will need to create the manifests directory and a manifest in
49
+ # the file base.pp in the manifests_path directory.
50
+ #
51
+ # An example Puppet manifest to provision the message of the day:
52
+ #
53
+ # # group { "puppet":
54
+ # # ensure => "present",
55
+ # # }
56
+ # #
57
+ # # File { owner => 0, group => 0, mode => 0644 }
58
+ # #
59
+ # # file { '/etc/motd':
60
+ # # content => "Welcome to your Vagrant-built virtual machine!
61
+ # # Managed by Puppet.\n"
62
+ # # }
63
+ #
64
+ # config.vm.provision :puppet do |puppet|
65
+ # puppet.manifests_path = "manifests"
66
+ # puppet.manifest_file = "init.pp"
67
+ # end
68
+
69
+ # Enable provisioning with chef solo, specifying a cookbooks path, roles
70
+ # path, and data_bags path (all relative to this Vagrantfile), and adding
71
+ # some recipes and/or roles.
72
+ #
73
+ # config.vm.provision :chef_solo do |chef|
74
+ # chef.cookbooks_path = "../my-recipes/cookbooks"
75
+ # chef.roles_path = "../my-recipes/roles"
76
+ # chef.data_bags_path = "../my-recipes/data_bags"
77
+ # chef.add_recipe "mysql"
78
+ # chef.add_role "web"
79
+ #
80
+ # # You may also specify custom JSON attributes:
81
+ # chef.json = { :mysql_password => "foo" }
82
+ # end
83
+
84
+ # Enable provisioning with chef server, specifying the chef server URL,
85
+ # and the path to the validation key (relative to this Vagrantfile).
86
+ #
87
+ # The Opscode Platform uses HTTPS. Substitute your organization for
88
+ # ORGNAME in the URL and validation key.
89
+ #
90
+ # If you have your own Chef Server, use the appropriate URL, which may be
91
+ # HTTP instead of HTTPS depending on your configuration. Also change the
92
+ # validation key to validation.pem.
93
+ #
94
+ # config.vm.provision :chef_client do |chef|
95
+ # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
96
+ # chef.validation_key_path = "ORGNAME-validator.pem"
97
+ # end
98
+ #
99
+ # If you're using the Opscode platform, your validator client is
100
+ # ORGNAME-validator, replacing ORGNAME with your organization name.
101
+ #
102
+ # If you have your own Chef Server, the default validation client name is
103
+ # chef-validator, unless you changed the configuration.
104
+ #
105
+ # chef.validation_client_name = "ORGNAME-validator"
106
+ end
data/calatrava.gemspec CHANGED
@@ -1,6 +1,7 @@
1
- # -*- encoding: utf-8 -*-
1
+ # -*- encoding: utf-8; mode: ruby -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
  require "calatrava/version"
4
+ require "calatrava/platform"
4
5
 
5
6
  Gem::Specification.new do |s|
6
7
  s.name = "calatrava"
@@ -21,13 +22,17 @@ Gem::Specification.new do |s|
21
22
  s.add_development_dependency "rspec"
22
23
  s.add_development_dependency "aruba"
23
24
 
24
- s.add_runtime_dependency "rake", "~> 0.9.5"
25
+ s.add_runtime_dependency "rake", ">= 0.9.5"
26
+
25
27
  s.add_runtime_dependency "thor", "~> 0.16.0"
26
28
  s.add_runtime_dependency "haml", "~> 3.1.7"
27
29
  s.add_runtime_dependency "sass", "~> 3.2.3"
28
30
  s.add_runtime_dependency "mustache", "~> 0.99.4"
29
31
  s.add_runtime_dependency "cucumber", "~> 1.2.1"
30
32
  s.add_runtime_dependency "watir-webdriver", "~> 0.6.1"
31
- s.add_runtime_dependency "xcodeproj", "~> 0.4.0"
32
- s.add_runtime_dependency "cocoapods", "~> 0.16.0"
33
+
34
+ if Calatrava.platform == :mac
35
+ s.add_runtime_dependency "xcodeproj", ">= 0.4.0"
36
+ s.add_runtime_dependency "cocoapods", "~> 0.16.0"
37
+ end
33
38
  end
data/features/cli.feature CHANGED
@@ -12,3 +12,12 @@ Feature: Command line interface
12
12
  Given an empty file named "alt-template-file"
13
13
  When I run `calatrava create project --template alt-template-file`
14
14
  Then the output should contain "template must be a directory"
15
+
16
+ Scenario: Android command-line parameters
17
+ When I run `calatrava create droid_test --android-api 17`
18
+ Then the exit status should be 0
19
+ And a file named "droid_test/droid/droid_test/project.properties" should exist
20
+ And the file "droid_test/droid/droid_test/project.properties" should contain:
21
+ """
22
+ target=android-17
23
+ """
@@ -11,13 +11,24 @@ Feature: Projects
11
11
  | simple |
12
12
  | simple/config |
13
13
  | simple/droid |
14
- | simple/features |
15
14
  | simple/ios |
16
15
  | simple/kernel |
17
16
  | simple/shell |
18
17
  | simple/web |
19
18
  And the file "simple/calatrava.yml" should contain "project_name: simple"
20
19
 
20
+ Scenario Outline: Should allow app types to be excluded
21
+ When I run `calatrava create simple --no-<app>`
22
+ Then the exit status should be 0
23
+ And a directory named "simple/<app>" should not exist
24
+
25
+ Examples:
26
+ | app |
27
+ | ios |
28
+ | droid |
29
+ | web |
30
+
31
+ @travis
21
32
  Scenario: Templates can have deeply nested directories and files
22
33
  Given the following directories exist:
23
34
  | nested |
@@ -27,7 +38,7 @@ Feature: Projects
27
38
  | nested/sample |
28
39
  | nested/.config |
29
40
  | nested/dir/sub/sample2 |
30
- When I run `calatrava create proj --template nested`
41
+ When I run `calatrava create proj --template nested --no-droid --no-ios`
31
42
  Then the following directories should exist:
32
43
  | proj |
33
44
  | proj/dir |
@@ -37,12 +48,13 @@ Feature: Projects
37
48
  | proj/.config |
38
49
  | proj/dir/sub/sample2 |
39
50
 
51
+ @travis
40
52
  Scenario: Template files can themselves be templates
41
53
  Given a directory named "template"
42
54
  And a file named "template/.tmpl.calatrava" with:
43
55
  """
44
56
  Sample {{ project_name }}
45
57
  """
46
- When I run `calatrava create templatized --template template`
58
+ When I run `calatrava create templatized --template template --no-droid --no-ios`
47
59
  Then a file named "templatized/.tmpl" should exist
48
60
  And the file "templatized/.tmpl" should contain "Sample templatized"
@@ -4,6 +4,7 @@ Feature: Sample App
4
4
  As a new calatrava user
5
5
  I want a new Calatrava project to contain a working sample app
6
6
 
7
+ @travis
7
8
  Scenario: Create a sample project
8
9
  When I create an app named "sample"
9
10
  And I cd to "sample"
@@ -11,6 +12,7 @@ Feature: Sample App
11
12
  And I run `rake bootstrap`
12
13
  Then the exit status should be 0
13
14
 
15
+ @travis
14
16
  Scenario: Sample app kernel
15
17
  When I create an app named "sample"
16
18
  And I cd to "sample"
@@ -19,9 +21,11 @@ Feature: Sample App
19
21
  And I run `rake kernel:spec`
20
22
  Then the exit status should be 0
21
23
 
24
+ @travis
22
25
  Scenario: Mobile web sample app
23
26
  When I create an app named "sample"
24
27
  And I cd to "sample"
25
28
  And I run `bundle install`
26
29
  And I run `rake bootstrap`
27
- And I start apache
30
+ And I run `rake web:build`
31
+ Then the exit status should be 0
@@ -7,7 +7,7 @@ class CalatravaApp
7
7
 
8
8
  def initialize(name)
9
9
  @name = name
10
- run_simple("calatrava create #{@name}")
10
+ run_simple("calatrava create #{@name} --no-droid --no-ios")
11
11
  end
12
12
 
13
13
  def start_apache
@@ -5,7 +5,7 @@ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File:
5
5
  ENV['RUBYLIB'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../lib')}#{File::PATH_SEPARATOR}#{ENV['RUBYLIB']}"
6
6
 
7
7
  Before do
8
- @aruba_timeout_seconds = 20
8
+ @aruba_timeout_seconds = 80
9
9
  end
10
10
 
11
11
  class CalatravaWorld
@@ -18,21 +18,10 @@ module Calatrava
18
18
  end
19
19
  end
20
20
 
21
- def apache_dir
22
- "web/apache"
23
- end
24
-
25
- def apache_public_dir
26
- "#{apache_dir}/public"
27
- end
28
-
29
- def apache_logs_dir
30
- "#{apache_dir}/logs"
31
- end
32
-
33
- def apache_conf_dir
34
- "#{apache_dir}/conf"
35
- end
21
+ def apache_dir ; "web/apache" ; end
22
+ def apache_public_dir ; "#{apache_dir}/public" ; end
23
+ def apache_logs_dir ; "#{apache_dir}/logs" ; end
24
+ def apache_conf_dir ; "#{apache_dir}/conf"; end
36
25
 
37
26
  def httpd(command, opts = {})
38
27
  ensure_httpd
@@ -47,19 +36,7 @@ module Calatrava
47
36
  end
48
37
  end
49
38
 
50
- def configure_apache
51
- cp Calatrava::Project.current.config.path("httpd.conf"), apache_conf_dir
52
- end
53
-
54
39
  def launch_apache(opts = {})
55
- if !opts[:background]
56
- puts
57
- puts "\t\t" + "*"*40
58
- puts "\t\t" + "*** STARTING APACHE ON PORT 8888 ***"
59
- puts "\t\t" + "*"*40
60
- puts
61
- end
62
-
63
40
  httpd :start, opts
64
41
  end
65
42
 
@@ -93,14 +70,16 @@ module Calatrava
93
70
  end
94
71
  end
95
72
 
73
+ file "#{apache_conf_dir}/httpd.conf" => 'configure:calatrava_env' do
74
+ cp Calatrava::Project.current.config.path("httpd.conf"), apache_conf_dir
75
+ end
76
+
96
77
  desc "launch a non-daemon apache instance on port 8888 which will serve our local app and also proxy to backend services"
97
- task :start => ['web:build', apache_public_dir, apache_logs_dir] do
98
- configure_apache
78
+ task :start => ['web:build', apache_public_dir, apache_logs_dir, "#{apache_conf_dir}/httpd.conf"] do
99
79
  launch_apache
100
80
  end
101
81
 
102
- task :background => ['web:build', apache_public_dir, apache_logs_dir] do
103
- configure_apache
82
+ task :background => ['web:build', apache_public_dir, apache_logs_dir, "#{apache_conf_dir}/httpd.conf"] do
104
83
  launch_apache :background => true
105
84
  end
106
85
 
data/lib/calatrava/app.rb CHANGED
@@ -5,13 +5,17 @@ module Calatrava
5
5
  class App < Thor
6
6
 
7
7
  desc "create <project-name>", "creates a new calatrava app project"
8
- method_options :template => File.join(File.dirname(__FILE__), 'templates'), :dev => false
8
+ method_options :template => File.join(File.dirname(__FILE__), 'templates'),
9
+ :dev => false,
10
+ :'no-ios' => false,
11
+ :'no-droid' => false,
12
+ :'no-web' => false,
13
+ :'android-api' => '17'
9
14
  def create(project_name)
10
15
  die "template must exist" unless File.exist?(options[:template])
11
16
  die "template must be a directory" unless File.directory?(options[:template])
12
17
 
13
- proj = ProjectScript.new(project_name,
14
- :is_dev => options.dev?)
18
+ proj = ProjectScript.new(project_name, options)
15
19
  proj.create(Template.new(options[:template]))
16
20
  end
17
21