Abstraction Creep Posted by judofyr on May 25, 2012 — 0 comments Abstraction creep : When you try to save yourself from a shaky abstraction by introducing another abstraction, instead of just fixing that abstraction. Comments Post a Comment Comment abilities for non registered use...
May 22th, 2012 Dimension your Rails under a microscope, Open the struct2 for ActiveRecord reputation, and assign values to a figleaf. May 20th, 2012 Devise 2.1, running your uncommitted rspecs, feeling dirty with soap, grabbing data out of Google spreadsheets, and more in this edition...
Amazon AWS users are all to familiar with the steps required to connect to an available instance. Using the management console you have to copy and paste the public dns name into the shell to construct the ssh command. It is annoying when the mouse isn't placed just right and your cli...
It is now possible to define a custom importer that can be used to find imports using different import semantics than the default filesystem importer that Sass provides. For instance, you can use this to generate imports on the fly, look them up from a database, or implement different...
library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.
Ubuntu almost has the hardware integration I have come to expect when using my macbook compared to OS X. As far as desktop ruby dev machines go, Ubuntu is the best for development. All of the servers I deploy to run Ubuntu so it kind of makes sense to use it for development as well. U...
PostgreSQL is an increasingly popular database choice for Rails developers and with good reason. The many features it provides mean that a lot of developers who previously used MySQL have now moved over to Postgres. We’ll mention some of these at the end of this episode but first we’l...
There are several ways to do this, some people create Rails Observers to fire off emails, others do it inside of the User Model. However, in Rails 3, mailers are really just another way to render a view. Instead of rendering a view and sending out the HTTP protocol, they are just send...
Supports stubbing a chain of methods. Each argument represents a method name to stub, and each one returns a proxy object that can accept more stubs, until the last, which returns whatever is passed to +and_return_.
ActiveRecord::Base.include_root_in_json controls the top-level behavior of to_json . In a new Rails application, it is set to true in initializers/new_rails_defaults.rb. When it is true, to_json will emit a single root node named after the object’s type. For example:
bracket_tree 0.1.0 Binary Tree based bracketing system install gem install bracket_tree Download Documentation Subscribe Stats Authors Andrew Nordman 6 total downloads 6 for this version Owners Links Homepage Gemfile gem "bracket_tree", "~> 0.1.0" Versions 0.1.0 May 25, 2012 Developme...
Heroku is fantastic for experimentation, which leads to a predictable conclusion: a lot of abandoned applications on the platform. In order to keep them from chewing up an inordinate amount of resources, the platform treats single-dyno applications a little differently (with the assum...
Client library and command-line tool to deploy and manage apps on Heroku.
# 在 http://example.com/example 上运行的应用 get '/foo' do request.body # 被客户端设定的请求体(见下) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_length # request.body的长度 req...
Redmine natively supports LDAP authentication using one or multiple LDAP directories. Declaring the LDAP¶ Go to Administration and click LDAP authentication in the menu. Enter the following: Name : an arbitrary name for the directory Host : the LDAP host name Port : the LDAP port (def...
Basic 認証を行う。ブロックは user, pass を引数として呼ばれ、 ブロックが true を返すとユーザを認証したことになる。 ブロックが false を返すと認証に失敗し、 例外 WEBrick::HTTPStatus::Unauthorized を投げる。 srv.mount_proc('/basic_auth') {|req, res| HTTPAuth.basic_auth(req, res, "WEBrick's realm") {|user, pass| user == 'webrick' && pass == 'supersecretpa...
fluent-plugin-flowcounter 0.1.5 Plugin to counts messages/bytes that matches, per minutes/hours/days install gem install fluent-plugin-flowcounter Download Documentation Subscribe Stats Authors TAGOMORI Satoshi 976 total downloads 17 for this version Owners Links Homepage Gemfile gem ...
DataTables makes it easy to convert a plain HTML table into one with pagination, sorting, and searching - all done with JavaScript and jQuery. Here I show how to set this up and use a Rails application as the data source.
Callbacks are code hooks that are run at key points in an object’s lifecycle. The typical use case is to have a base class define a set of callbacks relevant to the other functionality it supplies, so that subclasses can install callbacks that enhance or modify the base functionality ...
Argument casting allows you to validate a command-line option and convert it from the user-supplied String into whichever object you like. The ri for OptionParser has an example similar to this one for casting a floating-point argument into a Float value:
Rails comes with many built-in generators, but what if you want to customize them or make your own? Rails gives you a great way to do this which you will learn in this episode.
*"1 git repo, 2 Heroku apps, 2 procfiles? Heroku currently is limited to 1 procfile per repo, so we've created a rake task that branches, modifies the procfile and pushes. Do you have a better solution?" Is it possible to use env variables to parameterize your Procfile? "Capybara: How...
Whether an error in the Sass code should cause Sass to provide a detailed description within the generated CSS file. If set to true, the error will be displayed along with a line number and source snippet both as a comment in the CSS file and at the top of the page (in supported brows...