Skip to content

Commit

Permalink
✨ add ability to add education to resume
Browse files Browse the repository at this point in the history
created CRUD commands and added education to md and txt export formats
  • Loading branch information
csc530 committed Jul 31, 2024
1 parent c7ee6d9 commit 31212f6
Show file tree
Hide file tree
Showing 18 changed files with 755 additions and 75 deletions.
20 changes: 20 additions & 0 deletions .run/add education.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="add education" type="DotNetProject" factoryName=".NET Project" folderName="add">
<option name="EXE_PATH" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0/Resumer.exe" />
<option name="PROGRAM_PARAMETERS" value="add education" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Resumer/Resumer.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
20 changes: 20 additions & 0 deletions .run/edit education.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="edit education" type="DotNetProject" factoryName=".NET Project" folderName="edit">
<option name="EXE_PATH" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0/Resumer.exe" />
<option name="PROGRAM_PARAMETERS" value="edit school" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Resumer/Resumer.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
20 changes: 20 additions & 0 deletions .run/get educations.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="get educations" type="DotNetProject" factoryName=".NET Project" folderName="get">
<option name="EXE_PATH" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0/Resumer.exe" />
<option name="PROGRAM_PARAMETERS" value="get education" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Resumer/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Resumer/Resumer.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net8.0" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
14 changes: 10 additions & 4 deletions Resumer/Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Immutable;
using System.Text;
using System.Text.RegularExpressions;
using Spectre.Console;

namespace Resumer;
Expand All @@ -21,13 +22,14 @@ public static partial class Utility
/// </summary>
/// <typeparam name="T">the type of the prompt input</typeparam>
/// <param name="message">the prompt message</param>
/// <returns>a <see cref="TextPrompt{T}"/> of nullable <typeparamref name="T"/></returns>
public static TextPrompt<T?> SimplePrompt<T>(string message) =>
new TextPrompt<T?>(message).AllowEmpty().HideDefaultValue().DefaultValue(default);
new TextPrompt<T?>(message).AllowEmpty().HideDefaultValue().DefaultValue(default(T?));

/// <inheritdoc cref="SimplePrompt{T}(string)"/>
/// <param name="defaultValue">the default value</param>
public static TextPrompt<T> SimplePrompt<T>(string message, T defaultValue) => new TextPrompt<T>(message)
.AllowEmpty().DefaultValue(defaultValue).HideDefaultValue();
public static TextPrompt<T?> SimplePrompt<T>(string message, T? defaultValue) =>
SimplePrompt<T?>(message).DefaultValue(defaultValue);

/// <summary>
/// converts a string to camel case
Expand Down Expand Up @@ -56,7 +58,7 @@ public static string PrintDuration(DateOnly? startDate, DateOnly? endDate = null
startDate == null ? string.Empty : $"{startDate:MMM yyyy} - {endDate?.ToString("MMM yyyy") ?? "present"}";
}

public static class Extensions
public static partial class Extensions
{
// todo: inquire about default value being a property - spectre console pr/iss
// .DefaultValue(textPrompt);
Expand All @@ -75,6 +77,7 @@ public static string Print(this object? value) =>
null => string.Empty,
bool bit => bit ? "true" : "false",
string txt => txt,
Enum @enum => NextToUppercaseRegex().Replace(@enum.ToString(), "$1 $2").Replace('_', '-'),
DictionaryEntry pair => $"{pair.Key.Print()}: {pair.Value.Print()}",
IDictionary dictionary => string.Join("\n", dictionary.Cast<object>().Select(obj => $"- {obj.Print()}")),
IEnumerable enumerable => string.Join("\n", enumerable.Cast<object>().Select(obj => $"+ {obj.Print()}")),
Expand Down Expand Up @@ -278,4 +281,7 @@ public static void EditFromPrompt(this List<string> description, string prompt)
}
} while(i < count || !string.IsNullOrWhiteSpace(input));
}

[GeneratedRegex(@"(\w)([A-Z])")]
private static partial Regex NextToUppercaseRegex();
}
256 changes: 256 additions & 0 deletions Resumer/Migrations/20240731173406_AddEducationTable.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 31212f6

Please sign in to comment.