18 May 2013

The Ruby Reflector

Topic

Request

  Source Favicon
By Jeremy Templier of New Relic 1 month ago.
Email

…gives you a clear vision of how performant they are. When you know the number of requests sent for ‘ Request A', you'll be able to tell how much time is spent in each request.

Welcome to the Real World

I'd like to show you some improvements we've made in our iOS API and to our iOS app thanks to New Relic for Mobile Apps.

Track the HTTP Errors

A few weeks ago, we saw that the number of 403 errors was high. So we started to investigate it with New Relic for …

newrelic.com Read
  Source Favicon
By Loren Segal of gnuu.org 4 months ago.
Email

…of a real world application and not just a testing scenario. Maybe we want to take our monolithic Request class and instead run our requests over some HTTP-like protocol over UDP, or maybe even a serial port. If calling Net:: HTTP.new is buried somewhere in an internal # send method, there's not much we can do without DI. We can monkeypatch or redefine methods directly on an instance, but these are not thread-safe or elegant solutions to the problem. DI is the elegant solution, …

gnuu.org Read
  Source Favicon
By Patrick Reagan of Viget.com Blogs 6 months ago.
Email

def request @ request ||= Rack::Request.new(@environment) end

def user_agent Mobile::UserAgent.new(request.env['HTTP_USER_AGENT']) end

def mobile_requested? request.params['mobile'] == '1' end

def serve_mobile? mobile_requested? || user_agent.mobile? end

def set_mobile_accept_header request.env['HTTP_ACCEPT'] = 'text/html+mobile' end

def response status, headers, body = @application.call(request.env) …

viget.com Read
  Source Favicon
Email

The 400 Bad Request status indicates that the request ‘could not be understood by the server due to malformed syntax'. See the IETF docs

There is also the 422 Unprocessable Entity status code that appears to be popular for roughly the same purpose. I've read from a couple of sources that since the 422 is part of the WebDAV extension that 400 is preferable over 422. I don't have the knowledge to weigh in on this argument. Perhaps someone can enlighten …

thefrontiergroup.com.au Read
  Source Favicon
By Mike Gunderloy of A Fresh Cup 9 months ago.
Email

Week of August 13 - August 19, 2012

Looks like there's some focus on ActiveRecord optimizations currently. That's work that many people will welcome.

DHH's routing concerns plugin gets merged to the main line at 0dd24728b - documentation is at 0bd7b07d . This lets you tidy up your routes.rb file by declaring common reusable resources.

0d0d4622 adds Request#formats=(extensions) to let you set a prioritized list of multiple formats to use in response.

afreshcup.com Read
  Source Favicon
By andrewperk of Videos related to 'Ruby on Rails demo' over 1 year ago.
Email

Cakephp model exists method Cakephp 2.0 exceptions Cakephp Request data array Cakephp Request is method Cakephp Form helper postLink method Cakephp 2.0 overall controller action changes for CRUD

You can download both the starting sourcecode to follow along with the tutorial and download the ending sourcecode if you want to see what the completed code looks like at my website:

http://www.andrews-custom-web-design.com/cakephp.html

Cakephp 2.0 Update source code:

http://www.andrews-custom-web-design.com/support-files/learncaketwo.zip …

youtube.com Read
  Source Favicon
On Unspace Blog over 1 year ago.
Email

By software consulting standards, Unspace Interactive is a small boutique. As a byproduct of our small size and close relationship with the startup community, more than half of the Request for Proposals 1 we consider are for what I call " Software that Powers the Startup."

The typical RFP for Software that Powers the Startup is from an entrepreneur that wishes to launch a web-based technology business. The request is that we develop a plan to design and …

rethink.unspace.ca Read
  Source Favicon
On pingles 2 years ago.
Email

Recent releases of Rack include a ssl? method on the Request that return true if the request is secure. This, internally, calls scheme to check whether any of the HTTP headers that specify an HTTPS scheme are set (the snippet from Rack's current code is below).

1 2 3 4 5 6 7 8 9

if @env [ ' HTTPS' ] == 'on'

'https'

elsif @env [ ' HTTP X FORWARDED SSL' ] == 'on'

'https'

elsif @env [ …

oobaloo.co.uk Read
  Source Favicon
By Christian Neukirchen of chris blogs 2 years ago.
Email

…enabled, and neither does Gentoo, which not even provides a use-flag for it. It is, however, turned on by default on Ubuntu (after all, they make heavy use of sudo), RHEL, Fedora Core (since version 12), and openSUSE (and thus, probably, also in Canterbury ).

NP: The Brian Jonestown Massacre—Their Satanic Majesties' Second Request

chneukirchen.org Read
  Source Favicon
By Matt of Tea-Driven Development 2 years ago.
Email

Single Responsibility Principle for me. I'd prefer a pattern where I had a separate Request class for each action, rather than a few largely unrelated methods on the same controller class. But Rails is there and there's a lot else to like, so let's not get into that.

We all know it's a bad idea to let our controllers bloat and something I've been enjoying greatly lately is Jose Valim ‘s Inherited Resources . By sticking to this pattern, …

blog.mattwynne.net Read