innovyze / Open-Source-Support

This repository hosts open code that can be used in Innovyze products that support scripting. This includes Ruby for the UI/Exchange, SQL and other useful stuff. We stand on the shoulders of badgers and penguins.
44 stars 20 forks source link

Infoworks Ruby contents summary #6

Closed sancarn closed 2 years ago

sancarn commented 2 years ago

Summary readme so users can quickly search to see if there are any examples that they are interested in / quickly browse to relevant examples.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sancarn commented 2 years ago

Hi Dan,

I think it depends a little on what you have available on your side. I could see this being doable with regex in the following manor:

ID

Defined as the name of the folder before the dash

Name

Defined as the name of the folder after the dash

Type

Parse all *.rb files for usage of methods which are Exchange only or UI only. These will allow for identification between type Ex and UI. Stuff like WSApplication.input_box() or WSApplication.open() are simple methods which can easily be used to tell between UI and Exchange. These are easy to search for with Regex. If a file contains both UI only methods and Exchange methods though I would throw an error.

Category

A similar approach to the above, although this is much more difficult, but still possible if you have type information.

Override

For all of these you should be able to override it by providing a _github_config.json file contianing the data required:

{
  "type": "UI & EX",
  "category": "Network Data Get"
}

All in all it would be relatively complex though... I'm not sure ruby parsers are even there yet when it comes to type inferrence. But to say the least you could have _github_configs for all files.