21 April 2014

The Ruby Reflector

Topic

ActiveSupport

  Source Favicon
On Odes of the Occult 1 month ago.
Email

…application". Is it really the case? What's worth your "application" without the UI? What do you think?

In the next post I'm going to find out where the exact line between those parts goes (hint hint: controller) and how we can pull this line to our side to maximize benefits (where should the authorization go? where should the loading/building of models happen? Why ActiveSupport can invisibly make your domain logic Rails dependent?)

sickill.net Read
  Source Favicon
By David Celis of New Relic 1 month ago.
Email

…4:00PM Pacific Time on weekdays. Here's a basic example in Ruby (plus ActiveSupport):

We decided to set the feature to enable itself at 10:00AM to give ourselves time to settle in at the office or arrive a bit late. Disabling the feature at 4:00PM would give us time to address any possible issues that could arise from falling back to our old authentication method. This ended up being an additional benefit of this feature flag: gaining confidence in deploying and rolling back the feature. …

newrelic.com Read
  Source Favicon
By interblah.net of interblah.net 8 months ago.
Email

…realise for usage within Rails, this is a non-issue, but for non-Rails applications, loading ActiveSupport can introduce a number of other gems that bloat the running Ruby process. As far as I can tell, the only methods from ActiveSupport that are used are Hash#blank? (which is effectively the same as Hash#empty? ) and String#starts_with? (which is just an alias for the Ruby-default String#start_with? ). Pull request submitted.

interblah.net Read
  Source Favicon
By Jason Clark of New Relic 12 months ago.
Email

…many subtle bugs from interesting intersections between Rails (I'm looking at you, ActiveSupport) and the various flavors of Ruby. Running the unit tests under Rails helps flush out these odd interactions. For example, we found one problem with subtly incompatible versions of the to_json method floating around during the 2.x versions of ActiveSupport.

Which version of Rails do we run against? Well, if you download the agent source and run the unit tests, you'll see …

newrelic.com Read
  Source Favicon
By Mike Gunderloy of A Fresh Cup 12 months ago.
Email

…diagnostic code I whipped up yesterday to add ActiveRecord callbacks to the development log.

activerecord-callback_notification - This one didn't do quite what I want, but I borrowed some of its code to start from.

Instrument Anything in Rails 3 - A good introduction to ActiveSupport::Notifications.

callback_skipper - Short-circuit things in your unit tests.

afreshcup.com Read
  Source Favicon
By Lucas Mazza of Plataformatec Blog 1 year ago.
Email

…should. While this might make a lot of sense for libraries that extend the Ruby stdlib (like ActiveSupport ), monkeypatching someone else constant might bite you back later. Overusing monkeypatches might be a serious block when updating your application to newer versions of a big dependency of your project (for example, Rails).

When you monkey patch, you are usually messing with a very internal piece of a component that might be far from it's public API. So, you can't predict …

blog.plataformatec.com.br Read
  Source Favicon
By James Mead of Blog - James Mead 1 year ago.
Email

…check for the development environment appears to be necessary, because Rails uses some of ActiveSupport's test-related classes in the development environment!

Option 2 - Use "edge" Rails or one of the relevant "stable" branches of Rails # Gemfile gem "rails", git: "git://github.com/rails/rails.git", branch: "3-2-stable" group :test do gem "mocha", :require => false end

# test/test_helper.rb require …

blog.floehopper.org Read
  Source Favicon
Email
  Source Favicon
By Tom Fakes of CRAZ8 over 1 year ago.
Email

…that is all over Google search. Here's the equivalent code before I extracted to a ActiveSupport::Concern module

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class Foo < ActiveRecord :: Base after_commit :clear_id_cache # class method def self . lookup_by_id (id) Rails .cache.fetch( " Foo:id: #{ id } " ) do where( :id => id).first …

blog.craz8.com Read
  Source Favicon
By Dan DeLeo of Chef Blog over 1 year ago.
Email

…rails allows arbitrary code execution on an affected server. The vulnerable code is in rails's ActiveSupport library. Though the current versions of Chef server use Merb instead of rails, Merb uses an ActiveSupport fork called extlib that includes the same vulnerability to provide many of the same features as ActiveSupport. According to the currently available information about the vulnerability, there are several additional conditions that must be satisfied for the vulnerability …

opscode.com Read