List moved
Please use https://github.com/bf4/learning to fork and pull changes.
Refinery::Core::Engine.routes.draw do | |
# frontend | |
namespace :blog do | |
root :to => "posts#index" | |
resources :posts | |
end | |
# backend | |
namespace :blog, :path => "" do |
Refinery::Pages.configure do | |
types do | |
define :home do | |
self.parts = %w[intro body] | |
self.template = 'refinery/pages/home' # this is automatic but shows overriding | |
end | |
define :show do | |
self.parts = %w[body side] | |
# self.template is automatically 'refinery/pages/show' and thus not required. |
#!/usr/bin/env ruby | |
# Migrate local Refinery images & resources to S3. | |
# Assumes you've set up an AWS::S3 connection | |
# elsewhere (I have an initializer that does it). | |
image_classes = [Image] | |
data_classes = [Resource] | |
def upload(path, file, bucket, retries = 3) |
guard 'rspec', :version => 2 do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT) | |
def setup_environment | |
# Configure Rails Environment | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'capybara/rspec' |
class FoodFightPlayCommandsController < LoggedInController | |
def create | |
command = FoodFightPlayCommand.new(params[:food_fight_play_command]) | |
command.person_id = current_person.id | |
# Set up success / failure callbacks | |
command.on_success = method(:on_success) | |
command.on_failure = method(:on_failure) | |
command.execute! | |
end |
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
#!/usr/bin/perl | |
#fetch Gravatars | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 90; |
require 'rake_timer' |
List moved
Please use https://github.com/bf4/learning to fork and pull changes.