Skip to content
Permalink
Browse files

Initial commit

  • Loading branch information...
Kripth committed Dec 27, 2018
0 parents commit b50214361c431292ba2eafc08ff635ce199f93ca
@@ -0,0 +1,15 @@
# http://editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.bat]
end_of_line = crlf
@@ -0,0 +1,15 @@
*.exe
*.sln
*.userprefs
*.dproj
*.obj
*.o
*.lib
*.a
*.dll
*.userprefs
*.selections.json
.dub
.scorpion
scorpion
*.properties
10 dub.sdl
@@ -0,0 +1,10 @@
name "scorpion"
description "An MVC framework"
license "MIT"
//dependency "ddbc" version="~>0.3.9"
dependency "diet-ng" version="~>1.5.0"
dependency "my-ip" version="~>0.2.0"
dependency "lighttp" version="~>0.3.0"

postGenerateCommands "if not exist .scorpion mkdir .scorpion" "copy $SCORPION_PACKAGE_DIR\\init.d .scorpion\\init.d" "dub --single .scorpion/init.d" "dub build --single --arch=$ARCH --build=$BUILD_TYPE .scorpion/starter.d" "copy .scorpion\\exe\\* ." platform="windows"
postGenerateCommands "mkdir -p .scorpion" "cp $SCORPION_PACKAGE_DIR/init.d .scorpion/init.d" "dub --single .scorpion/init.d" "dub build --single --arch=$ARCH --build=$BUILD_TYPE .scorpion/starter.d" "cp .scorpion/exe/* ." platform="posix"
98 init.d
@@ -0,0 +1,98 @@
/++ dub.sdl:
name "scorpion-init"
dependency "sdlang-d" version="~>0.10.4"
+/
module scorpioninit;

import std.algorithm : canFind;
import std.ascii : newline;
import std.file : exists, read, write, dirEntries, SpanMode;
import std.json;
import std.string;

import sdlang;

enum libs = ["diet-ng", "kiss", "lighttp", "my-ip", "xbuffer"];

void main(string[] args) {

version(Windows) {
import core.sys.windows.shlobj : SHGetFolderPath, CSIDL_LOCAL_APPDATA;
import core.sys.windows.windef : MAX_PATH;
import core.sys.windows.winerror : S_OK;
import std.utf : toUTF8;
wchar[] result = new wchar[MAX_PATH];
assert(SHGetFolderPath(cast(void*)null, CSIDL_LOCAL_APPDATA, cast(void*)null, 0, result.ptr) == S_OK);
immutable local = fromStringz((toUTF8(result)).ptr);
} else {
import std.process : executeShell;
immutable local = executeShell("cd ~ && pwd").output.strip;
}

string name;

if(exists("dub.json")) {
JSONValue root = parseJSON(cast(string)read("dub.json"));
name = root["name"].str;
} else {
Tag root = parseSource(cast(string)read("dub.sdl"));
name = root.getTagValue!string("name");
}

string[] sources;

void addSources(string path) {
string[] search = ["source", "src"];
//TODO read dub.json or dub.sdl and extract source paths
foreach(s ; search) {
if(exists(s)) sources ~= path ~ s;
}
}

addSources("./");

foreach(lname, value ; parseJSON(cast(string)read("dub.selections.json"))["versions"].object) {
if(!libs.canFind(lname)) {
if(value.type == JSON_TYPE.STRING) {
addSources(local ~ "/dub/packages/" ~ lname ~ "-" ~ value.str ~ "/" ~ lname ~ "/");
} else {
addSources(value["path"].str ~ "/");
}
}
}

string[] modules;

foreach(path ; sources) {
foreach(string file ; dirEntries(path, SpanMode.breadth)) {
if(file.endsWith(".d")) {
auto data = cast(string)read(file);
immutable module_ = data.indexOf("module "); //TODO may be in a comment
if(module_ != -1) {
data = data[module_..$];
immutable semicolon = data.indexOf(";");
if(semicolon != -1) {
modules ~= "registerModule!\"" ~ data[6..semicolon].strip ~ "\"();";
}
}
}
}
}

auto data = [
"/++ dub.sdl:",
"name \"scorpion-starter\"",
"targetName \"" ~ name ~ "\"",
"targetPath \"exe\"",
"dependency \"" ~ name ~ "\" path=\"..\"",
"+/",
"module scorpionstarter;",
"import scorpion.register : registerModule;",
"import scorpion.starter : start;",
"void main(string[] args){"
];
data ~= modules;
data ~= "start(args); }";
write(".scorpion/starter.d", join(data, newline));

}
No changes.
No changes.
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="581.932px" height="581.932px" viewBox="0 0 581.932 581.932" style="enable-background:new 0 0 581.932 581.932;"
xml:space="preserve">
<g>
<g>
<path d="M4.088,164.201c3.325,10.494,4.672,15.643,5.365,26.582c0.478,7.523,1.428,21.754,9.392,25.598
c1.595,0.767,3.02,1.465,4.472,2.089c1.534,0.661,1.967,1.232,0.196,2.22c-10.437,5.818,3.839,27.581,8.054,34.182
c0.445,0.693,1.444,1.102,2.269,1.469c0.897,0.4,1.828,0.722,2.68,1.02c0.522,0.18,0.714,0.718,0.429,1.191
c-6.63,10.926-4.774,24.252-0.09,35.875c5.594,13.868,8.829,26.68,19.894,37.594c1.004,0.987,15.651,10.379,15.508,9.649
c0.334,1.726,0.738,2.978,0.196,4.675c-7.046,0.535-13.619-0.126-18.83,5.822c-3.827,4.37-5.663,10.09-7.405,15.635
c-5.076,16.165-6.622,37.883-21.106,46.655c-0.008,0.004-0.017,0.008-0.021,0.012c-0.473,0.286-0.404,0.494,0.143,0.56
c3.312,0.379,6.079,3.003,9.522,1.452c1.758-0.787,3.574-1.562,5.116-2.685c2.028-1.478,4.166-3.031,5.614-5.022
c1.865-2.57,3.174-5.565,4.569-8.445c1.155-2.383,2.138-4.852,3.084-7.324c0.216-0.562,0.033-1.313-0.069-1.962
c-0.094-0.62-0.212-1.241-0.314-1.751c-0.11-0.538,0.13-1.281,0.518-1.677c5.015-5.104,6.238-11.077,6.752-17.462
c0.045-0.551,0.457-1.249,0.987-1.392c2.073-0.567,4.072,1.036,6.193,1.15c0.457,0.024,0.902,0.367,1.347,0.355
c3.798-0.095,7.601-0.241,11.399-0.352c0.18-0.004,0.359,0.054,0.645,0.147c0.351,0.114,0.302,0.388-0.106,0.641
c-0.298,0.184-0.522,0.318-0.763,0.403c-16.32,5.603-18.458,8.119-24.68,24.407c-5.553,14.528-11.11,29.053-16.667,43.578
c-1.726,4.517-3.476,9.074-5.875,13.252c-0.649,1.13-1.342,2.228-2.097,3.292c-3.549,5.011-8.621,9.221-14.635,10.449
c2.183-0.155,10.269,1.154,11.836,0.392c16.801-8.201,25.888-22.763,32.914-40.151c1.705-4.223,5.732-28.241,9.555-28.821
c1.971-0.298,3.941-1.109,5.879-1.016c7.034,0.339,13.855-0.979,20.918-2.591c0.539-0.122,0.849,0.208,0.71,0.738
c-0.518,1.946-0.877,3.595-1.53,5.121c-0.514,1.203-1.742,2.084-2.379,3.26c-10.408,19.127-18.776,48.535-20.331,70.192
c-0.041,0.551-0.473,1.179-0.979,1.399c-6.806,2.954-13.823,6.536-18.678,12.28c0.596-0.701,18.197-2.235,22.04-4.937
c6.593-4.631,12.007-11.815,15.504-19.013c5.512-11.351,15.112-30.339,13.24-43.122c-0.233-1.583,0.053-3.235,0.229-4.79
c0.061-0.546,0.485-1.211,0.975-1.464c8.502-4.362,18.001-4.342,27.026-6.74c0.534-0.144,1.102,0.159,1.24,0.693
c1.697,6.544-2.803,10.155-5.112,15.586c-3.113,7.319-4.488,15.985-6.642,23.655c-4.451,15.839-8.911,31.673-13.35,47.516
c-1.297,4.627-2.644,9.352-5.402,13.289c-4.023,5.744-15.141,11.31-13.99,18.393c2.367-0.56,3.99-1.856,6.091-3.146
c0.314-0.192,0.91,0.143,1.334,0.045c0.91-0.208,1.803-0.515,2.685-0.833c0.277-0.098,0.469-0.489,0.738-0.542
c2.832-0.53,4.811-2.257,6.679-4.337c9.576-10.674,17.267-18.01,21.816-32.195c5.304-16.553,19.71-41.506,12.179-58.279
c-0.229-0.506-0.249-0.995-0.062-1.094c0.188-0.098,0.727,0.05,1.191,0.339c0.669,0.416,1.342,0.833,2.064,1.114
c3.574,1.403,13.003-5.933,17.577-6.186c16.096-0.901,36.394,5.929,52.277,9.074c-8.536,10.012-10.318,25.263-4.321,36.977
c4.015,7.842,11.318,13.722,19.625,16.504c9.902,3.312,12.604,7.267,20.408,13.468c8.054,6.397,18.707,8.797,28.523,10.968
c28.229,6.246,56.427,14.459,85.64,11.256c14.08-1.542,27.911-5.385,40.767-11.33c6.116-2.827,12.02-6.128,17.613-9.886
c5.072-3.406,8.54-8.494,14.142-11.179c-20.037,0.016-40.004,10.873-60.376,12.529c-18.951,1.542-38.846-1.411-54.709-11.893
c-0.139-0.09,28.716-13.656,31.078-14.419c12.962-4.194,26.197-7.544,39.592-10.029c13.558-2.513,34.631-10.652,47.691-3.978
c-4.651-14.182-35.354-18.177-47.969-20.241c-17.821-2.917-35.309-7.548-52.856-11.742c-12.24-2.925-27.353-8.727-39.816-5.022
c5.871-6.744,12.33-14.015,16.39-21.444c0.31-0.567,0.546-1.521,0.963-1.611c1.587-0.343,3.28-0.727,4.847-0.498
c6.875,1.021,13.113,1.84,20.077,2.758c21.976,2.889,3.497-12.231,12.95-16.418c2.688-1.187,5.419,1.311,7.716,3.138
c7.119,5.667,8.56-2.072,7.874-7.303c0-0.004,0-0.013-0.004-0.017c-1.461-11.199,26.238-21.901,33.428-26.283
c9.856-6.006,15.459-8.996,26.928-9.147c12.921-0.167,25.189-3.88,37.769-5.875c1.685-0.266,3.595,0.281,5.287,0.815
c2.154,0.682,4.138,1.612,6.553,1.592c6.32-0.049,12.203,2.799,18.638,2.432c8.707-0.498,18.16-3.954,26.699-5.811
c13.921-3.027,23.742,6.704,33.436,14.529c2.493,2.016,20.005,17.434,22.869,10.837c3.712-8.552-16.039-25.011-19.784-31.535
c-7.201-12.558-14.725-25.047-27.956-32.052c-14.35-7.598-52.815-8.919-62.71,7.776c-0.42,0.71-1.497,1.057-2.317,1.485
c-2.84,1.48-2.366,5.067-4.496,6.973c-0.371,0.334-1.094,0.729-1.42,0.583c-2.497-1.143-4.9-2.301-7.683-2.896
c-2.995-0.641-6.006-0.951-8.956-1.518c-2.174-0.417-4.157,0.175-6.128-0.135c-7.715-1.221-14.786,1.95-22.175,2.9
c-3.37,0.437-5.871,2.212-8.486,4.292c-1.542,1.229-3.007,2.253-4.076,3.95c-0.236,0.379-1.685,0.253-2.447-0.013
c-2.298-0.8-4.546-1.738-7.336-2.848c-5.871-2.342-6.438-18.295-7.969-23.28c-1.86-6.06-5.867-12.212-12.076-13.493
c-6.084-1.252-12.269,2.774-15.492,8.087c-3.223,5.308-4.129,11.656-4.97,17.81c-1.688,12.346-3.374,24.691-5.062,37.038
c-0.282,2.052-1.718,4.798-3.583,3.892c-1.057-0.514-1.252-1.909-1.31-3.08c-1.008-20.53-0.032-35.165-7.968-54.391
c-2.109-5.107-7.25-10.212-12.44-8.319c-5.356,1.955-5.81,9.246-5.312,14.925c1.012,11.514,2.027,23.027,3.039,34.542
c0.176,1.979,0.041,4.491-1.803,5.234c-2.265,0.91-4.198-1.832-5.112-4.093c-7.397-18.278-14.228-41.877-35.521-47.911
c-23.301-6.602-14.463,25.479-12.269,38.278c0.739,4.309-2.146,6.553-6.417,5.533c-3.566-0.849-5.312-3.538-7.446-5.985
c-12.452-14.309-26.818-25.529-46.047-28.63c-7.319-1.179-17.895-2.22-24.937,0.779c-7.837,3.338-7.654,7.426-11.346,15.19
c-0.004,0.008-0.008,0.012-0.008,0.02c-0.237,0.498-0.547,1.11-0.445,1.588c0.506,2.378-0.877,2.758-2.762,3.443
c-3.248,1.179-5.435-0.579-7.621-2.171c-8.16-5.94-17.43-5.394-25.296-11.469c-9.963-7.699-18.78-17.756-27.936-26.414
C96.7,263.3,81.784,252.104,64.99,245.866c0.404-13.627-6.993-27.222-18.658-34.284c1.856-14.154-2.028-28.976-10.587-40.404
c-4.554-26.589-5.169-53.852-1.828-80.621c8.058,6.189,15.81,13.281,24.917,17.875c4.896,2.472,9.657,5.267,14.721,7.332
c4.875,1.987,9.898,4.467,15.459,2.089c0.433-0.184,0.877-0.331,1.326-0.469c0.526-0.167,0.934-0.461,0.918-0.657
c-0.021-0.196-0.481-0.327-1.032-0.306c-0.706,0.024-1.416,0.053-2.105,0.176c-5.202,0.938-9.796-1.392-13.113-5.459
c-2.909-3.562-3.248-7.805-3.064-11.591c0.437-8.878-2.313-17.095-3.905-25.549c-0.277-1.469-1.359-2.954-2.448-4.063
c-2.921-2.975-5.757-6.186-9.184-8.47c-12.815-8.547-33.366-7.369-43.097,5.394C6.475,75.824,4.443,87.444,2.624,98.57
C-0.494,117.542-1.742,145.816,4.088,164.201z M372.227,347.156c0.265-0.188,0.478-0.359,0.518-0.563
c0.841-4.21,1.628-8.433,2.371-12.664c0.302-1.729,0.444-3.484,0.701-5.223c0.38-2.542,1.139-5.079,1.131-7.617
c-0.017-4.463-0.498-8.927-0.771-13.391c-0.008-0.163,0.008-0.326,0.037-0.498c0.04-0.272,0.465-0.596,0.946-0.726
c0.298-0.082,0.583-0.155,0.873-0.225c3.574-0.856,3.468-0.828,4.39,2.815c0.481,1.889,0.303,3.974,2.244,5.512
c1.265,1,2.032,2.848,2.604,4.464c0.738,2.097,1.154,4.329,1.518,6.536c0.135,0.808-0.032,1.897-0.502,2.529
c-1.102,1.481-2.636,2.644-3.696,4.149c-2.265,3.211-4.447,6.487-6.455,9.861c-1.261,2.122-2.248,4.398-3.337,6.679
c-0.236,0.498-0.792,0.633-1.232,0.303c-0.403-0.303-0.775-0.58-1.167-0.873C371.953,347.887,371.871,347.405,372.227,347.156z
M282.462,305.936c-0.033-0.551,0.388-1.109,0.926-1.231c3.925-0.873,4.888-0.062,5.891,3.852
c0.225,0.877,0.372,1.823,0.808,2.591c1.987,3.468,4.141,6.842,6.087,10.334c1.18,2.118,2.081,4.386,3.117,6.585
c0.103,0.217,0.229,0.494,0.421,0.58c1.636,0.73,1.604,1.966,1.514,3.374c-0.037,0.551-0.474,0.84-0.979,0.62
c-0.547-0.236-0.979-0.429-1.412-0.425c-3.541,0.033-7.087,0.131-10.628,0.298c-3.146,0.147-5.834-2.158-5.814-5.23
c0.004-0.849,0.648-1.709,0.608-2.542c-0.196-3.773-1.412-7.405-0.51-11.354C283.034,311.003,282.617,308.4,282.462,305.936z
M189.075,315.104c0.208-0.677,1.428-1.681,1.881-1.538c3.207,1.021,6.385,1.611,9.755,0.894c4.223-0.897,8.47-1.705,12.717-2.484
c0.734-0.135,1.865-0.253,2.248,0.154c3.762,3.99,9.592,5.468,12.583,10.376c0.164,0.27,0.359,0.518,0.567,0.763
c0.338,0.4,0.167,0.693-0.384,0.678c-0.571-0.021-1.138-0.054-1.648-0.237c-0.91-0.326-1.645-1.306-2.546-1.46
c-4.851-0.841-9.768-1.008-14.623-0.213c-1.497,0.245-2.889,1.139-4.618,2.012c-0.494,0.249-1.326,0.302-1.849,0.131
c-0.363-0.118-0.771-0.262-1.163-0.433c-0.849-0.371-1.624-0.901-2.468-1.281c-3.382-1.506-6.826-2.889-10.119-4.569
C188.908,317.642,188.814,315.956,189.075,315.104z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
@@ -0,0 +1 @@
scorpion.welcome = Welcome to Scorpion!
@@ -0,0 +1,6 @@
doctype html
html
head
title= lang["scorpion.welcome"]
body
pre= model["example"]
@@ -0,0 +1 @@
scorpion.welcome = Benvenuto su Scorpion!

0 comments on commit b502143

Please sign in to comment.
You can’t perform that action at this time.