gitignore_template_generator/
constant.rs1pub mod error_messages {
2 pub const CMD_EXECUTION_FAILURE: &str = "Failed to execute command";
3 pub const BODY_PARSING_ISSUE: &str =
4 "An error occurred during body parsing";
5 pub const FILE_READ_TO_STRING_FAILURE: &str =
6 "Failed to read expected output file";
7 pub const REGEX_NO_MATCH: &str =
8 "Actual output <{actual}> did not match expected pattern <{expected}>";
9 pub const COMMAS_NOT_ALLOWED: &str =
10 "Commas are not allowed in template names";
11 pub const API_CALL_FAILURE: &str =
12 "An error occurred during the API call: {error}";
13 pub const HTTP_400: &str = "http status: 400";
14 pub const AUTHOR_INFOS_NOT_AVAILABLE: &str =
15 "Author information not available.";
16 pub const VERSION_INFOS_NOT_AVAILABLE: &str =
17 "Version information not available.";
18}
19
20pub mod help_messages {
21 pub const TEMPLATE_NAMES: &str =
22 "A non-empty list of gitignore template names";
23 pub const AUTHOR: &str = "Print author";
24 pub const SERVER_URL: &str = "The gitignore template generator service url";
25 pub const HELP: &str = "Print help";
26 pub const VERSION: &str = "Print version";
27}
28
29pub mod cli_options {
30 use crate::helper::CliOptionName;
31
32 pub const AUTHOR: CliOptionName = CliOptionName {
33 short: 'a',
34 long: "author",
35 };
36 pub const SERVER_URL: CliOptionName = CliOptionName {
37 short: 's',
38 long: "server-url",
39 };
40 pub const HELP: CliOptionName = CliOptionName {
41 short: 'h',
42 long: "help",
43 };
44 pub const VERSION: CliOptionName = CliOptionName {
45 short: 'V',
46 long: "version",
47 };
48}
49
50pub mod parser_infos {
51 pub const ABOUT: &str = "Generate templates for .gitignore files";
52}
53
54pub mod exit_status {
55 pub const SUCCESS: i32 = 0;
56 pub const GENERIC: i32 = 2;
57 pub const BODY_PARSING_ISSUE: i32 = 3;
58}
59
60pub mod template_generator {
61 pub const BASE_URL: &str = "https://www.toptal.com";
62 pub const URI: &str = "/developers/gitignore/api";
63}
64
65pub mod path {
66 pub const TEST_EXPECTATIONS: &str = "tests/expected";
67}
68
69pub mod regex {
70 pub const SEMVER_VERSION: &str = r"[0-9]+\.[0-9]+\.[0-9]+";
71}