Skip to content

Instantly share code, notes, and snippets.

View ugisozols's full-sized avatar

Uģis Ozols ugisozols

View GitHub Profile
class Dog
def initialize(name)
@name = name
end
def bark
"#{@name} barks like a dog"
end
def eat
class Granny
attr_reader :name
def initialize(name)
@name = name
end
end
class Conversation
attr_reader :grannys
# features/refinery/manage_files
Scenario: Files Delete
Given I have no files
When I upload the file at "features/uploads/refinery_is_awesome.txt"
And I go to the list of files
And I follow "Remove this file forever"
Then I should have 0 file
# next line fails ...
# And I should see "'refinery_is_awesome.txt' was successfully destroyed."
# /refinerycms/vendor/refinerycms/images/app/views/admin/images/_form.html.erb
<%#= f.error_messages %>
<%= render "/shared/admin/error_messages", :object => @image %>
# /refinerycms/vendor/refinerycms/core/app/views/shared/admin/_error_messages.html.erb
<% if object.errors.any? %>
<div class="errorExplanation" id="errorExplanation">
<p><%= pluralize(object.errors.count, "error") %> prohibited this resource from being saved:</p>
<ul>
= Setup
=== In your browser
login to http://github.com
go to http://github.com/resolve/refinerycms
if you have a fork already, delete it (if you're not going to loose work. This makes it much easier for us to integrate your changes back in)
click on fork
=== In terminal
git clone git@github.com:USERNAME/refinerycms.git refinerycms
user app;
worker_processes 2;
error_log /home/app/logs/nginx.error.log info;
events {
worker_connections 1024;
}
Benchmark.bmbm do |x|
x.report("each") do
count = 0
self.posts.each do |p|
count += 1 if p.live?
end
count
end
source 'http://rubygems.org'
gem 'rails', '~> 3.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Use unicorn as the web server
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@ugisozols
ugisozols / rails_3_1_beta_1_changes.md
Created May 7, 2011 13:39 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]