Browse Source

rm diet-ng - part 2

221V 1 week ago
parent
commit
41eae58e56
2 changed files with 29 additions and 7 deletions
  1. 16 2
      README.md
  2. 13 5
      vtest/source/vibe/http/server.d

+ 16 - 2
README.md

@@ -3,8 +3,22 @@
 ```
 // vibe-d 0.10.2
 
-// "diet-ng" is an optional dependency of vibe.d that is chosen by default - to avoid that, remove the "diet-ng" entry from dub.selections.json.
-// https://github.com/vibe-d/vibe.d/blob/master/CHANGELOG.md
+
+// rm diet-ng 1.8.4 in vibe-http 1.2.2 -- https://github.com/221V/vibe-http/tree/rm_diet
+"vibe-d": "~>0.9",
+"mustache-d": "~>0.1.5"
+->
+"vibe-http": "~>1.2.2",
+"vibe-stream": "~>1.1.1",
+"mustache-d": "~>0.1.5"
+->
+"vibe-inet:crypto": "~>1.1.2",
+"vibe-inet": "~>1.1.2",
+"vibe-stream:tls": "~>1.1.1",
+"vibe-stream": "~>1.1.1",
+"vibe-inet:textfilter": "~>1.1.2",
+"mustache-d": "~>0.1.5"
+
 
 
 sudo apt-get install libevent-dev

+ 13 - 5
vtest/source/vibe/http/server.d

@@ -32,7 +32,7 @@ import vibe.internal.string : formatAlloc, icmp2;
 
 import core.atomic;
 import core.vararg;
-import diet.traits : SafeFilterCallback, dietTraits;
+//import diet.traits : SafeFilterCallback, dietTraits;
 import std.algorithm : canFind, splitter;
 import std.array;
 import std.conv;
@@ -52,6 +52,11 @@ else version (Have_botan) enum HaveNoTLS = false;
 else version (Have_openssl) enum HaveNoTLS = false;
 else enum HaveNoTLS = true;
 
+
+// rm - comment - diet-ng shit
+// https://github.com/rejectedsoftware/diet-ng/blob/v1.8.4/source/diet/traits.d#L159
+
+
 /**************************************************************************************************/
 /* Public functions                                                                               */
 /**************************************************************************************************/
@@ -255,7 +260,7 @@ void handleHTTPConnection(TCPConnection connection, HTTPServerContext context)
 	logTrace("Done handling connection.");
 }
 
-
+/+
 /**
 	Provides a HTTP request handler that responds with a static Diet template.
 */
@@ -265,6 +270,7 @@ void handleHTTPConnection(TCPConnection connection, HTTPServerContext context)
 		res.render!(template_file, req);
 	};
 }
++/
 
 /**
 	Provides a HTTP request handler that responds with a static redirection to the specified URL.
@@ -329,13 +335,15 @@ void setVibeDistHost(string host, ushort port)
 		res.render!("mytemplate.dt", title, pageNumber);
 		---
 */
+// comment cause no diet
+/+
 @property void render(string template_file, ALIASES...)(HTTPServerResponse res)
 {
 	res.contentType = "text/html; charset=UTF-8";
 	version (VibeUseOldDiet)
 		pragma(msg, "VibeUseOldDiet is not supported anymore. Please undefine in the package recipe.");
 	import vibe.stream.wrapper : streamOutputRange;
-	import diet.html : compileHTMLDietFile;
+	//import diet.html : compileHTMLDietFile;
 	auto output = streamOutputRange!1024(res.bodyWriter);
 	compileHTMLDietFile!(template_file, ALIASES, DefaultDietFilters)(output);
 }
@@ -347,7 +355,7 @@ void setVibeDistHost(string host, ushort port)
 @dietTraits
 struct DefaultDietFilters {
 	import diet.html : HTMLOutputStyle;
-	import diet.traits : SafeFilterCallback;
+	//import diet.traits : SafeFilterCallback;
 	import std.string : splitLines;
 
 	version (VibeOutputCompactHTML) enum HTMLOutputStyle htmlOutputStyle = HTMLOutputStyle.compact;
@@ -431,7 +439,7 @@ unittest {
 	assert(compile!":htmlescape !{\"<test>\"}" == "&lt;test&gt;");
 	assert(compile!":javascript\n\ttest();" == "<script>\n\t//<![CDATA[\n\ttest();\n\t//]]>\n</script>");
 }
-
++/
 
 /**
 	Creates a HTTPServerRequest suitable for writing unit tests.