2
0
Bläddra i källkod

FileServer renamed method #normailzePath: to #withBasePath:

Thomas Rake 11 år sedan
förälder
incheckning
ca9201c870
3 ändrade filer med 48 tillägg och 48 borttagningar
  1. 21 21
      cli/js/AmberCli.js
  2. 6 6
      cli/st/AmberCli.st
  3. 21 21
      cli/support/amber-cli.js

+ 21 - 21
cli/js/AmberCli.js

@@ -253,7 +253,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self["@fs"])._existsSync_(self._normalizePath_("index.html"));
+$1=_st(self["@fs"])._existsSync_(self._withBasePath_("index.html"));
 if(! smalltalk.assert($1)){
 _st(console)._warn_("Warning: project directory does not contain index.html.");
 $ctx1.sendIdx["warn:"]=1;
@@ -263,8 +263,8 @@ _st(console)._warn_("    You can also specify a custom error page with --fallbac
 };
 return self}, function($ctx1) {$ctx1.fill(self,"checkDirectoryLayout",{},smalltalk.FileServer)})},
 args: [],
-source: "checkDirectoryLayout\x0a\x09(fs existsSync:\x09(self normalizePath: 'index.html')) ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.\x0a\x09\x09console warn: '    You can also specify a custom error page with --fallback-page.'].",
-messageSends: ["ifFalse:", "existsSync:", "normalizePath:", "warn:"],
+source: "checkDirectoryLayout\x0a\x09(fs existsSync:\x09(self withBasePath: 'index.html')) ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.\x0a\x09\x09console warn: '    You can also specify a custom error page with --fallback-page.'].",
+messageSends: ["ifFalse:", "existsSync:", "withBasePath:", "warn:"],
 referencedClasses: []
 }),
 smalltalk.FileServer);
@@ -580,24 +580,6 @@ referencedClasses: []
 }),
 smalltalk.FileServer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "normalizePath:",
-category: 'private',
-fn: function (aBaseRelativePath){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@path"])._join_with_(self._basePath(),aBaseRelativePath);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"normalizePath:",{aBaseRelativePath:aBaseRelativePath},smalltalk.FileServer)})},
-args: ["aBaseRelativePath"],
-source: "normalizePath: aBaseRelativePath\x0a\x09\x22return a nomalized path which is relative to the basePath.\x22\x0a\x09^\x09path join: self basePath with: aBaseRelativePath",
-messageSends: ["join:with:", "basePath"],
-referencedClasses: []
-}),
-smalltalk.FileServer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "password:",
@@ -927,6 +909,24 @@ referencedClasses: []
 }),
 smalltalk.FileServer);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "withBasePath:",
+category: 'private',
+fn: function (aBaseRelativePath){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@path"])._join_with_(self._basePath(),aBaseRelativePath);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"withBasePath:",{aBaseRelativePath:aBaseRelativePath},smalltalk.FileServer)})},
+args: ["aBaseRelativePath"],
+source: "withBasePath: aBaseRelativePath\x0a\x09\x22return a file path which is relative to the basePath.\x22\x0a\x09^\x09path join: self basePath with: aBaseRelativePath",
+messageSends: ["join:with:", "basePath"],
+referencedClasses: []
+}),
+smalltalk.FileServer);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "writeData:toFileNamed:",

+ 6 - 6
cli/st/AmberCli.st

@@ -168,7 +168,7 @@ username: aUsername
 !FileServer methodsFor: 'initialization'!
 
 checkDirectoryLayout
-	(fs existsSync:	(self normalizePath: 'index.html')) ifFalse: [
+	(fs existsSync:	(self withBasePath: 'index.html')) ifFalse: [
 		console warn: 'Warning: project directory does not contain index.html.'.
 		console warn: '    You can specify the directory containing index.html with --base-path.'.
 		console warn: '    You can also specify a custom error page with --fallback-page.'].
@@ -219,16 +219,16 @@ isAuthenticated: aRequest
 	].
 !
 
-normalizePath: aBaseRelativePath
-	"return a nomalized path which is relative to the basePath."
-	^	path join: self basePath with: aBaseRelativePath
-!
-
 require: aModuleString
 	"call to the require function"
 	^require value: aModuleString
 !
 
+withBasePath: aBaseRelativePath
+	"return a file path which is relative to the basePath."
+	^	path join: self basePath with: aBaseRelativePath
+!
+
 writeData: data toFileNamed: aFilename
 	console log: aFilename
 ! !

+ 21 - 21
cli/support/amber-cli.js

@@ -38594,7 +38594,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self["@fs"])._existsSync_(self._normalizePath_("index.html"));
+$1=_st(self["@fs"])._existsSync_(self._withBasePath_("index.html"));
 if(! smalltalk.assert($1)){
 _st(console)._warn_("Warning: project directory does not contain index.html.");
 $ctx1.sendIdx["warn:"]=1;
@@ -38604,8 +38604,8 @@ _st(console)._warn_("    You can also specify a custom error page with --fallbac
 };
 return self}, function($ctx1) {$ctx1.fill(self,"checkDirectoryLayout",{},smalltalk.FileServer)})},
 args: [],
-source: "checkDirectoryLayout\x0a\x09(fs existsSync:\x09(self normalizePath: 'index.html')) ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.\x0a\x09\x09console warn: '    You can also specify a custom error page with --fallback-page.'].",
-messageSends: ["ifFalse:", "existsSync:", "normalizePath:", "warn:"],
+source: "checkDirectoryLayout\x0a\x09(fs existsSync:\x09(self withBasePath: 'index.html')) ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.\x0a\x09\x09console warn: '    You can also specify a custom error page with --fallback-page.'].",
+messageSends: ["ifFalse:", "existsSync:", "withBasePath:", "warn:"],
 referencedClasses: []
 }),
 smalltalk.FileServer);
@@ -38921,24 +38921,6 @@ referencedClasses: []
 }),
 smalltalk.FileServer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "normalizePath:",
-category: 'private',
-fn: function (aBaseRelativePath){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@path"])._join_with_(self._basePath(),aBaseRelativePath);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"normalizePath:",{aBaseRelativePath:aBaseRelativePath},smalltalk.FileServer)})},
-args: ["aBaseRelativePath"],
-source: "normalizePath: aBaseRelativePath\x0a\x09\x22return a nomalized path which is relative to the basePath.\x22\x0a\x09^\x09path join: self basePath with: aBaseRelativePath",
-messageSends: ["join:with:", "basePath"],
-referencedClasses: []
-}),
-smalltalk.FileServer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "password:",
@@ -39268,6 +39250,24 @@ referencedClasses: []
 }),
 smalltalk.FileServer);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "withBasePath:",
+category: 'private',
+fn: function (aBaseRelativePath){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@path"])._join_with_(self._basePath(),aBaseRelativePath);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"withBasePath:",{aBaseRelativePath:aBaseRelativePath},smalltalk.FileServer)})},
+args: ["aBaseRelativePath"],
+source: "withBasePath: aBaseRelativePath\x0a\x09\x22return a file path which is relative to the basePath.\x22\x0a\x09^\x09path join: self basePath with: aBaseRelativePath",
+messageSends: ["join:with:", "basePath"],
+referencedClasses: []
+}),
+smalltalk.FileServer);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "writeData:toFileNamed:",