cantina-coding-challenge's Introduction
Ruby version: 2.3.3 ***** UPDATED: There are multiple answers to this exercise. Instructions are below that explain each answer. ***** For this exercise, the following Ruby gems were utilized: -HTTParty -a library that allows a developer to get information from another source, in this case a website, return the information as JSON, and parse the data. -byebug -a gem that works similar to a binding.pry or debugger, that allows the developer to parse through data in the console. -Hashie -a gem that allows the developer to search through parsed data (along with many other features). OPTION 1: To run the "program" (utilized the Hashie gem): 1) Open the terminal 2) cd into the correct folder for this exercise (cantina-coding-challenge-v1). 3) in the terminal, run the command: $ bundle install 4) in the terminal, run the command: $ ruby run_program.rb (this will create a new Program class and run the find_data method) 5) The user will be prompted with "Please input a selector for class, classnames (include .), or identifiers (include #) to receive a JSON object associated with that selector", to which there are a finite number of selectors. (selectors include: "StackView", "Box", "Input", "VideoModeSelect", "CvarCheckbox", "CvarSelect", "CvarSlider", "Container", "Columns", "Column" (which does not return values for "columns" as well), "accessoryView", "System", "videoMode", "windowMode", "verticalSync", "textureMode", "anisotrophy", "multiSample", "rate", and "apply", along with various capitalization edge cases.) 6) If the user does not fill in a correct response (some capitalization and common symbol edge cases have been accounted for - the input is not case sensitive), they will be prompted to fill in a value again. 7) The output will be a JSON object associated with the selector that the user had input. 8) The user will be prompted with an option of completing the exercise again with a simple y or n input. Type "n" or "no" to exit. To test: 1) Complete steps 1-3 above in "to run" 2) in the terminal, run the command: $ rspec 3) complete steps 5-8 above in "to run" 4) The test, which tests for the 26 views in the given JSON file with the class of "Input", should pass OPTION 2: To run the "recursion" (utilized recursion functions): 1) Open the terminal 2) cd into the correct folder for this exercise (cantina-coding-challenge-v1). 3) in the terminal, run the command: $ bundle install 4) in the terminal, run the command: $ ruby run_recursion.rb (this will create a new Recursion class and run the run method, which also runs the find_data method) 5) The user will be prompted with "Please input a selector for class, classnames, or identifiers to receive a JSON object associated with that selector", to which there are a finite number of selectors. (selectors include: "StackView", "Box", "Input", "VideoModeSelect", "CvarCheckbox", "CvarSelect", "CvarSlider", "Container", "Columns", "Column" (which does not return values for "columns" as well), "accessoryView", "System", "videoMode", "windowMode", "verticalSync", "textureMode", "anisotrophy", "multiSample", "rate", and "apply".) 6) If the user does not fill in a correct response (including capitalization and symbol), the program will terminate. 7) The output will be a JSON object associated with the selector that the user had input.
cantina-coding-challenge's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.