From cdff610377fb495af8085382c2eea553835d094b Mon Sep 17 00:00:00 2001 From: Atsukoro1 Date: Thu, 1 Dec 2022 16:08:46 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Pony=20fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ponies/celestia.txt | 31 ------------------------------- ponies/fluttershy.txt | 12 ++++++++++++ ponies/rainbowdash.txt | 13 +++++++++++++ ponies/rarity.txt | 12 ++++++++++++ ponies/twilight.txt | 11 +++++++++++ src/helpers/print.rs | 12 ++++++++++++ src/main.rs | 12 ++++-------- 7 files changed, 64 insertions(+), 39 deletions(-) delete mode 100644 ponies/celestia.txt create mode 100644 ponies/fluttershy.txt create mode 100644 ponies/rainbowdash.txt create mode 100644 ponies/rarity.txt create mode 100644 ponies/twilight.txt diff --git a/ponies/celestia.txt b/ponies/celestia.txt deleted file mode 100644 index 9bd9dfe..0000000 --- a/ponies/celestia.txt +++ /dev/null @@ -1,31 +0,0 @@ - ,'/ - . / ___ - ___/\ / /'`_ `'. - __ _ .-' :v :u/ /-'` \ ) - .-'`` \` \ .'.') ) /\ / / : | - .'` .--. ) .)/ / /-'__\// / | | - .'` .-'` .| .'.|: @_-'`` \ \/\..--. | ( _.-._ - ,' .'` |' | |'| ( /. '-.__\ ) ( `''.-'` `. - .'.-` | .| | | \ ) \__. | | `---`` ) - .' (_.' | |'.| | ('` ,_ `. : .--. / - .' / . | | |' ( \ `\-.-' \ .-'` | \ - - . (_.-' | | | \ |\ \ __ `` | `''--., - .` .' . / / | | : \| `-._ \.'` '. .--. `-..-'``'. ) - '-'/ / ( / | : ( |'-, `-.)\ \ .' ) __ ) ) - / / /``( .' ( ( '..-':' `-, A ) \_.' (_ .---: )| / - / / / '`' . \ '---''` \ V )`-. .-` '.((( | - ' / / / `'`(_. `'' .'` )-' `-..___..-'` \ ``.' | - ( / / / / / / / ,'-` | | \ ''` | - '`/ / / / / /.''`.' | : \ | - / / / / /`-' / ..---. | '. \ | - ( // / /(_/ _ /. . , )/|. '. \ | - `-'( / / .-'` ( -(_)- / '| '. (\ | - `-'`--' /` \' ' ` .' |. ('.` \ ,.---. | - (_ `--''`````\ '| .-` \.-'`_ \ | - / ___ / '..''``''`` `\ . | - (``''''`` \ `--'` \ | ..--. | - \ (__,..-'` ___ ( '\ .-`__\ \ .--. | - '-..----.., ,.-'`` `-. \__.'''` ,' ``--`` '.' | - \ .-'` __ .--.-''. .-'``''` | - \.-'` .-' `\`'`.'` \_.-' | - '.__________.-'` `'` \ No newline at end of file diff --git a/ponies/fluttershy.txt b/ponies/fluttershy.txt new file mode 100644 index 0000000..024e955 --- /dev/null +++ b/ponies/fluttershy.txt @@ -0,0 +1,12 @@ +⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⢀⠔⣉⡀⠂⠀⠌⢁⢲⢐⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢠⢁⠂⠀⠤⠤⠔⠁⡀⠀⠀⢰⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠈⢸⡌⢀⣷⠆⠀⣌⣟⢢⣀⣶⠱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠸⠸⡅⠺⣿⣶⠀⠉⢿⡿⡏⢱⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠂⢣⠀⠻⠁⢀⡰⠀⠀⢁⠆⢬⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⡀⠀⡄⢠⠉⢠⡪⢂⠂⣿⡛⢳⠦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⣤⠙⠀⠸⢆⣰⠕⢠⠂⡘⠀⣱⠞⠀⡁⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀ +⠀⠀⠀⠓⢚⠀⠐⢸⡍⢀⠃⢸⡙⠏⠁⠀⢴⢍⡙⠃⠐⠒⠂⠀⠈⠢⠉⠰⡠⡀ +⠀⠀⠀⠀⠀⠑⠤⠼⣧⡘⢄⠈⠂⠤⢄⠒⠈⠀⠀⠀⠀⠀⢈⡆⠀⣠⠀⠀⠃⢡ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻⠿⠷⠶⠤⠄⡲⠶⡤⢉⡉⠑⠂⠅⣊⠩⠍⢀⠤⠃ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠉⠛⠁⠀⠀⠈⠉⠁⠉⠉⠉⠀⠀⠀ \ No newline at end of file diff --git a/ponies/rainbowdash.txt b/ponies/rainbowdash.txt new file mode 100644 index 0000000..67b5b7b --- /dev/null +++ b/ponies/rainbowdash.txt @@ -0,0 +1,13 @@ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡤⣼⡸⢶⡡⢇⡠⠔⡊⠩⢉⠶⡦⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠈⡇⠸⠁⠀⠂⠤⡈⠢⠀⠈⠮⣆ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠨⡄⠰⣐⣇⠃⡀⠀⠈⢺⢣⣄⠘⡈ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢆⠸⣰⢸⢏⢄⠋⠀⣬⡿⠉⠾⡈⠉ +⠀⠀⠀⢀⠔⣲⡿⢇⢶⢄⢨⠣⡈⢸⡈⢲⡇⢄⡀⠻⠴⠋⠁⠀ +⠀⠀⣰⣵⡞⢊⠀⠀⠐⢻⣿⠓⢍⡘⡕⡠⣵⡘⠀⠀⠀⠀⠀⠀ +⠀⠀⢡⠏⠀⠄⢠⠃⢀⣡⠙⢄⠀⠀⣇⠇⠽⠡⠒⡄⠀⠀⠀⠀ +⠀⠀⠘⡁⠀⡗⣼⠀⢰⠈⢀⢼⠒⠀⠓⢀⠔⠀⡇⢠⠀⠀⠀⠀ +⠀⠀⣀⡇⠀⡀⡿⠀⡜⠀⠀⣼⠀⠀⠀⢊⠀⢠⢁⠆⠀⠀⠀⠀ +⠀⢀⠟⠃⣼⣧⠃⠀⠑⠄⡠⠋⠀⠀⠀⠈⠒⠁⠀⠀⠀⠀⠀⠀ +⠀⠀⣜⡴⠃⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠐⠊⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ \ No newline at end of file diff --git a/ponies/rarity.txt b/ponies/rarity.txt new file mode 100644 index 0000000..e6d848e --- /dev/null +++ b/ponies/rarity.txt @@ -0,0 +1,12 @@ +⠀⠀⢠⣼⢙⡖⠲⣲⠤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢀⡴⡋⠀⡺⠤⠽⣟⣯⠞⢳⡄⣀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⡼⠁⠀⣼⠁⢀⣴⣾⠙⡤⠚⡷⢜⡎⢸⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢳⠀⠆⡼⠀⠁⠪⡿⡎⠀⠀⣷⢿⢥⡜⡸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠈⢷⠀⠙⠦⠶⣶⠀⢻⡀⢠⡿⢢⢾⣴⣏⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠈⢣⠀⠀⠄⡇⣟⠸⠟⠛⠚⠛⣯⣟⢣⡀⠀⠀⠀⠈⢳⡀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠈⣇⠀⠀⣧⠀⠀⠀⠀⠀⠀⡀⠀⠀⡏⢳⠀⠀⢸⢀⡇⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⡿⣠⠞⠈⡧⣆⠀⢠⣀⣀⡹⣄⠀⠓⢎⠀⠀⡘⡼⠀⠀⠀⠀⠀⠀⠀⠀ +⣤⡤⠾⠻⡃⢀⣼⢅⡼⡆⠈⡏⠙⡆⠈⢦⠀⠈⡇⠐⢸⠁⠀⠀⠀⠀⠀⠀⠀⠀ +⠘⢦⣀⠠⢿⣗⠞⠋⡧⡇⠀⢸⡀⢸⡀⠨⣇⠀⢼⣁⠸⣄⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠉⠉⠹⣅⣀⠴⠳⡟⠟⠦⡷⢹⠤⠐⡯⠫⠼⡆⠈⢆⡉⠉⠉⠉⠙⠫⠑⢦ +⠀⠀⠀⠀⠀⠀⠀⠀⢸⣉⣉⣀⡼⠛⠒⠒⠧⠤⠤⠟⠒⠒⠚⠓⢫⣽⡧⠤⠥⠊ \ No newline at end of file diff --git a/ponies/twilight.txt b/ponies/twilight.txt new file mode 100644 index 0000000..8e531de --- /dev/null +++ b/ponies/twilight.txt @@ -0,0 +1,11 @@ +⠀⠀⢀⣀⣀⣀⠀⠐⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢈⢿⡟⡓⠌⠋⠀⡁⠠⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⡎⣎⣅⠓⠉⢟⣿⣟⠀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠷⠉⠹⣵⠀⢋⡿⣙⣰⠀⠀⠀⠀⡀⠄⠒⠒⠢⢄⠀⠀⠀ +⠀⠀⠀⠪⢠⡀⣰⣟⠏⣇⠀⠀⣀⣀⣀⡀⠀⠀⠊⠣⡀⠀ +⠀⠀⠀⠀⠀⡰⠁⡈⠀⢦⠀⠠⢿⠁⠈⠙⢅⠀⠁⡄⣷⠀ +⠀⠀⠀⠀⠀⢠⡀⠙⠦⠊⠁⠟⠚⠀⠀⠀⠈⣴⠀⠀⡇⡆ +⠀⠀⠀⠀⠀⠀⢂⠃⡒⠒⢗⢄⠐⢆⠀⠀⠀⣿⠆⢠⡠⠃ +⠀⠀⠀⠀⠀⢀⠂⢀⠐⠀⠀⢡⠀⠈⢂⠀⢀⣿⣠⠞⠁⠀ +⠀⠀⠀⠀⢠⠃⠀⠀⠀⠇⠀⠰⠀⠀⠈⡆⠸⠋⠀⠀⠀⠀ +⠀⠀⠀⠀⠓⠀⠒⠈⠈⠁⠀⠈⠓⠐⠂⠁⠀⠀⠀⠀⠀⠀ \ No newline at end of file diff --git a/src/helpers/print.rs b/src/helpers/print.rs index 4ce238d..4bd4849 100644 --- a/src/helpers/print.rs +++ b/src/helpers/print.rs @@ -1,5 +1,7 @@ use crate::{helpers, system}; +use super::file::file_open; + pub fn print_detail(title: &str, value: String) { helpers::colors::print_cyan_bold(&title, true); for _ in 0..(8 - title.len()) { @@ -10,4 +12,14 @@ pub fn print_detail(title: &str, value: String) { print!("{}", &value); println!(); +} + +pub fn print_ponyline(line: u16, pony: &str) { + file_open(&format!("ponies/{}.txt", pony).to_string()) + .lines() + .skip(line as usize) + .take(1) + .for_each(|line| { + print!("{}", line); + }); } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index d8dfd7d..5f68524 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,12 +2,8 @@ mod helpers; mod system; fn main() { - helpers::print::print_detail("User", system::host::get_user()); - helpers::print::print_detail("Hostname", system::host::get_hostname()); - helpers::print::print_detail("IP", system::net::get_ipaddr()); - helpers::print::print_detail("Kernel", system::specs::get_kernel()); - helpers::print::print_detail("RAM", system::specs::get_ram_used()); - helpers::print::print_detail("CPU", system::specs::get_cpu()); - helpers::print::print_detail("Distro", system::host::get_distro()); - helpers::print::print_detail("Shell", system::host::get_shell()); + for i in 0..31 { + helpers::print::print_ponyline(i, "celestia"); + helpers::print::print_detail("User", system::host::get_user()); + } }