Base upload

This commit is contained in:
Maddox Werts 2024-06-20 13:06:16 -04:00
parent 7d27a4494a
commit eab2096e39
7 changed files with 80 additions and 2 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
# will have compiled files and executables # will have compiled files and executables
debug/ debug/
target/ target/
build/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

6
Cargo.toml Executable file
View file

@ -0,0 +1,6 @@
[package]
name = "Tasky"
version = "0.1.0"
edition = "2021"
[dependencies]

8
Dockerfile Executable file
View file

@ -0,0 +1,8 @@
## SETUP ##
FROM rust
RUN mkdir /src /comp /app
WORKDIR /comp
## RUNTIME ##
CMD cp -r /src/* . && cargo build && cp ./target/debug/Tasky /app

View file

@ -1,3 +1,2 @@
# Tasky # Tasky
A quick and easy task manager
A quick and easy task manager

25
src/board.rs Executable file
View file

@ -0,0 +1,25 @@
// Libraries
use crate::card;
// Structures
pub struct TaskBoard {
pub name: String,
pub cards: Vec<card::TaskCard>
}
// Implementations
impl TaskBoard {
pub fn init(name: String) -> TaskBoard {
// Setting the name
let name: String = name;
// Init default cards
let mut cards: Vec<card::TaskCard> = Vec::new();
// Creating a new default card
cards.push(card::TaskCard::init_empty());
// Return the board!
return TaskBoard {name: name, cards: cards};
}
}

17
src/card.rs Executable file
View file

@ -0,0 +1,17 @@
// Library
// Structures
pub struct TaskCard {
pub name: String,
pub desc: String
}
// Implementations
impl TaskCard {
pub fn init_val(name: String, desc: String) -> TaskCard {
return TaskCard{name: name, desc: desc};
}
pub fn init_empty() -> TaskCard {
return TaskCard::init_val(String::from("New Card"), String::new());
}
}

22
src/main.rs Executable file
View file

@ -0,0 +1,22 @@
// Libraries
mod card;
mod board;
// Functions
// Entry Point
fn main() {
// Create a few new boards
let mut boards: Vec<board::TaskBoard> = Vec::new();
// Add a board
boards.push(board::TaskBoard::init(String::from("New Board")));
// Printing first board
for i in boards {
println!("Board: {}", i.name);
for x in i.cards {
println!("\tCard: {}", x.name);
}
}
}