This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define(:rate_profile) do |rp| | |
rp.start_date(Date.today) | |
end | |
Factory.define(:rate) do |r| | |
r.value '120.00' | |
r.rate_profile { Factory :rate_profile } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cascade_taskrefnos | |
child_tasks = Task.find_all_by_parentid(self.id) | |
child_tasks.each do |child_task| | |
child_task.update_attributes! :taskrefno => "#{taskrefno}.#{child_task.childseq}" | |
child_task.cascade_taskrefnos | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tokens/termials | |
EQ | |
LBRACE | |
RBRACE | |
LPAREN | |
RPAREN | |
DOT | |
COMMA | |
PIPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Other stuff, mostly comments | |
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so | |
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.1.3 | |
PassengerRuby /usr/bin/ruby1.8 | |
# Include the virtual host configurations: | |
Include /etc/apache2/sites-enabled/ | |
NameVirtualHost *:80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServerRoot "/etc/apache2" | |
LockFile /var/lock/apache2/accept.lock | |
PidFile ${APACHE_PID_FILE} | |
Timeout 300 | |
KeepAlive On |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9 | |
# Don't load rspec if running "rake gems:*" | |
unless ARGV.any? {|a| a =~ /^gems/} | |
begin | |
require 'spec/rake/spectask' | |
rescue MissingSourceFile | |
module Spec | |
module Rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.cache_classes = true | |
config.whiny_nils = true | |
config.action_controller.consider_all_requests_local = true | |
config.action_controller.perform_caching = false | |
config.action_view.cache_template_loading = true | |
config.action_controller.allow_forgery_protection = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fork {system 'echo "startup.sh"'} | |
# RSpec | |
require 'spec/expectations' | |
require 'webrat/selenium' | |
Webrat.configure do |config| | |
config.mode = :selenium | |
config.application_address = 'localhost' | |
config.application_port = 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testRegistrationIsValidRunsAllValidationsWhenCallingIsValid: function() {with(this) { | |
callCountOne = 0; | |
callCountTwo = 0; | |
var mockFunOne = function() { callCountOne++; console.log(callCountOne); }; | |
console.log(callCountOne.toString() + 'a'); | |
var mockFunTwo = function() { this.callCountTwo++; }; | |
testObject.registerValidation(mockFunOne, this); | |
testObject.registerValidation(mockFunTwo, this); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BackgroundChanger | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, response = @app.call(env) | |
response.body.gsub!('<body',"<body background='/images/common/bg-staging.gif'") if env['RAILS_ENV'] != 'production' && response.respond_to?(:body) && response.body.respond_to?(:gsub!) | |
[status, headers, response] | |
end |