mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-02-09 09:23:56 +00:00
Expose Tawashi's version to mustache.
This commit is contained in:
parent
6c357f1dc7
commit
a912b1e3d4
4 changed files with 59 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
#include "cgi_env.hpp"
|
#include "cgi_env.hpp"
|
||||||
#include "num_conv.hpp"
|
#include "num_conv.hpp"
|
||||||
#include "kamokan_config.h"
|
#include "kamokan_config.h"
|
||||||
|
#include "version.hpp"
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -172,7 +173,8 @@ namespace tawashi {
|
||||||
statuslog->info("Sending response");
|
statuslog->info("Sending response");
|
||||||
SPDLOG_TRACE(statuslog, "Preparing mustache dictionary");
|
SPDLOG_TRACE(statuslog, "Preparing mustache dictionary");
|
||||||
mstch::map mustache_context {
|
mstch::map mustache_context {
|
||||||
{"version", std::string{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}},
|
{"version", boost::string_view{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}},
|
||||||
|
{"tawashi_version", tawashi::version()},
|
||||||
{"base_uri", base_uri()},
|
{"base_uri", base_uri()},
|
||||||
{"host_path", make_host_path(this->settings())},
|
{"host_path", make_host_path(this->settings())},
|
||||||
{"languages", make_mstch_langmap(*m_settings)}
|
{"languages", make_mstch_langmap(*m_settings)}
|
||||||
|
|
|
@ -20,6 +20,7 @@ add_library(${PROJECT_NAME}
|
||||||
ip_utils.cpp
|
ip_utils.cpp
|
||||||
mime_split.cpp
|
mime_split.cpp
|
||||||
truncated_string.cpp
|
truncated_string.cpp
|
||||||
|
version.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME}
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
|
31
src/tawashi/version.cpp
Normal file
31
src/tawashi/version.cpp
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/* Copyright 2017, Michele Santullo
|
||||||
|
* This file is part of "tawashi".
|
||||||
|
*
|
||||||
|
* "tawashi" is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* "tawashi" is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with "tawashi". If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "version.hpp"
|
||||||
|
#include "tawashi_config.h"
|
||||||
|
#include "duckhandy/stringize.h"
|
||||||
|
|
||||||
|
namespace tawashi {
|
||||||
|
boost::string_view version() {
|
||||||
|
return boost::string_view(
|
||||||
|
STRINGIZE(VERSION_MAJOR) "."
|
||||||
|
STRINGIZE(VERSION_MINOR) "."
|
||||||
|
STRINGIZE(VERSION_PATCH)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} //namespace tawashi
|
||||||
|
|
24
src/tawashi/version.hpp
Normal file
24
src/tawashi/version.hpp
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/* Copyright 2017, Michele Santullo
|
||||||
|
* This file is part of "tawashi".
|
||||||
|
*
|
||||||
|
* "tawashi" is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* "tawashi" is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with "tawashi". If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/utility/string_view.hpp>
|
||||||
|
|
||||||
|
namespace tawashi {
|
||||||
|
boost::string_view version();
|
||||||
|
} //namespace tawashi
|
Loading…
Add table
Reference in a new issue