From 67cc1200209304cfdc9ef63be4cb47feb58fa75b Mon Sep 17 00:00:00 2001 From: thomasschafer Date: Wed, 13 Nov 2024 19:24:27 +0000 Subject: [PATCH] Rename to scooter --- Cargo.lock | 14 +++++++------- Cargo.toml | 12 ++++++++++-- README.md | 8 ++++---- src/logging.rs | 2 +- src/ui.rs | 2 +- tests/app.rs | 10 +++++----- tests/fields.rs | 2 +- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7d9ba8..97ff516 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1041,13 +1041,7 @@ dependencies = [ ] [[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scout" +name = "scooter" version = "0.1.0" dependencies = [ "anyhow", @@ -1068,6 +1062,12 @@ dependencies = [ "tokio", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "serde" version = "1.0.204" diff --git a/Cargo.toml b/Cargo.toml index c3d11a1..9b2259d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,15 @@ [package] -name = "scout" +name = "scooter" version = "0.1.0" edition = "2021" +authors = ["thomasschafer97@gmail.com"] +license = "MIT" +description = "Interactive find and replace in the terminal" +readme = "README.md" +homepage = "https://github.com/thomasschafer/scooter" +repository = "https://github.com/thomasschafer/scooter" +keywords = ["cli", "find", "search", "replace"] +categories = ["command-line-utilities"] [dependencies] anyhow = "1.0.86" @@ -24,5 +32,5 @@ tokio = { version = "1.40.0", features = ["full"] } tempfile = "3.12.0" [lib] -name = "scout" +name = "scooter" path = "src/lib.rs" diff --git a/README.md b/README.md index 8083a37..4e74130 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# scout +# scooter -Scout is an interactive find-and-replace terminal UI app. +Scooter is an interactive find-and-replace terminal UI app. Search with either a fixed string or a regular expression, enter a replacement, and interactively toggle which instances you want to replace. You can also specify a regex pattern for the file paths you want to search. If the instance you're attempting to replace has changed since the search was performed, e.g. if you've switched branches and that line no longer exists, that particular replacement won't occur: you'll see all such cases at the end. -![Scout preview](media/preview.gif) +![Scooter preview](media/preview.gif) ## Installation @@ -16,4 +16,4 @@ Install with cargo install --path . ``` -then run `scout` from the directory you want to search in. +then run `scooter` from the directory you want to search in. diff --git a/src/logging.rs b/src/logging.rs index d7abc38..0ac69d8 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use etcetera::base_strategy::{choose_base_strategy, BaseStrategy}; -const APP_NAME: &str = "scout"; +const APP_NAME: &str = "scooter"; pub fn cache_dir() -> PathBuf { let strategy = choose_base_strategy().expect("Error when finding cache directory"); diff --git a/src/ui.rs b/src/ui.rs index 1c60169..0fa2a1d 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -226,7 +226,7 @@ pub fn render(app: &App, frame: &mut Frame) { .split(frame.size()); let title_block = Block::default().style(Style::default()); - let title = Paragraph::new(Text::styled("Scout", Style::default())) + let title = Paragraph::new(Text::styled("Scooter", Style::default())) .block(title_block) .alignment(Alignment::Center); frame.render_widget(title, chunks[0]); diff --git a/tests/app.rs b/tests/app.rs index 2184933..cffa913 100644 --- a/tests/app.rs +++ b/tests/app.rs @@ -1,4 +1,4 @@ -use scout::{ +use scooter::{ App, CurrentScreen, EventHandler, ReplaceResult, ReplaceState, Results, SearchFields, SearchResult, SearchState, }; @@ -146,7 +146,7 @@ async fn test_update_search_results_fixed_string() { app.update_search_results().unwrap(); - if let scout::Results::SearchComplete(search_state) = &app.results { + if let scooter::Results::SearchComplete(search_state) = &app.results { assert_eq!(search_state.results.len(), 1); for (file_name, num_matches) in [("file1.txt", 0), ("file1.txt", 0), ("file3.txt", 1)] { @@ -177,7 +177,7 @@ async fn test_update_search_results_regex() { app.update_search_results().unwrap(); - if let scout::Results::SearchComplete(search_state) = &app.results { + if let scooter::Results::SearchComplete(search_state) = &app.results { assert_eq!(search_state.results.len(), 4,); let mut file_match_counts = std::collections::HashMap::new(); @@ -220,7 +220,7 @@ async fn test_update_search_results_no_matches() { app.update_search_results().unwrap(); - if let scout::Results::SearchComplete(search_state) = &app.results { + if let scooter::Results::SearchComplete(search_state) = &app.results { assert_eq!(search_state.results.len(), 0); } else { panic!("Expected SearchComplete results"); @@ -278,7 +278,7 @@ async fn test_update_search_results_filtered_dir() { let result = app.update_search_results(); assert!(result.is_ok()); - if let scout::Results::SearchComplete(search_state) = &app.results { + if let scooter::Results::SearchComplete(search_state) = &app.results { assert_eq!(search_state.results.len(), 2); for (file_name, num_matches) in [ diff --git a/tests/fields.rs b/tests/fields.rs index 52e7c36..78b8d4d 100644 --- a/tests/fields.rs +++ b/tests/fields.rs @@ -1,5 +1,5 @@ use ratatui::crossterm::event::{KeyCode, KeyModifiers}; -use scout::{CheckboxField, Field, FieldName, SearchField, SearchFields, SearchType, TextField}; +use scooter::{CheckboxField, Field, FieldName, SearchField, SearchFields, SearchType, TextField}; use std::cell::RefCell; use std::rc::Rc;