Skip to content

Commit

Permalink
feat(ripple): Pulled in Apache Foundation Incubator ripple-emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
diegonetto committed Mar 27, 2014
1 parent b2c4558 commit c30499e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ If this is your first time using Istanbul, take a look around. It will help you
## Wrapping it up
If you made it this far then congratulations! You're now up and running with the gorgeous Ionic Framework powered by an intelligent workflow and sophisticated build system - all facilitated by the addition of just a few commands!

## Ripple Emulator (Experimental)
**Be Advised**: [Ripple](http://ripple.incubator.apache.org/) is under active development so expect support for some plugins to be missing or broken.

Add a platform target then run `grunt ripple` to launch the emulator in your browser.
```
grunt platform:add:ios
grunt ripple
```

Now go edit a file and then refresh your browser to see your changes. (Currently experimenting with livereload for Ripple)

**Note**: If you get errors beginning with `Error: static() root path required`, don't fret. Ripple defaults the UI to Android so just switch to an iOS device and you'll be good to go.

![Ripple](http://i.imgur.com/LA4Hip1l.png)


## Special Thanks To
* The pioneers behind [Yeoman](http://yeoman.io/) for building an intelligent workflow management solution.
* The [AngularJS Generator](https://github.com/yeoman/generator-angular) and [Ionic Seed Project](https://github.com/driftyco/ionic-angular-cordova-seed) projects for inspiration.
Expand Down
35 changes: 35 additions & 0 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ module.exports = function (grunt) {
cwd: '<%%= yeoman.app %>/vendor',
dest: '.tmp/styles/',
src: '{,*/}*.css'
},
all: {
expand: true,
cwd: '<%%= yeoman.app %>/',
src: '**',
dest: 'www/'
}
},

Expand Down Expand Up @@ -384,6 +390,35 @@ module.exports = function (grunt) {
});
});
// Since Apache Ripple serves assets directly out of their respective platform
// directories, we watch all registered files and then copy all un-built assets
// over to www/. Last step is running ordova prepare so we can refresh the ripple
// browser tab to see the changes.
grunt.registerTask('ripple', ['bower-install', 'copy:all', 'prepare', 'ripple-emulator']);
grunt.registerTask('ripple-emulator', function () {
grunt.config.set('watch', {
all: {
files: _.flatten(_.pluck(grunt.config.get('watch'), 'files')),
tasks: ['copy:all', 'prepare']
}
});

var cmd = path.resolve('./node_modules/ripple-emulator/bin', 'ripple');
var child = spawn(cmd, ['emulate']);
child.stdout.on('data', function (data) {
grunt.log.writeln(data);
});
child.stderr.on('data', function (data) {
grunt.log.error(data);
});
process.on('exit', function (code) {
child.kill('SIGINT');
process.exit(code);
});

return grunt.task.run(['watch']);
});

// Dynamically configure `karma` target of `watch` task so that
// we don't have to run the karma test server as part of `grunt serve`
grunt.registerTask('watch:karma', function () {
Expand Down
3 changes: 2 additions & 1 deletion templates/common/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.1",
"cordova": "~3.4.0-0.1.3",
"lodash": "~2.4.1"
"lodash": "~2.4.1",
"ripple-emulator": "~0.9.20"
},
"engines": {
"node": ">=0.10.0"
Expand Down

0 comments on commit c30499e

Please sign in to comment.