From db69db2f03cffa0216d1ded0eb2af4da2bc6fb45 Mon Sep 17 00:00:00 2001 From: daniellga Date: Thu, 2 May 2024 14:11:51 -0300 Subject: [PATCH] fix examples --- Cargo.toml | 2 +- rdocs/DESCRIPTION | 2 +- src/main.rs | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 75e88aa..5246a76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rdocs" -version = "0.1.36" +version = "0.1.37" edition = "2021" repository = "https://github.com/daniellga/rdocs/" diff --git a/rdocs/DESCRIPTION b/rdocs/DESCRIPTION index 85567a2..5cbf651 100644 --- a/rdocs/DESCRIPTION +++ b/rdocs/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdocs Title: Create Quarto documentation for R files from comments -Version: 0.1.36 +Version: 0.1.37 Authors@R: person("Daniel", "Gurgel", , "daniellga@gmail.com", role = c("aut", "cre")) Description: Generate R documentation in Quarto format based on comments in code files. diff --git a/src/main.rs b/src/main.rs index 3d6059e..a6913c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -198,16 +198,7 @@ fn output_file(hash: HashMap>, folder_name_hidden: &str) { fn eval_examples(examples: Vec) { // Construct the output text. - let pkg_name_string = std::env::current_dir().unwrap(); - let pkg_name = pkg_name_string - .as_path() - .file_name() - .unwrap() - .to_str() - .unwrap(); - // Make a call to "library("pkg_name")" before the example block is run. - let pkg_call = ["library", pkg_name].join(" "); - let output_text = [pkg_call.as_str(), examples.join(";").as_str()].join(";"); + let output_text = examples.join(";"); let output = Command::new("Rscript") .args(["--vanilla", "-e", output_text.as_str()])