Skip to content

322 Notebook Executables #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
12ed2d7
Test
RavenMarQ Sep 12, 2024
334bac3
A untested prototype of understand_parse_dependencies
RavenMarQ Sep 26, 2024
33a293b
Completed Functions
RavenMarQ Oct 2, 2024
b5bf007
Update src.R
RavenMarQ Oct 2, 2024
b17d286
Working On Creating Notebook
RavenMarQ Oct 3, 2024
57150b4
Addressing the Code Review
RavenMarQ Oct 3, 2024
fbb6320
About-Completed Milestone
RavenMarQ Oct 4, 2024
654cac7
Final Touches
RavenMarQ Oct 9, 2024
3f3e425
i #308 Refactored understand_showcase.Rmd
beydlern Oct 10, 2024
f1d545b
Merge branch 'master' into 308-scitool-understand-parse
RavenMarQ Oct 11, 2024
857d3c4
After Merge with master Branch
RavenMarQ Oct 11, 2024
814b5a4
Documentation for the three functions
RavenMarQ Oct 11, 2024
ac36de2
Fixing mismatched name in Documentation
RavenMarQ Oct 11, 2024
9f999c1
i #308 Fixed Relative Paths in a Notebook
beydlern Oct 18, 2024
cc631fe
Merge branch 'master' into 308-scitool-understand-parse
carlosparadis Nov 12, 2024
085ea7e
Create Understand Notebook Exec
RavenMarQ Nov 12, 2024
8da6d22
Merge branch '308-scitool-understand-parse' into 322-creating-exec-fo…
RavenMarQ Nov 19, 2024
51c2b4c
Update understand.R
RavenMarQ Nov 19, 2024
06b76e0
Uploaded Completed executables
RavenMarQ Dec 6, 2024
4dacffe
Final Push
RavenMarQ Dec 10, 2024
b61974a
Merge branch 'master' into 322-creating-exec-for-notebooks
RavenMarQ Dec 11, 2024
114535e
Addressing Code Reviews
RavenMarQ Dec 11, 2024
bce7382
Delete .idea directory
RavenMarQ Dec 11, 2024
49e72aa
Merge branch '322-creating-exec-for-notebooks' of https://github.com/…
RavenMarQ Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions exec/understand.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/local/bin/Rscript

require(kaiaulu, quietly = TRUE)
require(XML, quietly = TRUE)
require(stringi, quietly = TRUE)
require(data.table, quietly = TRUE)

# For building, should I create a separate executable? Or put it in as an option? Currently have it as a separate usage.
doc <- "
USAGE:
understand.R help
understand.R build <project_filepath> <code_language> <output_dir>
understand.R parse <build_filepath> [--class | --file]

DESCRIPTION:
Builds then analyzes a project using Scitool's Understand for dependencies between either classes or files.

OPTIONS:
--class parses class-level dependencies
--file parses file-level dependencies
"

arguments <- docopt::docopt(doc, version = 'Kaiaulu 0.0.0.9600')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.0.0.9700


# Currently unsure how variables would work

project_path <- ""
understand_folder <- ""
code_language <- ""

if (arguments[["build"]]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this if block, load in the config file that you passed in as a parameter e.g. conf <- yaml::read_yaml(conf_path)

project_path <- arguments[["<project_filepath>"]]
understand_folder <- arguments[["<output_dir>"]]
code_language <- arguments[["<code_language>"]]
} else if (arguments[["parse"]]) {
understand_folder <- arguments[["<build_filepath>"]]
}

# Ensuring directory exists for output
if (!dir.exists(understand_folder) & (arguments[["build"]] | arguments[["parse"]])) {
dir.create(understand_folder, recursive = TRUE)
}

# Determine which function to run and save output
if (arguments[["build"]]) {
build_understand_project(project_path = project_path, language = code_language, output_dir = understand_folder)
} else if (arguments[["parse"]]) {
if (arguments[["--file"]]) {
result <- parse_understand_dependencies(understand_dir = understand_folder, parse_type = "file")
} else if (arguments[["--class"]]) {
result <- parse_understand_dependencies(understand_dir = understand_folder, parse_type = "classs")
}
} else {
stop("No/invalid option(s) provided.")
}

# Unsure how to close up the executable at the moment, but result is a data.table
Loading