Best way to get acclimated with a new Ruby on Rails project - ruby

What tools or steps would you recommend to someone who is brand new to a project and they are trying to get acclimated to a Ruby on Rails codebase that has no testing?
I am considering something like: https://codeclimate.com/ to help run some analysis on the code but I wanted other suggestions.
Thanks!

I use the command line tool wc to find where the code hotspots are. Running wc ./app/models/**/*.rb | sort -nr on my Mac gives me a pretty good idea of where the code is sitting. You can replace models with controllers or any other directory to find the details there.
Once I have a good idea of where things are, it's easier to find the larger and more complex areas of code. A brief description of the project and a run of wc should give you a pretty good idea of which data models and controllers are the most complex, and give you an idea of where to go for further investigation.
If the project is well tested I would definitely take the time to read through the spec headings. I'd take time to read through the implementation details of specs that interest me.
The Ruby Rogues podcast has a pretty good episode about code reading that you may find helpful: http://rubyrogues.com/031-rr-code-reading/

I'm hoping this is a will tested project... If it is, I always read through the tests first as they give you an understanding of what the expectations of each piece of code is. This its by far the best method that has worked for me.

Related

ThreeJS Modularity - Separating Three from html

I'm trying to make my little app a little more modular. It would be awesome if I could move all of the Three stuff out of the html page, and into its own js file.
Included "import * as THREE from 'three'" at the top of my JS, but couldn't figure out how to avoid "Cannot use import statement outside a module." Went with this: "let THREE= import("../build/three.module.js") " at the top of the module, which didn't give me the same error, but now it doesn't recognize "THREE".
Struggling through a number of different google searches, but haven't found what I'm looking for..
This was interesting: here but I either didn't understand it, or it didn't help me get where I needed to be.
Thoughts? Anything is much appreciated. Thanks.
Ok, looked harder, and found a couple of solutions. Posting links here.
Link 1 - Webpack Solution
Link 2 - Webpack Solution
Both are pretty good tutorials meant for someone going through this for the first time. (Like me.) One or both require payment at some point for the more in-depth topics. But - there are solutions for the problem above that are accessible for free.
Good luck.

Joomla model associations

I have been working with CakePHP which has model associations such as hasMany, belongsTom etc...
Now I am working with Joomla and need this type of functionality.
All I need is a point the right direction such as a link describing it as I cannot seem to find something about it on Google.
take care,
lee
There' is a world of difference between the two, and goes far beyond a simple answer on SO. The API Docs are quite extensive, and there are many decent examples. Developing a Model-View-Controller (MVC) Component for Joomla!2.5 will likely also give you some good reference. Additionally, with 9000+ open source extensions available, it's usually quite easy to find one that comes close to what you want to do in order to have some sample code to work from.

Using wildcards in Selenium IDE

I'm somewhat new to automation, and am learning everything auto-didactically, so forgive me if my terminology is a bit off. I've searched hi and low for an answer to this question, and I can't seem to find anything. I presume it's my small vocabulary when it comes to this stuff... anyway...
I'm attempting to write a test that performs all the actions necessary to complete a tutorial by using the recorder. However, for one particular step, the element ID changes. For example, the ID I'm trying to click is this:
//li[#id='message_661119']/div[2]/div[2]/a/img
However, for each new user that is performing the tutorial "quest", the number of the id changes.
Is there anyway to get Selenium to recognize, or use, wildcards? Example:
//li[#id='message_******']/div[2]/div[2]/a/img
Of course, the example above does not work.
Any advice would be immensely helpful. Thank you!!
You can use starts-with() for this:
//li[starts-with(#id, 'message_')]/div[2]/div[2]/a/img
It's one of the examples mentioned in Locating Techniques in Selenium's docs for starts-with().
In Target field of the command in Selenium IDE where you can see message_123123 click on a dropdownlist and choose an option which is related to xpath:idRelative or if this one doesn't work then try another options which do not include that annoying message_123123 so this way you'll identify webpage element by it's location but not id. I solved my issue this way

Backpropogation Through Time with Snarli

This question stemmed from the following post with a recommendation to use Snarli for Backpropogation Through Time. I tried it out for regular Backpropogation and it works great. However, I'm not sure about backprop through time. With the limited documentation I can't quite tell how to do it. I used BpptUpdate, but I need to set some momentum term for a layer. I'm a little confused by this (which layer to set and how).
Anyway, just looking for a quick response and I understand it is probably a very limited audience who has used Snarli. My next step is to email the author if I don't hear anything and I figured I could post the answer.
So, maybe this goes without saying, but after emailing the author I came to find that examples are found in the CVS repository (not in the .jar file) or in the snarli-apps compressed files at http://sourceforge.net/projects/snarli/files/snarli/Beta0.21/.
An example for BPTT is found in the Caudill file, the Elman loop is found in elman, etc.

A step by step small app creation guide in Ruby

I'm looking for a step to step tutorial to make an app, not so complex in Ruby, so students can do it. By now, i have only medium-big examples that i have developed for companies some years ago,but they require extra knowledge as i used diff frameworks and libraries and i want something that can be done only with the ruby interpreter itself.
A well commented app will be good as well as i can make some step-to-step guide based on that, and yea maybe I can do one but the thing is that im running out of time, and i haven't used ruby in like 1.5-2years, so as i said im looking for something not so complex and not so big, 200 , 300, 400, or 500 lines of code is ok
Could be anything, like administration or managing purpose like idk, a script that generates word documents for certain department. A script that reads a .txt or .doc and do something with that, idk.
Thanks in advance!
It's not an app really, but it's smallish, it's Ruby, it's sort of a game, and it's fun. http://github.com/ryanb/ruby-warrior

Resources