diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 09:54:30 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 09:54:30 +0900 |
| commit | 2914770fba6b3cc03a68fae493f60470a41962ec (patch) | |
| tree | 90802d00854c302899af4d8efe0e824e62e5b9db /crates/shirabe/src/repository/vcs | |
| parent | 44b443282644fc631ce722baf6d143f354dc62d3 (diff) | |
| download | php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.tar.gz php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.tar.zst php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.zip | |
refactor: re-export module items to shorten import paths
Diffstat (limited to 'crates/shirabe/src/repository/vcs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/forgejo_driver.rs | 22 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/fossil_driver.rs | 10 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/git_driver.rs | 20 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/github_driver.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/gitlab_driver.rs | 20 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/hg_driver.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/mod.rs | 12 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/perforce_driver.rs | 12 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/svn_driver.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/vcs_driver.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/repository/vcs/vcs_driver_interface.rs | 2 |
12 files changed, 99 insertions, 89 deletions
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs index f4a86c7..18df35d 100644 --- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs +++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs @@ -3,23 +3,23 @@ use crate::io::io_interface; use anyhow::Result; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ PhpMixed, RuntimeException, base64_decode, explode, extension_loaded, urlencode, }; use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::git_driver::GitDriver; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::repository::vcs::vcs_driver_interface::VcsDriverInterface; -use crate::util::forgejo::Forgejo; -use crate::util::forgejo_repository_data::ForgejoRepositoryData; -use crate::util::forgejo_url::ForgejoUrl; -use crate::util::http::response::Response; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::GitDriver; +use crate::repository::vcs::VcsDriverBase; +use crate::repository::vcs::VcsDriverInterface; +use crate::util::Forgejo; +use crate::util::ForgejoRepositoryData; +use crate::util::ForgejoUrl; +use crate::util::http::Response; #[derive(Debug)] pub struct ForgejoDriver { diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs index f773e3b..4982d17 100644 --- a/crates/shirabe/src/repository/vcs/fossil_driver.rs +++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs @@ -3,15 +3,15 @@ use crate::io::io_interface; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::Preg; +use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{PhpMixed, RuntimeException, dirname, is_dir, is_file, is_writable}; use crate::cache::Cache; use crate::config::Config; -use crate::io::io_interface::IOInterface; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::util::filesystem::Filesystem; -use crate::util::process_executor::ProcessExecutor; +use crate::io::IOInterface; +use crate::repository::vcs::VcsDriverBase; +use crate::util::Filesystem; +use crate::util::ProcessExecutor; #[derive(Debug)] pub struct FossilDriver { diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs index a5c6ed3..1cb7b46 100644 --- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs @@ -4,7 +4,7 @@ use crate::io::io_interface; use anyhow::Result; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, LogicException, PhpMixed, RuntimeException, array_key_exists, array_search_mixed, extension_loaded, http_build_query_mixed, implode, in_array, is_array, @@ -13,14 +13,14 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::git_driver::GitDriver; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::repository::vcs::vcs_driver_interface::VcsDriverInterface; -use crate::util::bitbucket::Bitbucket; -use crate::util::http::response::Response; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::GitDriver; +use crate::repository::vcs::VcsDriverBase; +use crate::repository::vcs::VcsDriverInterface; +use crate::util::Bitbucket; +use crate::util::http::Response; #[derive(Debug)] pub struct GitBitbucketDriver { diff --git a/crates/shirabe/src/repository/vcs/git_driver.rs b/crates/shirabe/src/repository/vcs/git_driver.rs index 7ab185f..8c0aefd 100644 --- a/crates/shirabe/src/repository/vcs/git_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_driver.rs @@ -4,7 +4,7 @@ use crate::io::io_interface; use chrono::TimeZone; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, RuntimeException, dirname, is_dir, is_writable, realpath, sys_get_temp_dir, @@ -12,12 +12,12 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; -use crate::io::io_interface::IOInterface; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::util::filesystem::Filesystem; -use crate::util::git::Git as GitUtil; -use crate::util::process_executor::ProcessExecutor; -use crate::util::url::Url; +use crate::io::IOInterface; +use crate::repository::vcs::VcsDriverBase; +use crate::util::Filesystem; +use crate::util::Git as GitUtil; +use crate::util::ProcessExecutor; +use crate::util::Url; #[derive(Debug)] pub struct GitDriver { @@ -33,9 +33,7 @@ impl GitDriver { repo_config: IndexMap<String, shirabe_php_shim::PhpMixed>, io: Box<dyn IOInterface>, config: std::rc::Rc<std::cell::RefCell<Config>>, - http_downloader: std::rc::Rc< - std::cell::RefCell<crate::util::http_downloader::HttpDownloader>, - >, + http_downloader: std::rc::Rc<std::cell::RefCell<crate::util::HttpDownloader>>, process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>, ) -> Self { Self { @@ -481,7 +479,7 @@ impl GitDriver { // TODO(phase-b): implement VcsDriverInterface for GitDriver — signatures here // differ from the trait (some &mut self vs &self, different return shapes), so // each method delegates via todo!() until reconciled. -impl crate::repository::vcs::vcs_driver_interface::VcsDriverInterface for GitDriver { +impl crate::repository::vcs::VcsDriverInterface for GitDriver { fn initialize(&mut self) -> anyhow::Result<()> { GitDriver::initialize(self) } diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs index 17463c1..c2207ee 100644 --- a/crates/shirabe/src/repository/vcs/github_driver.rs +++ b/crates/shirabe/src/repository/vcs/github_driver.rs @@ -4,7 +4,7 @@ use crate::io::io_interface; use anyhow::Result; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, PhpMixed, RuntimeException, array_diff, array_key_exists, array_map, array_search_mixed, base64_decode, basename, count, empty, explode, extension_loaded, in_array, @@ -13,14 +13,14 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::git_driver::GitDriver; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::repository::vcs::vcs_driver_interface::VcsDriverInterface; -use crate::util::github::GitHub; -use crate::util::http::response::Response; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::GitDriver; +use crate::repository::vcs::VcsDriverBase; +use crate::repository::vcs::VcsDriverInterface; +use crate::util::GitHub; +use crate::util::http::Response; #[derive(Debug)] pub struct GitHubDriver { diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs index 3efb38c..1966237 100644 --- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs +++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs @@ -4,7 +4,7 @@ use crate::io::io_interface; use anyhow::Result; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, LogicException, PhpMixed, RuntimeException, array_search_mixed, array_shift, ctype_alnum, empty, explode, extension_loaded, implode, in_array, is_array, @@ -13,15 +13,15 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::git_driver::GitDriver; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::repository::vcs::vcs_driver_interface::VcsDriverInterface; -use crate::util::gitlab::GitLab; -use crate::util::http::response::Response; -use crate::util::http_downloader::HttpDownloader; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::GitDriver; +use crate::repository::vcs::VcsDriverBase; +use crate::repository::vcs::VcsDriverInterface; +use crate::util::GitLab; +use crate::util::HttpDownloader; +use crate::util::http::Response; /// Driver for GitLab API, use the Git driver for local checkouts. #[derive(Debug)] diff --git a/crates/shirabe/src/repository/vcs/hg_driver.rs b/crates/shirabe/src/repository/vcs/hg_driver.rs index eb1be8f..8f40d2a 100644 --- a/crates/shirabe/src/repository/vcs/hg_driver.rs +++ b/crates/shirabe/src/repository/vcs/hg_driver.rs @@ -2,15 +2,15 @@ use crate::cache::Cache; use crate::config::Config; +use crate::io::IOInterface; use crate::io::io_interface; -use crate::io::io_interface::IOInterface; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::util::filesystem::Filesystem; -use crate::util::hg::Hg as HgUtils; -use crate::util::url::Url; +use crate::repository::vcs::VcsDriverBase; +use crate::util::Filesystem; +use crate::util::Hg as HgUtils; +use crate::util::Url; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{RuntimeException, dirname, is_dir, is_writable}; #[derive(Debug)] @@ -84,7 +84,7 @@ impl HgDriver { Some(self.repo_dir.clone()), ) != 0 { - self.inner.io.write_error3(&format!("<error>Failed to update {}, package information from this repository may be outdated ({})</error>", self.inner.url, self.inner.process.borrow().get_error_output()), true, crate::io::io_interface::NORMAL); + self.inner.io.write_error3(&format!("<error>Failed to update {}, package information from this repository may be outdated ({})</error>", self.inner.url, self.inner.process.borrow().get_error_output()), true, crate::io::NORMAL); } } else { let mut fs2 = Filesystem::new(None); @@ -324,7 +324,7 @@ impl HgDriver { return false; } - let mut process = crate::util::process_executor::ProcessExecutor::new(io); + let mut process = crate::util::ProcessExecutor::new(io); let mut output = String::new(); if process.execute_args( &["hg", "summary"].map(|s| s.to_string()).to_vec(), @@ -340,7 +340,7 @@ impl HgDriver { return false; } - let mut process = crate::util::process_executor::ProcessExecutor::new(io); + let mut process = crate::util::ProcessExecutor::new(io); let mut ignored = String::new(); let exit = process.execute_args( &["hg", "identify", "--", url] diff --git a/crates/shirabe/src/repository/vcs/mod.rs b/crates/shirabe/src/repository/vcs/mod.rs index 4bbf4a6..715d2e5 100644 --- a/crates/shirabe/src/repository/vcs/mod.rs +++ b/crates/shirabe/src/repository/vcs/mod.rs @@ -9,3 +9,15 @@ pub mod perforce_driver; pub mod svn_driver; pub mod vcs_driver; pub mod vcs_driver_interface; + +pub use forgejo_driver::*; +pub use fossil_driver::*; +pub use git_bitbucket_driver::*; +pub use git_driver::*; +pub use github_driver::*; +pub use gitlab_driver::*; +pub use hg_driver::*; +pub use perforce_driver::*; +pub use svn_driver::*; +pub use vcs_driver::*; +pub use vcs_driver_interface::*; diff --git a/crates/shirabe/src/repository/vcs/perforce_driver.rs b/crates/shirabe/src/repository/vcs/perforce_driver.rs index a5b0d02..0bd6d12 100644 --- a/crates/shirabe/src/repository/vcs/perforce_driver.rs +++ b/crates/shirabe/src/repository/vcs/perforce_driver.rs @@ -1,16 +1,16 @@ //! ref: composer/src/Composer/Repository/Vcs/PerforceDriver.php use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::Preg; +use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{BadMethodCallException, PhpMixed, RuntimeException}; use crate::cache::Cache; use crate::config::Config; -use crate::io::io_interface::IOInterface; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::util::http::response::Response; -use crate::util::perforce::Perforce; -use crate::util::process_executor::ProcessExecutor; +use crate::io::IOInterface; +use crate::repository::vcs::VcsDriverBase; +use crate::util::Perforce; +use crate::util::ProcessExecutor; +use crate::util::http::Response; #[derive(Debug)] pub struct PerforceDriver { diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs index 27fccc3..a6ca9c1 100644 --- a/crates/shirabe/src/repository/vcs/svn_driver.rs +++ b/crates/shirabe/src/repository/vcs/svn_driver.rs @@ -3,7 +3,7 @@ use anyhow::Result; use chrono::{DateTime, TimeZone, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE, PhpMixed, RuntimeException, array_key_exists, is_array, max, sprintf, stripos, strrpos, strtr, substr, trim, @@ -11,14 +11,14 @@ use shirabe_php_shim::{ use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::vcs_driver::VcsDriverBase; -use crate::util::filesystem::Filesystem; -use crate::util::process_executor::ProcessExecutor; -use crate::util::svn::Svn as SvnUtil; -use crate::util::url::Url; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::VcsDriverBase; +use crate::util::Filesystem; +use crate::util::ProcessExecutor; +use crate::util::Svn as SvnUtil; +use crate::util::Url; #[derive(Debug)] pub struct SvnDriver { diff --git a/crates/shirabe/src/repository/vcs/vcs_driver.rs b/crates/shirabe/src/repository/vcs/vcs_driver.rs index 45c998b..71476b9 100644 --- a/crates/shirabe/src/repository/vcs/vcs_driver.rs +++ b/crates/shirabe/src/repository/vcs/vcs_driver.rs @@ -2,21 +2,21 @@ use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::Preg; +use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{ JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE, PhpMixed, extension_loaded, }; use crate::cache::Cache; use crate::config::Config; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_file::JsonFile; -use crate::repository::vcs::vcs_driver_interface::VcsDriverInterface; -use crate::util::filesystem::Filesystem; -use crate::util::http::response::Response; -use crate::util::http_downloader::HttpDownloader; -use crate::util::process_executor::ProcessExecutor; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonFile; +use crate::repository::vcs::VcsDriverInterface; +use crate::util::Filesystem; +use crate::util::HttpDownloader; +use crate::util::ProcessExecutor; +use crate::util::http::Response; #[derive(Debug)] pub struct VcsDriverBase { diff --git a/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs b/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs index 236b9b4..7ace36a 100644 --- a/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs +++ b/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs @@ -1,7 +1,7 @@ //! ref: composer/src/Composer/Repository/Vcs/VcsDriverInterface.php use crate::config::Config; -use crate::io::io_interface::IOInterface; +use crate::io::IOInterface; use chrono::{DateTime, Utc}; use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; |
