ruby Dig'gin through hashes and arrays in Ruby A simple but effective trick for parsing nested hashes and arrays using Ruby
ruby Converting Unix epoch timestamps to Ruby objects A handy trick to parse timestamps to Time objects using plain Ruby way
ruby Pending cops in Rubocop to make upgrade easier Whenever a new version of Rubocop comes out, there are always some new cops. If our code is not compatible with new cops, then the rubocop build fails. With every new release, we have to spend time to make our code compatible with the new cops. Well not any more!
ruby How to get feedback on your Ruby blog posts You have written a blog post about Ruby or Rails or Hanami or Roda? Great, Congratulations! Now is the time to share it with other Rubyists and get some feedback. RubyflowYou can share it on rubyflow.com. Rubyflow is aggregator where people post links about articles or gems that they
ruby Managing warnings emitted by Ruby 2.7 Ruby 2.7 is released on Christmas 2019. If you don't know what Ruby 2.7 offers, I have you covered.I tried running codetriage on Ruby 2.7. When I run rails c it prints tons of warnings about various deprecations. /Users/prathamesh/.rbenv/versions/2.7.0-rc2/lib/
ruby All(most all) you need to know about Ruby 2.7 Ruby 2.7 is released. This post discusses the features that are part of Ruby 2.7 and how you can use them. It also discusses how you can start using Ruby 2.7 in your projects.
ruby b - a hidden method from Ruby string class After my last post on how Ruby initializes objects, Sagar shared with me following code. class Abc attr_accessor :a, :b def self.new(a, b) @a = a @b = b end end o = Abc.new("a", "b") puts o.a puts o.b >> o.a => NoMethodError >
ruby Understanding how Ruby initializes objects Deep buried in Rails source code, there is a code snippet: class DeprecationProxy def self.new(*args, &block) object = args.first return object unless object super end ... end It was added 9 years ago and the commit message said: Override new on proxy objects so that they never wrap
ruby Installing eventmachine gem on El Capitan I keep forgetting how to install eventmachine on El Capitan Mac OS X. So adding this post to lookup when required. $ gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include More details can be found here and here
ruby kgio, raindrops, unicorn and Ruby 2.2.0-preview1 I was trying to upgrade Codetriage to use Ruby 2.2.0-preview, the latest Ruby version. The project is hosted on Heroku. So to upgrade I changed Ruby version in Gemfile: # Gemfile ruby '2.2.0' After that I tried to do bundle install: bundle install And boom. Got error:
ruby After effects of updating openssl on Mac OS X Today, my openssl library on Mac OS X Mavericks got updated. After the update, when i tried doing rails s on one of the rails apps, it gave following error: /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta1/lib/rails/
ruby Setting up Ruby development setup with rbenv I wanted to setup ruby source code on my machine. The source on Github has detailed instructions on how to do the setup. git clone github.com/ruby/ruby cd ruby autoconf ./configure make make install worked correctly on Mac OS X and Ruby was installed in usr/local/bin.
ruby Weirdness of Bigdecimal.new Recently i was bitten by this weirdness of BigDecimal in Ruby. BigDecimal.new excepts initial value and number of significant digits. In one of my app, BigDecimal.new was called with string initial value without precision. Everything was working great and suddenly something changed. And this error started coming. can't
ruby Enable minitest again If you have skipped minitest/test-unit while creating a rails app with -T or want to move to minitest from rspec or want to start with minitest in an existing rails project without tests, its very easy. Just include require "rails/test_unit/railtie" in config/application.rb. After this