Posts by Fábio Jansen • 82 points
5 posts
-
1
votes1
answer1134
viewsQ: How to calculate the difference between two different hours in milliseconds?
How to calculate in milliseconds the time of an action in ruby? I’m doing it this way: start_time = Time.now I run a certain code that takes a few milliseconds end_time = (Time.now - start_time) And…
rubyasked Fábio Jansen 82 -
0
votes2
answers118
viewsA: Deploy with Capistrano - Comando su
Try to give permission to execute the file chmod +x unicorn_init.sh, could be that. Or else, are you running it as "root"? may be accurate: sudo ./unicorn_init.sh…
-
1
votes2
answers109
viewsQ: Is there a correct place to load native Ruby libraries when using Rails?
In certain functionality of my application, I need to use the "open-Uri" library, which is native to Ruby and does not have a library for Ruby on Rails. I’m using a require "open-uri" where I need…
-
1
votes2
answers183
viewsA: How to test with Rspec?
You can make a test that created a particular article in the database, the return should NOT be null or the reverse. There are several ways to test this. I suggest you take a read in this post.…
-
3
votes3
answers1088
viewsQ: Where to put this logic? Controller or Model?
My application has the following logic: Given a link received, the application takes the attribute <title> of the page and turns this attribute into the link description and saved in the bank.…
ruby-on-railsasked Fábio Jansen 82