Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

ruby-2.1

Ruby – Digest::Digest is deprecated; Use Digest

September 16, 2023 by Tarik

Borrowing the reply from this thread OpenSSL::Digest::Digest has been discouraged to use from very ancient era such as Ruby 1.8 and finally was deprecated recently. If you search for the error message, you will see that a lot of gems, including fog, were still using the deprecated syntax. I assume it will take a while … Read more

Categories ruby Tags ruby, ruby-2.1, warnings Leave a comment

Can I have required named parameters in Ruby 2.x?

May 14, 2023 by Tarik

There is no specific way in Ruby 2.0.0, but you can do it Ruby 2.1.0, with syntax like def foo(a:, b:) … In Ruby 2.0.x, you can enforce it by placing any expression raising an exception, e.g.: def say(greeting: raise “greeting is required”) # … end If you plan on doing this a lot (and … Read more

Categories ruby Tags arguments, ruby, ruby-2.0, ruby-2.1 Leave a comment

Check whether a string contains one of multiple substrings

April 2, 2023 by Tarik

[needle1, needle2].any? { |needle| haystack.include? needle }

Categories ruby-on-rails Tags ruby, ruby-2.1, ruby-on-rails, string Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa