Explorar o código

changed Gruntfile and deploy.js to match file name

hhzl %!s(int64=10) %!d(string=hai) anos
pai
achega
4293174b1a

+ 2 - 24
processing/Gruntfile.js

@@ -11,7 +11,6 @@ module.exports = function (grunt) {
 
     // Default task.
     grunt.registerTask('default', ['amberc:all']);
-    grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner', 'clean:test_runner']);
     grunt.registerTask('devel', ['amdconfig:app', 'requirejs:devel']);
     grunt.registerTask('deploy', ['amdconfig:app', 'requirejs:deploy']);
 
@@ -33,22 +32,10 @@ module.exports = function (grunt) {
             },
             all: {
                 src: [
-                    'src/ProcessingClock.st', // list all sources in dependency order
-                    'src/ProcessingClock-Tests.st' // list all tests in dependency order
+                    'src/Processing-Examples.st' // list all sources in dependency order
                 ],
                 amd_namespace: 'amber-processingclock',
                 libraries: ['SUnit', 'Web']
-            },
-            test_runner: {
-                src: ['node_modules/amber-dev/lib/Test.st'],
-                libraries: [
-                    /* add dependencies packages here */
-                    'ProcessingClock', /* add other code-to-test packages here */
-                    'SUnit',
-                    'ProcessingClock-Tests' /* add other test packages here */
-                ],
-                main_class: 'NodeTestRunner',
-                output_name: 'test_runner'
             }
         },
 
@@ -75,17 +62,8 @@ module.exports = function (grunt) {
                 include: ['config', 'node_modules/requirejs/require'],
                 out: "the.js"
             }}
-        },
-
-        execute: {
-            test_runner: {
-                src: ['test_runner.js']
-            }
-        },
-
-        clean: {
-            test_runner: ['test_runner.js']
         }
+
     });
 
 };

+ 1 - 1
processing/deploy.js

@@ -1,7 +1,7 @@
 define([
     'amber/deploy',
     // --- packages to be deployed begin here ---
-    'amber-processingclock/ProcessingClock'
+    'amber-processingclock/Processing-Examples'
     // --- packages to be deployed end here ---
 ], function (amber) {
     return amber;

+ 193 - 85
processing/src/Processing-Examples.js

@@ -1,143 +1,216 @@
-define("amber_examples_processing/Processing-Examples", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Processing-Examples');
-smalltalk.packages["Processing-Examples"].transport = {"type":"amd","amdNamespace":"amber_examples_processing"};
+define("amber-processingclock/Processing-Examples", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Processing-Examples');
+$core.packages["Processing-Examples"].transport = {"type":"amd","amdNamespace":"amber-processingclock"};
 
-smalltalk.addClass('ProcessingClock', globals.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
-smalltalk.addMethod(
-smalltalk.method({
+$core.addClass('ProcessingClock', $globals.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
+$core.addMethod(
+$core.method({
 selector: "draw",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
 var drawBlock;
-function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
-return smalltalk.withContext(function($ctx1) { 
+function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
 var $2,$4,$3,$1,$6,$8,$7,$5,$9;
 drawBlock=(function(){
 var now,hoursPosition,minutesPosition,secondsPosition;
-return smalltalk.withContext(function($ctx2) {
-_st(self["@processing"])._background_((224));
-now=_st($Date())._new();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$recv(self["@processing"])._background_((224));
+now=$recv($Date())._new();
 now;
-$2=_st(_st(now)._hours()).__backslash_backslash((12));
-$4=_st(now)._minutes();
+$2=$recv($recv(now)._hours()).__backslash_backslash((12));
+$4=$recv(now)._minutes();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["minutes"]=1;
-$3=_st($4).__slash((60));
+//>>excludeEnd("ctx");
+$3=$recv($4).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["/"]=2;
-$1=_st($2).__plus($3);
+//>>excludeEnd("ctx");
+$1=$recv($2).__plus($3);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["+"]=1;
-hoursPosition=_st($1).__slash((12));
+//>>excludeEnd("ctx");
+hoursPosition=$recv($1).__slash((12));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["/"]=1;
+//>>excludeEnd("ctx");
 hoursPosition;
 self._drawArm_lengthScale_weight_(hoursPosition,(0.5),(5));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["drawArm:lengthScale:weight:"]=1;
-$6=_st(now)._minutes();
-$8=_st(now)._seconds();
+//>>excludeEnd("ctx");
+$6=$recv(now)._minutes();
+$8=$recv(now)._seconds();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["seconds"]=1;
-$7=_st($8).__slash((60));
+//>>excludeEnd("ctx");
+$7=$recv($8).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["/"]=4;
-$5=_st($6).__plus($7);
-minutesPosition=_st($5).__slash((60));
+//>>excludeEnd("ctx");
+$5=$recv($6).__plus($7);
+minutesPosition=$recv($5).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["/"]=3;
+//>>excludeEnd("ctx");
 minutesPosition;
 self._drawArm_lengthScale_weight_(minutesPosition,(0.8),(3));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["drawArm:lengthScale:weight:"]=2;
-secondsPosition=_st(_st(now)._seconds()).__slash((60));
+//>>excludeEnd("ctx");
+secondsPosition=$recv($recv(now)._seconds()).__slash((60));
 secondsPosition;
 return self._drawArm_lengthScale_weight_(secondsPosition,(0.9),(1));
-}, function($ctx2) {$ctx2.fillBlock({now:now,hoursPosition:hoursPosition,minutesPosition:minutesPosition,secondsPosition:secondsPosition},$ctx1,1)})});
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({now:now,hoursPosition:hoursPosition,minutesPosition:minutesPosition,secondsPosition:secondsPosition},$ctx1,1)});
+//>>excludeEnd("ctx");
+});
 $9=drawBlock;
 return $9;
-}, function($ctx1) {$ctx1.fill(self,"draw",{drawBlock:drawBlock},globals.ProcessingClock)})},
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"draw",{drawBlock:drawBlock},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 source: "draw\x0a| drawBlock |\x0a\x0adrawBlock := [\x0a  | now hoursPosition minutesPosition secondsPosition |  \x0a  processing background: 224.\x0a  \x0a  now := Date new.\x0a  \x0a  \x22Moving hours arm by small increments\x22\x0a   hoursPosition := ((now hours \x5c\x5c 12) + (now minutes / 60 )) /12 .\x0a   self drawArm: hoursPosition lengthScale: 0.5 weight: 5.\x0a   \x0a   \x22Moving minutes arm by small increments\x22\x0a    minutesPosition := (now minutes + (now seconds / 60))/60.\x0a    self drawArm: minutesPosition lengthScale: 0.80 weight: 3.\x0a\x0a    \x22Moving hour arm by second increments\x22\x0a    secondsPosition := now seconds / 60.\x0a    self drawArm: secondsPosition lengthScale: 0.90 weight: 1.\x0a  ].\x0a\x0a^drawBlock",
-messageSends: ["background:", "new", "/", "+", "\x5c\x5c", "hours", "minutes", "drawArm:lengthScale:weight:", "seconds"],
-referencedClasses: ["Date"]
+referencedClasses: ["Date"],
+//>>excludeEnd("ide");
+messageSends: ["background:", "new", "/", "+", "\x5c\x5c", "hours", "minutes", "drawArm:lengthScale:weight:", "seconds"]
 }),
-globals.ProcessingClock);
+$globals.ProcessingClock);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "drawArm:lengthScale:weight:",
 protocol: 'not yet classified',
 fn: function (aPosition,aLengthScale,aWeight){
 var self=this;
 var myDX,myDY;
-function $Math(){return globals.Math||(typeof Math=="undefined"?nil:Math)}
-return smalltalk.withContext(function($ctx1) { 
+function $Math(){return $globals.Math||(typeof Math=="undefined"?nil:Math)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
 var $1,$6,$7,$5,$4,$3,$2,$8,$12,$11,$10,$9;
-_st(self["@processing"])._strokeWeight_(aWeight);
+$recv(self["@processing"])._strokeWeight_(aWeight);
 $1=self["@centerX"];
-$6=_st(aPosition).__star((2));
+$6=$recv(aPosition).__star((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=4;
-$7=_st($Math())._PI();
+//>>excludeEnd("ctx");
+$7=$recv($Math())._PI();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["PI"]=1;
-$5=_st($6).__star($7);
+//>>excludeEnd("ctx");
+$5=$recv($6).__star($7);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=3;
-$4=_st($Math())._sin_($5);
-$3=_st($4).__star(aLengthScale);
+//>>excludeEnd("ctx");
+$4=$recv($Math())._sin_($5);
+$3=$recv($4).__star(aLengthScale);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=2;
-$2=_st($3).__star(self["@maxArmLength"]);
+//>>excludeEnd("ctx");
+$2=$recv($3).__star(self["@maxArmLength"]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=1;
-myDX=_st($1).__plus($2);
+//>>excludeEnd("ctx");
+myDX=$recv($1).__plus($2);
 $8=self["@centerY"];
-$12=_st(_st(aPosition).__star((2))).__star(_st($Math())._PI());
+$12=$recv($recv(aPosition).__star((2))).__star($recv($Math())._PI());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=7;
-$11=_st($Math())._cos_($12);
-$10=_st($11).__star(aLengthScale);
+//>>excludeEnd("ctx");
+$11=$recv($Math())._cos_($12);
+$10=$recv($11).__star(aLengthScale);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=6;
-$9=_st($10).__star(self["@maxArmLength"]);
+//>>excludeEnd("ctx");
+$9=$recv($10).__star(self["@maxArmLength"]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=5;
-myDY=_st($8).__minus($9);
-_st(self["@processing"])._line_y_dX_dy_(self["@centerX"],self["@centerY"],myDX,myDY);
-return self}, function($ctx1) {$ctx1.fill(self,"drawArm:lengthScale:weight:",{aPosition:aPosition,aLengthScale:aLengthScale,aWeight:aWeight,myDX:myDX,myDY:myDY},globals.ProcessingClock)})},
+//>>excludeEnd("ctx");
+myDY=$recv($8).__minus($9);
+$recv(self["@processing"])._line_y_dX_dy_(self["@centerX"],self["@centerY"],myDX,myDY);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"drawArm:lengthScale:weight:",{aPosition:aPosition,aLengthScale:aLengthScale,aWeight:aWeight,myDX:myDX,myDY:myDY},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aPosition", "aLengthScale", "aWeight"],
 source: "drawArm: aPosition lengthScale: aLengthScale weight: aWeight\x0a| myDX myDY |\x0aprocessing strokeWeight: aWeight.\x0amyDX := centerX \x0a\x09\x09\x09+ ((Math sin: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0amyDY := centerY \x0a\x09\x09\x09- ((Math cos: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0a\x0aprocessing line: centerX y: centerY dX: myDX dy: myDY.",
-messageSends: ["strokeWeight:", "+", "*", "sin:", "PI", "-", "cos:", "line:y:dX:dy:"],
-referencedClasses: ["Math"]
+referencedClasses: ["Math"],
+//>>excludeEnd("ide");
+messageSends: ["strokeWeight:", "+", "*", "sin:", "PI", "-", "cos:", "line:y:dX:dy:"]
 }),
-globals.ProcessingClock);
+$globals.ProcessingClock);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "firstProcessingInstance",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
 return Processing.instances[0];
-return self}, function($ctx1) {$ctx1.fill(self,"firstProcessingInstance",{},globals.ProcessingClock)})},
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"firstProcessingInstance",{},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 source: "firstProcessingInstance\x0a\x0a\x09<return Processing.instances[0]>",
-messageSends: [],
-referencedClasses: []
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
 }),
-globals.ProcessingClock);
+$globals.ProcessingClock);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
-function $Math(){return globals.Math||(typeof Math=="undefined"?nil:Math)}
-return smalltalk.withContext(function($ctx1) { 
+function $Math(){return $globals.Math||(typeof Math=="undefined"?nil:Math)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
 self["@processing"]=self._firstProcessingInstance();
-self["@centerX"]=_st(_st(self["@processing"])._width()).__slash((2));
+self["@centerX"]=$recv($recv(self["@processing"])._width()).__slash((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["/"]=1;
-self["@centerY"]=_st(_st(self["@processing"])._height()).__slash((2));
-self["@maxArmLength"]=_st($Math())._min_or_(self["@centerX"],self["@centerY"]);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ProcessingClock)})},
+//>>excludeEnd("ctx");
+self["@centerY"]=$recv($recv(self["@processing"])._height()).__slash((2));
+self["@maxArmLength"]=$recv($Math())._min_or_(self["@centerX"],self["@centerY"]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 source: "initialize\x0aprocessing := self firstProcessingInstance.\x0acenterX := processing width / 2.\x0acenterY := processing height / 2.\x0amaxArmLength := Math min: centerX or: centerY.",
-messageSends: ["firstProcessingInstance", "/", "width", "height", "min:or:"],
-referencedClasses: ["Math"]
+referencedClasses: ["Math"],
+//>>excludeEnd("ide");
+messageSends: ["firstProcessingInstance", "/", "width", "height", "min:or:"]
 }),
-globals.ProcessingClock);
+$globals.ProcessingClock);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "processing",
 protocol: 'not yet classified',
 fn: function (){
@@ -145,34 +218,69 @@ var self=this;
 var $1;
 $1=self["@processing"];
 return $1;
+
 },
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 source: "processing\x0a^processing",
-messageSends: [],
-referencedClasses: []
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
 }),
-globals.ProcessingClock);
+$globals.ProcessingClock);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "init",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
 var clock,processing,block;
-function $ProcessingClock(){return globals.ProcessingClock||(typeof ProcessingClock=="undefined"?nil:ProcessingClock)}
-return smalltalk.withContext(function($ctx1) { 
-clock=_st($ProcessingClock())._new();
-processing=_st(clock)._processing();
-block=_st(clock)._draw();
-_st(processing)._at_put_("draw",block);
-return self}, function($ctx1) {$ctx1.fill(self,"init",{clock:clock,processing:processing,block:block},globals.ProcessingClock.klass)})},
+function $ProcessingClock(){return $globals.ProcessingClock||(typeof ProcessingClock=="undefined"?nil:ProcessingClock)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+clock=$recv($ProcessingClock())._new();
+processing=$recv(clock)._processing();
+block=$recv(clock)._draw();
+$recv(processing)._at_put_("draw",block);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"init",{clock:clock,processing:processing,block:block},$globals.ProcessingClock.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 source: "init\x0a| clock processing block |\x0aclock := ProcessingClock new .\x0aprocessing := clock processing.\x0ablock := clock draw.\x0aprocessing at: 'draw' put: block",
-messageSends: ["new", "processing", "draw", "at:put:"],
-referencedClasses: ["ProcessingClock"]
+referencedClasses: ["ProcessingClock"],
+//>>excludeEnd("ide");
+messageSends: ["new", "processing", "draw", "at:put:"]
+}),
+$globals.ProcessingClock.klass);
+
+$core.addMethod(
+$core.method({
+selector: "start",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+self._init();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"start",{},$globals.ProcessingClock.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "start\x0a\x0a     self init",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["init"]
 }),
-globals.ProcessingClock.klass);
+$globals.ProcessingClock.klass);
 
 });

+ 5 - 0
processing/src/Processing-Examples.st

@@ -67,5 +67,10 @@ clock := ProcessingClock new .
 processing := clock processing.
 block := clock draw.
 processing at: 'draw' put: block
+!
+
+start
+
+     self init
 ! !