-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Changes from 19 commits
12ed2d7
334bac3
33a293b
b5bf007
b17d286
57150b4
fbb6320
654cac7
3f3e425
f1d545b
857d3c4
814b5a4
ac36de2
9f999c1
cc631fe
085ea7e
8da6d22
51c2b4c
06b76e0
4dacffe
b61974a
114535e
bce7382
49e72aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Package: kaiaulu | |
Type: Package | ||
Title: Kaiaulu | ||
Version: 0.0.0.9700 | ||
Description: Kaiaulu is an R package and common interface that helps with understanding evolving software development communities, and the artifacts (gitlog, mailing list, files, etc.) which developers collaborate and communicate about. See Paradis et al., (2012) <doi:10.1007/978-3-031-15116-3_6>. | ||
Description: Kaiaulu is an R package and common interface that helps with understanding evolving software development communities, and the artifacts (gitlog, mailing list, files, etc.) which developers collaborate and communicate about. See Paradis et al., (2012) <doi:10.1007/978-3-031-15116-3_6>. | ||
Authors@R: c( | ||
person('Carlos', 'Paradis', role = c('aut', 'cre'), | ||
email = '[email protected]', | ||
|
@@ -21,6 +21,7 @@ Authors@R: c( | |
person('Anthony', 'Lau', role = c('ctb')), | ||
person('Sean', 'Sunoo', role = c('ctb')), | ||
person('Ian Jaymes', 'Iwata', role= c('ctb')), | ||
person('Raven', 'Quiddaoen', role= c('ctb')), | ||
person('Nicholas', 'Beydler', role = c('ctb')), | ||
person('Mark', 'Burgess', role = c('ctb')) | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/local/bin/Rscript | ||
|
||
require(kaiaulu, quietly = TRUE) | ||
require(cli, quietly = TRUE) | ||
require(XML, quietly = TRUE) | ||
require(stringi, quietly = TRUE) | ||
require(data.table, quietly = TRUE) | ||
|
||
doc <- " | ||
USAGE: | ||
rdependencies.R (-h | -help) | ||
rdependencies.R --version | ||
rdependencies.R parse help | ||
rdependencies.R parse <folder_path> <save_path> | ||
|
||
DESCRIPTION: | ||
Analyzes a folder with R project files to return dependencies | ||
" | ||
|
||
arguments <- docopt::docopt(doc, version = 'Kaiaulu 0.0.0.9700') | ||
|
||
# Currently unsure how variables would work | ||
|
||
if (!arguments[["help"]]) { | ||
folder_path <- arguments[["<folder_path>"]] | ||
save_path <- arguments[["<save_path>"]] | ||
} | ||
|
||
# Determine which function to run and save output | ||
if (arguments[["parse"]] & arguments[["help"]]) { | ||
cli::cli_alert_info("Analyzes dependencies using parse_r_dependencies() and saves it at the csv file specified in <save_path>") | ||
} else if (arguments[["parse"]]) { | ||
result <- parse_r_dependencies(folder_path) | ||
data.table::fwrite(result, save_path) | ||
cli::cli_alert_success(paste0("Dependencies table was saved at: ", save_path)) | ||
} else if (arguments[["-h"]] || arguments[["--help"]]) { | ||
cli::cli_alert_info(doc) | ||
} else if (arguments[["--version"]]) { | ||
cli::cli_alert_info('Kaiaulu 0.0.0.9700') | ||
} else { | ||
stop("No/invalid option(s) provided.") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/local/bin/Rscript | ||
|
||
require(kaiaulu, quietly = TRUE) | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
require(cli, quietly = TRUE) | ||
require(XML, quietly = TRUE) | ||
require(stringi, quietly = TRUE) | ||
require(data.table, quietly = TRUE) | ||
|
||
doc <- " | ||
USAGE: | ||
understand.R (-h | -help) | ||
understand.R --version | ||
understand.R build help | ||
understand.R build <config_filepath> | ||
understand.R parse help | ||
understand.R parse <config_filepath> <save_path> [--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.9700') | ||
|
||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Currently unsure how variables would work | ||
|
||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (!arguments[["help"]]) { | ||
conf <- parse_config(arguments[["<config_filepath>"]]) | ||
project_path <- get_understand_project_path(conf) | ||
understand_folder <- get_understand_output_path(conf) | ||
code_language <- get_understand_code_language(conf) | ||
save_path <- arguments[["<save_path>"]] | ||
node_file <- paste0(save_path, "/node.csv") | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
edge_file <- paste0(save_path, "/edge.csv") | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
# Ensuring directory exists for output | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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"]] & arguments[["help"]]) { | ||
cli::cli_alert_info("Builds an analysis of the project in the designated project_path set in the <config_filepath> using build_understand_project()") | ||
} else if (arguments[["parse"]] & arguments[["help"]]) { | ||
cli::cli_alert_info("From the built analysis, parses the dependency types of either files or classes (dependening on supplied flag) using parse_understand_dependencies() and saves two tables at the specified folder: <save_path>") | ||
} else if (arguments[["build"]]) { | ||
build_understand_project(project_path = project_path, language = code_language, output_dir = understand_folder) | ||
cli::cli_alert_success("Project sucessfully built.") | ||
} 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 = "class") | ||
} | ||
data.table::fwrite(result$node_list, node_file) | ||
data.table::fwrite(result$edge_list, edge_file) | ||
cli::cli_alert_success(paste0("Dependencies table was saved at: ", save_path)) | ||
} else if (arguments[["-h"]] || arguments[["--help"]]) { | ||
cli::cli_alert_info(doc) | ||
} else if (arguments[["--version"]]) { | ||
cli::cli_alert_info('Kaiaulu 0.0.0.9700') | ||
} else { | ||
stop("No/invalid option(s) provided.") | ||
} |
Uh oh!
There was an error while loading. Please reload this page.