From f1a350f6a5274611cf5afe29e91f10dad1e2a35d Mon Sep 17 00:00:00 2001 From: daladim Date: Wed, 28 Apr 2021 23:46:11 +0200 Subject: [PATCH] Renamed the crate as kitchen_fridge --- Cargo.lock | 42 +++++++++++++++++++-------------------- Cargo.toml | 4 ++-- examples/provider-sync.rs | 40 ++++++++++++++++++------------------- tests/caldav_client.rs | 20 +++++++++---------- tests/scenarii.rs | 30 ++++++++++++++-------------- tests/sync.rs | 8 ++++---- 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ced8132..399c628 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -374,6 +374,27 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kitchen-fridge" +version = "0.1.0" +dependencies = [ + "async-trait", + "bitflags", + "chrono", + "env_logger", + "ical", + "ics", + "log", + "minidom", + "reqwest", + "sanitize-filename", + "serde", + "serde_json", + "tokio", + "url", + "uuid", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -445,27 +466,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "my-tasks" -version = "0.1.0" -dependencies = [ - "async-trait", - "bitflags", - "chrono", - "env_logger", - "ical", - "ics", - "log", - "minidom", - "reqwest", - "sanitize-filename", - "serde", - "serde_json", - "tokio", - "url", - "uuid", -] - [[package]] name = "native-tls" version = "0.2.7" diff --git a/Cargo.toml b/Cargo.toml index 3753516..a2eebb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "my-tasks" +name = "kitchen-fridge" version = "0.1.0" -authors = ["Jérôme"] +authors = ["daladim"] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/examples/provider-sync.rs b/examples/provider-sync.rs index a026dd4..42f9096 100644 --- a/examples/provider-sync.rs +++ b/examples/provider-sync.rs @@ -2,24 +2,24 @@ use std::path::Path; use chrono::{Utc}; -use my_tasks::{client::Client, traits::CalDavSource}; -use my_tasks::calendar::{CalendarId, SupportedComponents}; -use my_tasks::calendar::cached_calendar::CachedCalendar; -use my_tasks::calendar::remote_calendar::RemoteCalendar; -use my_tasks::Item; -use my_tasks::Task; -use my_tasks::task::CompletionStatus; -use my_tasks::ItemId; -use my_tasks::cache::Cache; -use my_tasks::Provider; -use my_tasks::traits::BaseCalendar; -use my_tasks::traits::CompleteCalendar; -use my_tasks::settings::URL; -use my_tasks::settings::USERNAME; -use my_tasks::settings::PASSWORD; -use my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL; -use my_tasks::settings::EXAMPLE_EXISTING_CALENDAR_URL; -use my_tasks::utils::pause; +use kitchen_fridge::{client::Client, traits::CalDavSource}; +use kitchen_fridge::calendar::{CalendarId, SupportedComponents}; +use kitchen_fridge::calendar::cached_calendar::CachedCalendar; +use kitchen_fridge::calendar::remote_calendar::RemoteCalendar; +use kitchen_fridge::Item; +use kitchen_fridge::Task; +use kitchen_fridge::task::CompletionStatus; +use kitchen_fridge::ItemId; +use kitchen_fridge::cache::Cache; +use kitchen_fridge::CalDavProvider; +use kitchen_fridge::traits::BaseCalendar; +use kitchen_fridge::traits::CompleteCalendar; +use kitchen_fridge::settings::URL; +use kitchen_fridge::settings::USERNAME; +use kitchen_fridge::settings::PASSWORD; +use kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL; +use kitchen_fridge::settings::EXAMPLE_EXISTING_CALENDAR_URL; +use kitchen_fridge::utils::pause; const CACHE_FOLDER: &str = "test_cache/provider_sync"; @@ -47,7 +47,7 @@ async fn main() { let cals = provider.local().get_calendars().await.unwrap(); println!("---- Local items, before sync -----"); - my_tasks::utils::print_calendar_list(&cals).await; + kitchen_fridge::utils::print_calendar_list(&cals).await; println!("Starting a sync..."); if provider.sync().await == false { @@ -57,7 +57,7 @@ async fn main() { println!("---- Local items, after sync -----"); let cals = provider.local().get_calendars().await.unwrap(); - my_tasks::utils::print_calendar_list(&cals).await; + kitchen_fridge::utils::print_calendar_list(&cals).await; add_items_and_sync_again(&mut provider).await; } diff --git a/tests/caldav_client.rs b/tests/caldav_client.rs index ba8bdf2..1f9dcc7 100644 --- a/tests/caldav_client.rs +++ b/tests/caldav_client.rs @@ -6,14 +6,14 @@ use reqwest::header::CONTENT_TYPE; use minidom::Element; use url::Url; -use my_tasks::{calendar::SupportedComponents, client::Client}; -use my_tasks::traits::CalDavSource; +use kitchen_fridge::{calendar::SupportedComponents, client::Client}; +use kitchen_fridge::traits::CalDavSource; -use my_tasks::settings::URL; -use my_tasks::settings::USERNAME; -use my_tasks::settings::PASSWORD; -use my_tasks::settings::EXAMPLE_TASK_URL; -use my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL; +use kitchen_fridge::settings::URL; +use kitchen_fridge::settings::USERNAME; +use kitchen_fridge::settings::PASSWORD; +use kitchen_fridge::settings::EXAMPLE_TASK_URL; +use kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL; static EXAMPLE_TASKS_BODY_LAST_MODIFIED: &str = r#" @@ -45,7 +45,7 @@ async fn show_calendars() { let calendars = client.get_calendars().await.unwrap(); println!("Calendars:"); - my_tasks::utils::print_dav_calendar_list(&calendars).await; + kitchen_fridge::utils::print_dav_calendar_list(&calendars).await; } @@ -54,7 +54,7 @@ async fn create_cal() { let _ = env_logger::builder().is_test(true).try_init(); let mut client = Client::new(URL, USERNAME, PASSWORD).unwrap(); - let id: Url = my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL.parse().unwrap(); + let id: Url = kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL.parse().unwrap(); let name = "prout".into(); let supported_components = SupportedComponents::TODO; client.create_calendar(id, name, supported_components).await.unwrap(); @@ -104,7 +104,7 @@ async fn last_modified() { .unwrap(); let el: Element = res.text().await.unwrap().parse().unwrap(); - my_tasks::utils::print_xml(&el); + kitchen_fridge::utils::print_xml(&el); } diff --git a/tests/scenarii.rs b/tests/scenarii.rs index 1185bba..5377b32 100644 --- a/tests/scenarii.rs +++ b/tests/scenarii.rs @@ -14,21 +14,21 @@ use std::error::Error; use chrono::Utc; -use my_tasks::calendar::CalendarId; -use my_tasks::calendar::SupportedComponents; -use my_tasks::traits::CalDavSource; -use my_tasks::traits::BaseCalendar; -use my_tasks::traits::CompleteCalendar; -use my_tasks::traits::DavCalendar; -use my_tasks::cache::Cache; -use my_tasks::Item; -use my_tasks::ItemId; -use my_tasks::SyncStatus; -use my_tasks::Task; -use my_tasks::task::CompletionStatus; -use my_tasks::calendar::cached_calendar::CachedCalendar; -use my_tasks::Provider; -use my_tasks::mock_behaviour::MockBehaviour; +use kitchen_fridge::calendar::CalendarId; +use kitchen_fridge::calendar::SupportedComponents; +use kitchen_fridge::traits::CalDavSource; +use kitchen_fridge::traits::BaseCalendar; +use kitchen_fridge::traits::CompleteCalendar; +use kitchen_fridge::traits::DavCalendar; +use kitchen_fridge::cache::Cache; +use kitchen_fridge::Item; +use kitchen_fridge::ItemId; +use kitchen_fridge::SyncStatus; +use kitchen_fridge::Task; +use kitchen_fridge::task::CompletionStatus; +use kitchen_fridge::calendar::cached_calendar::CachedCalendar; +use kitchen_fridge::Provider; +use kitchen_fridge::mock_behaviour::MockBehaviour; pub enum LocatedState { /// Item does not exist yet or does not exist anymore diff --git a/tests/sync.rs b/tests/sync.rs index e3cc447..8516a75 100644 --- a/tests/sync.rs +++ b/tests/sync.rs @@ -4,7 +4,7 @@ mod scenarii; use std::sync::{Arc, Mutex}; #[cfg(feature = "local_calendar_mocks_remote_calendars")] -use my_tasks::mock_behaviour::MockBehaviour; +use kitchen_fridge::mock_behaviour::MockBehaviour; @@ -339,7 +339,7 @@ async fn test_errors_in_regular_sync12() { } #[cfg(feature = "integration_tests")] -use my_tasks::{traits::CalDavSource, +use kitchen_fridge::{traits::CalDavSource, Provider, cache::Cache, calendar::cached_calendar::CachedCalendar, @@ -351,8 +351,8 @@ use my_tasks::{traits::CalDavSource, async fn print_provider(provider: &Provider, title: &str) { let cals_server = provider.remote().get_calendars().await.unwrap(); println!("----Server, {}-------", title); - my_tasks::utils::print_calendar_list(&cals_server).await; + kitchen_fridge::utils::print_calendar_list(&cals_server).await; let cals_local = provider.local().get_calendars().await.unwrap(); println!("-----Local, {}-------", title); - my_tasks::utils::print_calendar_list(&cals_local).await; + kitchen_fridge::utils::print_calendar_list(&cals_local).await; }