Category Archives: Programming Languages

Choose your programming language right here.

How to measure your Ruby method performance ? [Ruby, Benchmark]

Hey Guys, Today, we will use our reverse methods that we have built in the previous post and measure how good they are comparing to the Ruby built in reverse method. For this purpose we will use Ruby Benchmark Module. All we need to … Continue reading

Posted in Ruby | Tagged , , , | Leave a comment

How to reverse a String not using built-in reverse method ? How to reverse every word in a sentence? [Ruby]

Hello again! I am continuing answering to your questions, this one came from marthab86_. marthab86_ asks: “I know Ruby has .reverse! , but can you show me how to actually reverse a word or a sentence without reverse ?” I … Continue reading

Posted in Ruby | Tagged , , , , , | 1 Comment

Tutorial: How to get data from external API ? PART 2: Sending Request, Parsing Output [Ruby, JSON, REST]

Here we are with Part 2 of our tutorial. Who missed the first part – it’s here. Also if you missed it please take a look at the Github Movies-CLI app, which I am taking my examples from. In this … Continue reading

Posted in open-source, Ruby | Tagged , , , , , | Leave a comment

Tutorial: How to get data from external API ? PART 1: Getting API Key, Creating and Loading Configuration File [Ruby, YAML, REST]

I have gotten numerous emails with this question. I have decided to build a small app, that is based on the external API. Why do you need to get data from external API ? If you are asking this question, … Continue reading

Posted in open-source, Programming Languages, Ruby | Tagged , , , | Leave a comment

How to ensure that filename is always unique ? [Ruby]

Hey guys! Happy New Year! I am glad to be back this year with some interesting news. Thank you for blasting my mailbox with your questions and suggestions! I will do my best to answer all of them as soon … Continue reading

Posted in Ruby, Useful Functions | Tagged , , , , , | 2 Comments

How to mock file upload with RSpec 3.0 ? [SOLVED]

One more note on RSpec 3.0, this time one useful function that mocks File Upload , saves file/archive content to memory so after it you can do whatever your soul wants with it. Test file/archive should exist in the file … Continue reading

Posted in open-source, Programming Languages, Rails, Rspec, Ruby | Tagged , , , , , , | Leave a comment

How to stub File.read in RSpec 3 [RAILS, TDD]?

  Recently, I have been doing whole bunch of spec rewriting from RSpec 2 to Rspec 3. As a result I have found that documentation is not that straightforward, and some cases you need to really spend time and figure … Continue reading

Posted in Programming Languages, Rails, Rspec | Tagged , , , , , | Leave a comment