This file contains hidden or 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 GraphsController < ApplicationController | |
def top | |
@graph = open_flash_chart_object(1200, 500, '/graphs/bar_chart') | |
end | |
def bar_chart | |
top = Customer.find(:all, :select => 'sum(CMS.ORD_TOTAL) AS total, CUST.COMPANY', :group => 'CMS.CUSTNUM, CUST.COMPANY', :joins => [:orders], :limit => 10, :order => 'total DESC') | |
bar = BarOutline.new(50, '#9933CC', '#8010A0') |
This file contains hidden or 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
begin | |
require 'spec' | |
rescue LoadError | |
require 'rubygems' | |
gem 'rspec' | |
require 'spec' | |
end | |
Spec::Runner.configure do |config| | |
config.mock_with :flexmock |
This file contains hidden or 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
require 'spec_helper.rb' | |
describe "Migration" do | |
before do | |
@record = mock('record', {:name => 'Pete'}) | |
MyModel = mock('MyModel Class', {:count => 1, :find => [@record]}) | |
require 'my_migration' | |
@migration = MyMigration.new | |
end |
This file contains hidden or 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
require File.dirname(__FILE__) + '/spec_helper.rb' | |
APP_ROOT = File.dirname(__FILE__) + "/../tmp" | |
require 'rubygems' | |
require 'rubigen' | |
require 'rubigen/scripts/generate' | |
describe 'LegacyModelGenerator' do | |
This file contains hidden or 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
@page { | |
size: letter; | |
margin-top: 1.75in; | |
margin-right: 0.25in; | |
margin-bottom: 0.25in; | |
margin-left: 0.25in; | |
@top-center | |
{ |
This file contains hidden or 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
# Disable automatic framework detection by uncommenting/setting to false | |
# Warbler.framework_detection = false | |
# Warbler web application assembly configuration file | |
Warbler::Config.new do |config| | |
# Temporary directory where the application is staged | |
# config.staging_dir = "tmp/war" | |
# Application directories to be included in the webapp. | |
config.dirs = %w(lib public views) |
This file contains hidden or 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
$ jruby -S warble | |
mkdir -p tmp/war/WEB-INF/config | |
mkdir -p tmp/war/WEB-INF/lib | |
cp config/warbler.rb tmp/war/WEB-INF/config/warbler.rb | |
cp lib/appengine-api-1.0-sdk-1.2.0.jar tmp/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.0.jar | |
cp lib/jruby-core.jar tmp/war/WEB-INF/lib/jruby-core.jar | |
cp lib/jruby-rack-0.9.4-SNAPSHOT.jar tmp/war/WEB-INF/lib/jruby-rack-0.9.4-SNAPSHOT.jar | |
cp lib/ruby-stdlib.jar tmp/war/WEB-INF/lib/ruby-stdlib.jar | |
cp /Users/mlins/Projects/forks/jruby/lib/ruby/gems/1.8/gems/warbler-0.9.12/lib/jruby-complete-1.1.6.jar tmp/war/WEB-INF/lib/jruby-complete-1.1.6.jar |
This file contains hidden or 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
module DateValidations | |
def self.included(base) # :nodoc: | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
# Must pass a Proc object with a Range of Date, Time or DateTime. | |
# The Proc prevents the range from only being evaluated at initialization. | |
# All 'dates' are converted to Time objects for comparison sake. |
This file contains hidden or 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
require 'rubygems' | |
require 'sinatra' | |
require 'lib/dm-appengine/dm-appengine' | |
require 'dm-core/core_ext/symbol' | |
require 'models/location' | |
DataMapper.setup(:default, { | |
:host => 'localhost', | |
:adapter => 'appengine' | |
}) |
This file contains hidden or 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 completed? | |
if subwizard? | |
all_instances.all? do |instance| | |
instance.decendants.all? do |decendant| | |
decendant.completed? | |
end | |
end | |
elsif question? | |
model && model.valid? | |
else |
OlderNewer