Heroku introduced a major update today to the platform. In addition to the press release and blog post, here is a list of all updated content:
Devcenter.heroku.com
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') | |
class BuildStatusTest < ActiveSupport::TestCase | |
test "remove the old statii" do | |
assert_equal 2, BuildStatus.count | |
BuildStatus.expire_old | |
statii = BuildStatus.all | |
assert_equal 1, statii.size | |
assert statii[0].updated_at >= 30.days.ago | |
end |
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') | |
class BuildStatusTest < ActiveSupport::TestCase | |
context "expiring build statii" do | |
should "remove the old one" do | |
assert_equal 2, BuildStatus.count | |
BuildStatus.expire_old | |
statii = BuildStatus.all | |
assert_equal 1, statii.size | |
assert statii[0].updated_at >= 30.days.ago |
class StatusBarView < NSView | |
attr_reader :progressIndicator, :statusBarItem | |
def initWithStatusBarItem(item) | |
bar = item.statusBar | |
if initWithFrame([[0,0], [bar.thickness, bar.thickness]]) | |
@statusBarItem = item | |
@highlight = false | |
origin, size = frame.origin, frame.size |
# Gemfile | |
gem "therubyracer-heroku" | |
# config/initializers/barista_config.rb | |
Barista.configure do |c| | |
c.root = Rails.root.join("app", "coffeescripts") | |
c.output_root = Rails.root.join("tmp", "javascripts") | |
end | |
require 'fileutils' |
Heroku introduced a major update today to the platform. In addition to the press release and blog post, here is a list of all updated content:
Devcenter.heroku.com
#!/usr/bin/env ruby | |
require 'thor/group' | |
require 'thor/util' | |
require 'date' | |
class Hoboken < Thor::Group | |
desc 'Generates a new modular Sinatra app' | |
include Thor::Actions |
- (void)hijackWebViewScrollViewDelegate:(UIWebView *)webView { | |
UIScrollView *scrollView = (UIScrollView *)[webView.subviews objectAtIndex:0]; | |
scrollView.delegate = self; | |
} | |
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { | |
return nil; | |
} | |
// The rest of the UIScrollViewDelegate methods are not interesting for us, so forward them to the webview. |
# Ruby `retry` with steroids: | |
# | |
# - retry up to 5 times without waiting between them and retrying after any exception | |
# | |
# retry_upto(5) do ... end | |
# | |
# - retry up to 5 times, waiting 2 seconds between retries | |
# | |
# retry_upto(5, :wait => 2) do ... end | |
# |
class Edition < ActiveRecord::Base | |
scope :published, where(arel_table[:published_at].not_eq(nil)) | |
scope :generated, where(arel_table[:generated_at].not_eq(nil)) | |
scope :available, published.generated | |
end | |
class Magazine < ActiveRecord::Base | |
# This is where #merge works its magic, by allowing you to merge scopes from other models. | |
scope :with_available_editions, includes(:editions).merge(Edition.available) | |
end |
require 'meatloaf' | |
require 'steps' | |
Feature "Eat candies" do | |
Scenario "Eat a candy from a jar full of them" do | |
Given "I have a jar with candies", candies: 10 | |
When "I eat one candy" | |
Then "the jar won't be empty" | |
end |