Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
Works with SproutCore 1.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
martoche committed Mar 5, 2011
1 parent bc22766 commit 65572c9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 19 deletions.
26 changes: 22 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
Garçon : SproutCore build tools using node.js.
Garçon: SproutCore build tools using node.js

1. Install node.js (http://nodejs.org/, http://github.com/ry/node)

2. Create a configuration file for your application based on the sample sample_server_config.js file
Requirements:

3. Start the server with `node myApp.js`
* node.js
http://nodejs.org/

* SproutCore
gem install sproutcore


Steps:

* Create a new SproutCore application
sproutcore init myapp; cd myapp

* Clone garçon
git clone --recursive git://github.com/martoche/garcon.git

* Clone SproutCore
git clone git://github.com/sproutcore/sproutcore.git frameworks/sproutcore

* Customize the config file if needed, then start garçon
node garcon/sample_server_config.js
15 changes: 11 additions & 4 deletions lib/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ Framework.sproutcoreBootstrap = function(options) {
};

Framework.sproutcoreFrameworks = function(options) {
var opts, key;
var opts, key, frameworks;

if (this._sproutcoreFrameworks === undefined) {
if (this._sproutcoreFrameworks === undefined) {

opts = { combineScripts: true, pathsToExclude: [/fixtures\//] };
for (key in options) {
Expand All @@ -495,10 +495,17 @@ Framework.sproutcoreFrameworks = function(options) {
}
}

this._sproutcoreFrameworks = [this.sproutcoreBootstrap(opts)].concat(['runtime', 'foundation', 'datastore', 'desktop', 'animation'].map(function(framework) {
try { // SproutCore >= 1.5
l.fs.statSync('frameworks/sproutcore/frameworks/jquery');
frameworks = ['jquery', 'runtime', 'handlebars', 'core_foundation', 'datetime', 'foundation', 'datastore', 'desktop'];
} catch (e) { // SproutCore <= 1.4
frameworks = ['runtime', 'foundation', 'datastore', 'desktop', 'animation'];
}

this._sproutcoreFrameworks = [this.sproutcoreBootstrap(opts)].concat(frameworks.map(function(framework) {
opts.path = 'frameworks/sproutcore/frameworks/' + framework;
return new Framework(opts);
}, this));
}));
}

return this._sproutcoreFrameworks;
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Server.prototype.run = function() {
hostname: that.hostname ? that.hostname : 'localhost',
port: that.port
});
l.util.puts('Server started on ' + url);
l.util.puts('Server started on ' + url + '/APPLICATION_NAME');
});

};
10 changes: 5 additions & 5 deletions sample_build_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ myApp.addFrameworks(
// a third party framework
// { path: 'frameworks/calendar' },

// the theme you're using
{ path:'frameworks/sproutcore/themes/standard_theme', combineScripts: true },
// the default 1.4 theme
// { path:'frameworks/sproutcore/themes/standard_theme', combineScripts: true },

// if you're on Quilmes and use Ace, uncomment the next 2 lines instead
// { path:'frameworks/sproutcore/themes/empty_theme', combineScripts: true },
// { path:'frameworks/sproutcore/themes/ace', combineScripts: true },
// or, the default 1.5 theme
{ path:'frameworks/sproutcore/themes/empty_theme', combineScripts: true },
{ path:'frameworks/sproutcore/themes/ace', combineScripts: true },

// finally, the sources for myApp must be added as well
{ path: 'apps/' + myApp.name }
Expand Down
10 changes: 5 additions & 5 deletions sample_server_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ myApp.addFrameworks(
// a third party framework
// { path: 'frameworks/calendar' },

// the theme you're using
{ path:'frameworks/sproutcore/themes/standard_theme', combineScripts: true },
// the default 1.4 theme
// { path:'frameworks/sproutcore/themes/standard_theme', combineScripts: true },

// if you're on Quilmes and use Ace, uncomment the next 2 lines instead
// { path:'frameworks/sproutcore/themes/empty_theme', combineScripts: true },
// { path:'frameworks/sproutcore/themes/ace', combineScripts: true },
// or, the default 1.5 theme
{ path:'frameworks/sproutcore/themes/empty_theme', combineScripts: true },
{ path:'frameworks/sproutcore/themes/ace', combineScripts: true },

// finally, the sources for myApp must be added as well
{ path: 'apps/' + myApp.name }
Expand Down

0 comments on commit 65572c9

Please sign in to comment.