FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)
Copyright (C) 2011 by Colin MacKenzie IV | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)
class TasksController < ApplicationController | |
def update | |
if @task.update_attributes(params[:task]) | |
tracker = PostSaveTaskTracker.new(@task) | |
TaskPusher.new(tracker, socket_id).push_changes | |
TaskMailSender.new(tracker, current_user).deliver_email | |
# success response | |
else | |
# failure respond | |
end |
App.Router.map(function() { | |
this.resource('post', { path: '/posts/:post_id' }); | |
}); | |
App.PostRoute = Ember.Route.extend({ | |
model: function(params) { | |
return this.store.find('post', params.post_id); | |
} | |
}); |
def delete_failed_job_if | |
redis = Resque.redis | |
(0...Resque::Failure.count).each do |i| | |
string = redis.lindex(:failed, i) | |
break if string.nil? | |
job = Resque.decode(string) | |
should_delete_job = yield job | |
next unless should_delete_job |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
# DCI EXAMPLE IN RUBY (with some prototype elements) | |
# Blog post: https://www.ludyna.com/oleh/dci-example-in-ruby | |
# | |
# More info: | |
# | |
# Creator of MVC & DCI, Trygve Reenskaug: DCI: Re-thinking the foundations of | |
# object orientation and of programming | |
# http://vimeo.com/8235394 | |
# | |
# James Coplien: Why DCI is the Right Architecture for Right Now |