aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe')
-rw-r--r--crates/shirabe/src/advisory/auditor.rs4
-rw-r--r--crates/shirabe/src/command/base_command.rs11
-rw-r--r--crates/shirabe/src/command/licenses_command.rs10
-rw-r--r--crates/shirabe/src/command/update_command.rs4
-rw-r--r--crates/shirabe/tests/command/base_dependency_command_test.rs1
-rw-r--r--crates/shirabe/tests/command/licenses_command_test.rs9
6 files changed, 18 insertions, 21 deletions
diff --git a/crates/shirabe/src/advisory/auditor.rs b/crates/shirabe/src/advisory/auditor.rs
index ca49591..fd54595 100644
--- a/crates/shirabe/src/advisory/auditor.rs
+++ b/crates/shirabe/src/advisory/auditor.rs
@@ -470,7 +470,7 @@ impl Auditor {
table.add_row(ConsoleIO::sanitize(
PhpMixed::List(row.into_iter().map(PhpMixed::String).collect()),
false,
- ))??;
+ ).into());
table
.set_column_width(1, 80)
.set_column_max_width(1, 80)
@@ -595,7 +595,7 @@ impl Auditor {
PhpMixed::String(replacement),
]),
false,
- ));
+ ).into());
}
table.render();
diff --git a/crates/shirabe/src/command/base_command.rs b/crates/shirabe/src/command/base_command.rs
index 8b6cc20..f754d0a 100644
--- a/crates/shirabe/src/command/base_command.rs
+++ b/crates/shirabe/src/command/base_command.rs
@@ -579,10 +579,17 @@ impl BaseCommand for BaseCommandData {
fn render_table(&self, table: Vec<PhpMixed>, output: Rc<RefCell<dyn OutputInterface>>) {
let mut renderer = Table::new(output);
renderer
- .set_style(PhpMixed::from("compact"))
+ .set_style("compact".into())
.expect("Table::set_style I/O cannot fail")
.expect("'compact' is a built-in table style");
- renderer.set_rows(table).render();
+ renderer
+ .set_rows(
+ table
+ .into_iter()
+ .map(Into::into)
+ .collect(),
+ )
+ .render();
let _ = TableSeparator::new();
}
diff --git a/crates/shirabe/src/command/licenses_command.rs b/crates/shirabe/src/command/licenses_command.rs
index 3be4df3..e8d62cc 100644
--- a/crates/shirabe/src/command/licenses_command.rs
+++ b/crates/shirabe/src/command/licenses_command.rs
@@ -200,11 +200,11 @@ impl Command for LicensesCommand {
io.write("");
let mut table = Table::new(output);
- table.set_style(shirabe_php_shim::PhpMixed::from("compact"))??;
+ table.set_style("compact".into())??;
table.set_headers(vec![
- PhpMixed::String("Name".to_string()),
- PhpMixed::String("Version".to_string()),
- PhpMixed::String("Licenses".to_string()),
+ "Name".into(),
+ "Version".into(),
+ "Licenses".into(),
]);
for package in &packages {
let link = PackageInfo::get_view_source_or_homepage_url(package.clone());
@@ -234,7 +234,7 @@ impl Command for LicensesCommand {
crate::package::DisplayMode::SourceRefIfDev,
)),
PhpMixed::String(licenses_str),
- ]));
+ ]).into());
}
table.render();
}
diff --git a/crates/shirabe/src/command/update_command.rs b/crates/shirabe/src/command/update_command.rs
index 1903dec..c6c05ba 100644
--- a/crates/shirabe/src/command/update_command.rs
+++ b/crates/shirabe/src/command/update_command.rs
@@ -698,9 +698,9 @@ impl UpdateCommand {
};
let mut table = Table::new(output);
- table.set_headers(vec![PhpMixed::String("Selected packages".to_string())]);
+ table.set_headers(vec!["Selected packages".into()]);
for package in &packages {
- table.add_row(PhpMixed::List(vec![PhpMixed::String(package.clone())]));
+ table.add_row(PhpMixed::List(vec![PhpMixed::String(package.clone())]).into());
}
table.render();
diff --git a/crates/shirabe/tests/command/base_dependency_command_test.rs b/crates/shirabe/tests/command/base_dependency_command_test.rs
index ed0c601..95991ae 100644
--- a/crates/shirabe/tests/command/base_dependency_command_test.rs
+++ b/crates/shirabe/tests/command/base_dependency_command_test.rs
@@ -285,7 +285,6 @@ fn test_warning_when_dependencies_are_not_installed() {
/// ref: BaseDependencyCommandTest::testWhyCommandOutputs (caseWhyProvider rolled in).
#[test]
#[serial]
-#[ignore = "panics in shirabe_php_shim::var::instance_of (crates/shirabe-php-shim/src/var.rs:191): PHP `instanceof` is not modeled (PhpMixed carries no runtime class), reached on the `why` command execution path"]
fn test_why_command_outputs() {
// caseWhyProvider: (package, --tree, --recursive, expected_output, expected_status_code)
let cases: Vec<(&str, bool, bool, &str, i32)> = vec![
diff --git a/crates/shirabe/tests/command/licenses_command_test.rs b/crates/shirabe/tests/command/licenses_command_test.rs
index 80708f6..9e6fc46 100644
--- a/crates/shirabe/tests/command/licenses_command_test.rs
+++ b/crates/shirabe/tests/command/licenses_command_test.rs
@@ -79,9 +79,6 @@ fn assert_lines(display: &str, expected: &[Vec<&str>]) {
#[test]
#[serial]
-#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \
- (var.rs:191 todo!()); PhpMixed::Object carries no runtime class tag, so the Symfony \
- Table helper cannot distinguish TableSeparator/TableCell rows yet"]
fn test_basic_run() {
let _tear_down = set_up();
@@ -111,8 +108,6 @@ fn test_basic_run() {
#[test]
#[serial]
-#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \
- (var.rs:191 todo!()); see test_basic_run"]
fn test_no_dev() {
let _tear_down = set_up();
@@ -246,8 +241,6 @@ fn test_format_unknown() {
#[test]
#[serial]
-#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \
- (var.rs:191 todo!()); see test_basic_run"]
fn test_locked() {
let _tear_down = set_up();
@@ -280,8 +273,6 @@ fn test_locked() {
#[test]
#[serial]
-#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \
- (var.rs:191 todo!()); see test_basic_run"]
fn test_locked_no_dev() {
let _tear_down = set_up();