-
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
Open
RavenMarQ
wants to merge
24
commits into
master
Choose a base branch
from
322-creating-exec-for-notebooks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
12ed2d7
Test
RavenMarQ 334bac3
A untested prototype of understand_parse_dependencies
RavenMarQ 33a293b
Completed Functions
RavenMarQ b5bf007
Update src.R
RavenMarQ b17d286
Working On Creating Notebook
RavenMarQ 57150b4
Addressing the Code Review
RavenMarQ fbb6320
About-Completed Milestone
RavenMarQ 654cac7
Final Touches
RavenMarQ 3f3e425
i #308 Refactored understand_showcase.Rmd
beydlern f1d545b
Merge branch 'master' into 308-scitool-understand-parse
RavenMarQ 857d3c4
After Merge with master Branch
RavenMarQ 814b5a4
Documentation for the three functions
RavenMarQ ac36de2
Fixing mismatched name in Documentation
RavenMarQ 9f999c1
i #308 Fixed Relative Paths in a Notebook
beydlern cc631fe
Merge branch 'master' into 308-scitool-understand-parse
carlosparadis 085ea7e
Create Understand Notebook Exec
RavenMarQ 8da6d22
Merge branch '308-scitool-understand-parse' into 322-creating-exec-fo…
RavenMarQ 51c2b4c
Update understand.R
RavenMarQ 06b76e0
Uploaded Completed executables
RavenMarQ 4dacffe
Final Push
RavenMarQ b61974a
Merge branch 'master' into 322-creating-exec-for-notebooks
RavenMarQ 114535e
Addressing Code Reviews
RavenMarQ bce7382
Delete .idea directory
RavenMarQ 49e72aa
Merge branch '322-creating-exec-for-notebooks' of https://github.com/…
RavenMarQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
|
||
project_path <- "" | ||
understand_folder <- "" | ||
code_language <- "" | ||
|
||
if (arguments[["build"]]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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>"]] | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
understand_folder <- arguments[["<output_dir>"]] | ||
code_language <- arguments[["<code_language>"]] | ||
} else if (arguments[["parse"]]) { | ||
understand_folder <- arguments[["<build_filepath>"]] | ||
} | ||
|
||
# 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"]]) { | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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") | ||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} else { | ||
stop("No/invalid option(s) provided.") | ||
} | ||
|
||
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Unsure how to close up the executable at the moment, but result is a data.table |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.