code
stringlengths
1
1.73M
language
stringclasses
1 value
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/benchmarker'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/benchmarker'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/request'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/profiler'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/profiler'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/performance/request'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/plugin'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/about'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/server'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/generate'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/console'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/reaper'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/inspector'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/inspector'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/spawner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/reaper'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../config/boot' require 'commands/process/spawner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/generate'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/server'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/about'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/plugin'
Ruby
class CreateEvents < ActiveRecord::Migration def self.up create_table :events do |t| t.string :event_type, :name, :description, :meeting_place, :contact, :contact_phone, :address, :city, :state, :zip t.integer :approved, :max_attendees t.float :hours t.datetime :date t.references :mi...
Ruby
class RedoMemberFields < ActiveRecord::Migration def self.up remove_column :members, :branch remove_column :members, :stored_committees remove_column :members, :stored_potential_committees remove_column :members, :stored_flex_points remove_column :members, :stored_potential_flex_points add_col...
Ruby
class AddToAttendanceRecord < ActiveRecord::Migration def self.up add_column :attendance_records, :driver, :boolean, :default => false add_column :attendance_records, :family, :boolean, :default => false change_column :events, :approved, :boolean, :default => false end def self.down remove_c...
Ruby
class WaitList < ActiveRecord::Migration def self.up add_column :attendance_records, :waitlist, :integer, :default => 0 end def self.down remove_column :attendance_records, :waitlist end end
Ruby
class MembersPotentialCache < ActiveRecord::Migration def self.up add_column :members, :stored_potential_service_hours, :float, :default => 0 add_column :members, :stored_potential_fellowships, :integer, :default => 0 add_column :members, :stored_potential_leaderships, :integer, :default => 0 add_colu...
Ruby
class CreateTopics < ActiveRecord::Migration def self.up create_table :forum_topics do |t| t.string :name t.timestamps end end def self.down drop_table :forum_topics end end
Ruby
class CreatePositions < ActiveRecord::Migration def self.up create_table :positions do |t| t.string :name, :description t.datetime :semester t.references :member t.timestamps end end def self.down drop_table :positions end end
Ruby
class RequireDriver < ActiveRecord::Migration def self.up add_column :events, :drivers, :integer, :default => 0 end def self.down remove_column :events, :drivers end end
Ruby
class Branch < ActiveRecord::Migration def self.up add_column :events, :branch_points, :integer, :default => 0 end def self.down remove_column :events, :branch_points end end
Ruby
class RenamePledgeClassesColumn < ActiveRecord::Migration def self.up change_column :pledge_classes, :semester, :int, :limit => 11 rename_column :pledge_classes, :semester, :semester_index end def self.down rename_column :pledge_classes, :semester_index, :semester change_column :pledge_classes, :...
Ruby
class RedoPositionsFields < ActiveRecord::Migration def self.up remove_column :positions, :semester remove_column :positions, :description remove_column :positions, :name add_column :positions, :semester_index, :integer add_column :positions, :position, :integer end def self.down remove_c...
Ruby
class RemoveBranch < ActiveRecord::Migration def self.up remove_column :events, :branch_points end def self.down add_column :events, :branch_points, :integer, :default => 0 end end
Ruby
class Src < ActiveRecord::Migration def self.up add_column :members, :signed_src, :boolean, :default => false end def self.down remove_column :members, :signed_src end end
Ruby
class MembersCache < ActiveRecord::Migration def self.up add_column :members, :stored_service_hours, :float, :default => 0 add_column :members, :stored_fellowships, :integer, :default => 0 add_column :members, :stored_leaderships, :integer, :default => 0 add_column :members, :stored_fundraisers, :inte...
Ruby
class ServiceBackToInt < ActiveRecord::Migration def self.up remove_column :members, :service_back_completed add_column :members, :service_back_completed, :integer, :default => 0 end def self.down remove_column :members, :service_back_completed add_column :members, :service_back_completed, :boole...
Ruby
class ServiceBackTotal < ActiveRecord::Migration def self.up add_column :members, :service_back_total, :integer, :default => 0 end def self.down remove_column :members, :service_back_total end end
Ruby
class UpdateAttendance < ActiveRecord::Migration def self.up remove_column :attendance_records, :family add_column :attendance_records, :attended, :boolean, :default => true end def self.down add_column :attendance_records, :family, :boolean, :default => false remove_column :attendance_records, :...
Ruby
class Announcements < ActiveRecord::Migration def self.up create_table :announcements do |t| t.string :message, :name t.integer :type t.datetime :date t.timestamps end end def self.down drop_table :announcements end end
Ruby
class StoredBranchPoints < ActiveRecord::Migration def self.up create_table :branch_points do |t| t.integer :alpha, :phi, :omega, :semester end end def self.down drop_table :branch_points end end
Ruby
class PercentDoneMigration < ActiveRecord::Migration def self.up add_column :members, :stored_percent_done, :float, :default => 0 end def self.down remove_column :members, :stored_percent_done end end
Ruby
class TotalHoursToFloat < ActiveRecord::Migration def self.up remove_column :members, :stored_total_hours add_column :members, :stored_total_hours, :float, :default => 0 end def self.down remove_column :members, :stored_total_hours add_column :members, :stored_total_hours, :tinyint, :default => 0...
Ruby
class CreateMembers < ActiveRecord::Migration def self.up create_table :members do |t| t.string :first_name, :last_name, :username, :password, :email, :phone_number t.string :permanent_address_one, :permanent_address_two, :permanent_city, :permanent_state, :permanent_zip t.string :school_address...
Ruby
class Tokens < ActiveRecord::Migration def self.up create_table :tokens do |t| t.string :category, :data t.timestamps end end def self.down drop_table :tokens end end
Ruby
class EventFull < ActiveRecord::Migration def self.up add_column :events, :full, :boolean, :default => false end def self.down remove_column :events, :full end end
Ruby
class DropBranch < ActiveRecord::Migration def self.up drop_table :branch_points end def self.down create_table :branch_points do |t| t.integer :alpha, :phi, :omega, :semester end end end
Ruby
class AddIndexes < ActiveRecord::Migration def self.up #Announcement add_index :announcements, :member_id add_index :announcements, :admin #AttendanceRecord add_index :attendance_records, [:event_id, :member_id], :unique => true add_index :attendance_records, [:waitlist, :event_id] add_ind...
Ruby
class RemovePerfectAttendance < ActiveRecord::Migration def self.up remove_column :members, :dues_on_time remove_column :members, :perfect_attendance end def self.down add_column :members, :dues_on_time, :tinyint, :default => 0 add_column :members, :perfect_attendance, :boolean, :default => false...
Ruby
class RedoAnnouncements < ActiveRecord::Migration def self.up drop_table :announcements create_table :announcements do |t| t.string :message t.boolean :admin t.references :member t.timestamps end end def self.down drop_table :announcements end end
Ruby
class DeleteFix < ActiveRecord::Migration def self.up add_column :events, :deleted, :boolean, :default => false add_column :members, :deleted, :boolean, :default => false add_column :attendance_records, :deleted, :boolean, :default => false end def self.down remove_column :events, :deleted re...
Ruby
class BranchPoints < ActiveRecord::Migration def self.up create_table :branch_points do |t| t.integer :alpha, :phi, :omega, :semester end add_column :events, :branch_points, :integer, :default => 0 add_column :members, :branch, :integer end def self.down remove_column :events, :branch_p...
Ruby
class AddMemberActiveTrisecsRequirement < ActiveRecord::Migration def self.up add_column :members, :stored_trisecs, :integer, :default => 0 add_column :members, :stored_potential_trisecs, :integer, :default => 0 add_column :events, :additional_trisecs, :float, :default => 0 end def self.down remo...
Ruby
class CreatePledgeClasses < ActiveRecord::Migration def self.up create_table :pledge_classes do |t| t.string :name t.datetime :semester t.timestamps end end def self.down drop_table :pledge_classes end end
Ruby
class CreateThreads < ActiveRecord::Migration def self.up create_table :forum_threads do |t| t.string :subject t.references :forum_topic t.timestamps end end def self.down drop_table :forum_threads end end
Ruby
class PositionCompletion < ActiveRecord::Migration def self.up add_column :positions, :completed, :boolean, :default => 0 end def self.down remove_column :positions, :name, :boolean end end
Ruby
class CreateAwards < ActiveRecord::Migration def self.up create_table :awards do |t| t.string :name, :description t.datetime :semester t.references :member t.timestamps end end def self.down drop_table :awards end end
Ruby
class CreatePosts < ActiveRecord::Migration def self.up create_table :forum_posts do |t| t.text :body t.references :forum_thread, :author, :forum_topic t.timestamps end end def self.down drop_table :forum_posts end end
Ruby
class LengthenDescription < ActiveRecord::Migration def self.up change_column :events, :description, :string, :limit => 1200 end def self.down change_column :events, :description, :string end end
Ruby
class PotentialServiceBack < ActiveRecord::Migration def self.up remove_column :members, :service_back_total add_column :members, :potential_service_back_completed, :tinyint, :default => 0 add_column :members, :service_back_total, :tinyint, :default => 0 end def self.down remove_column :members, ...
Ruby
class AddEventLogging < ActiveRecord::Migration def self.up create_table :member_events do |t| t.belongs_to :acting_member, :null => false t.belongs_to :target_member, :null => false t.belongs_to :other_target_member t.belongs_to :event, :null => false t.string :description, :null =>...
Ruby
class EventCategoryAdditions < ActiveRecord::Migration def self.up add_column :events, :additional_service_hours, :float, :default => 0 add_column :events, :additional_fundraisers, :float, :default => 0 add_column :events, :additional_flex_points, :float, :default => 0 add_column :events, :additional_...
Ruby
class FourCStatus < ActiveRecord::Migration def self.up add_column :members, :four_c, :tinyint, :default => 0 add_column :events, :four_c, :tinyint, :default => 0 end def self.down remove_column :members, :four_c remove_column :events, :four_c end end
Ruby
class AdminToggles < ActiveRecord::Migration def self.up create_table :toggles do |t| t.string :name t.boolean :enabled t.timestamps end end def self.down drop_table :toggles end end
Ruby
class CreateAttendanceRecords < ActiveRecord::Migration def self.up create_table :attendance_records do |t| t.float :adjustment_hours t.references :member, :event, :creator t.timestamps end end def self.down drop_table :attendance_records end end
Ruby
class SemesterForEvents < ActiveRecord::Migration def self.up add_column :events, :semester_index, :integer, :default => 1 end def self.down remove_column :events, :semester_index end end
Ruby
#!/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired re...
Ruby
#!/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired re...
Ruby
#!/usr/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log # an...
Ruby
#!/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired re...
Ruby
#!/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired re...
Ruby
#!/usr/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log # an...
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' #class Test::Unit::TestCase class ActiveSupport::TestCase # Transactional fixtures accelerate your tests by wrapping each test method # in a transaction that's rolled back on completion. This ...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
require 'rubygems' unless ENV['NO_RUBYGEMS'] require 'rake/gempackagetask' require 'rubygems/specification' require 'date' require 'spec/rake/spectask' require 'yaml' require File.join(File.dirname(__FILE__), 'google_appengine.rb') spec = Gem::Specification.new do |s| s.name = "google-appengine" s.version = AppEn...
Ruby
#!/usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
Ruby
require 'rubygems' unless ENV['NO_RUBYGEMS'] require 'rubygems/builder' require 'rubygems/specification' require 'date' require 'erb' require 'fileutils' module AppEngine module SDK end end def find_version unless defined? AppEngine::SDK::VERSION re = /^appengine-java-sdk-(\d+[.]\d+[.]\d+([.]\w+)?).+zip$/ ...
Ruby
require 'rubygems' unless ENV['NO_RUBYGEMS'] require 'rake/gempackagetask' require 'rubygems/specification' require 'date' require 'spec/rake/spectask' require 'fileutils' BOOT_JAR = "appengine-rack.jar" SUMMARY = <<EOF Commom dependencies for configuring an App Engine application via Rack. EOF spec = Gem::Specifica...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2010 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
Ruby
# Critical default settings: disable_system_gems disable_rubygems bundle_path '.gems/bundler_gems' # List gems to bundle here: gem 'rails', '3.0.pre', :git => 'git://github.com/rails/rails.git', :ref => '1b27f5c4f72384081083fa025b6b10e5ab02ae5e' gem "rack", '1.0.1', :git => 'git://github.com/rack/rack.gi...
Ruby
class Rails::InfoController < ActionController::Base def properties info = [['Ruby version', "#{RUBY_VERSION} (#{RUBY_PLATFORM})"]] if defined? Gem::RubyGemsVersion info << ['RubyGems version', Gem::RubyGemsVersion] else info << ['RubyGems','disabled'] end info << ['Rack version', Rack...
Ruby
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
# Set our own default Notifier module ActiveSupport::Notifications self.notifier = Notifier.new(Fanout.new(true)) end
Ruby
# replace this file with the following require 'fileutils' FileUtils = FileUtils::NoWrite if ENV['RAILS_ENV'].eql? 'production' # $LOAD_PATH << 'lib' require 'rails' #require "rails/core" # EXCLUDE: active_record action_mailer active_resource #%w(active_model action_controller action_view).each do |framework| # begi...
Ruby
disable_system_gems disable_rubygems bundle_path ".gems/bundler_gems" clear_sources #source 'http://gems.github.com' #source 'http://rc-gems.appspot.com' source 'http://gemcutter.org' gem "sinatra" gem "json" gem "dm-core" gem "dm-appengine" #gem "dm-validations" gem "dm-timestamps" gem "dm-serializer" gem "dm-ar-fin...
Ruby
class Counter include DataMapper::Resource property :id, Serial property :name, String property :sequence, Integer, :default => 0 def self.get_sequence(name) counter = find_or_create(:name => name) counter.sequence +=1 counter.save counter.sequence end end
Ruby
class ChatUser USER_CHAT_TIMEOUT = 60 include DataMapper::Resource property :id, Serial property :username, String, :length => 32 property :ip_address, String, :length => 15 #15 chars for xxx.xxx.xxx.xxx for ip4 property :created_at, DateTime property :updated_at, DateTime property :last_seen_at, Date...
Ruby
class Chat include DataMapper::Resource property :id, Serial property :entity_type, String property :entity_id, Integer property :created_at, DateTime property :updated_at, DateTime has n, :messages has n, :chat_users end
Ruby
class Message include DataMapper::Resource property :id, Serial property :text, String, :length => 256 property :created_at, DateTime property :updated_at, DateTime property :sequence, Integer property :chat_id, Integer property :chat_user_id, Integer belongs_to :chat belongs_to :chat_user de...
Ruby
require 'sinatra' require 'json' require 'dm-core' #require 'dm-validations' require 'dm-timestamps' require 'dm-serializer' require 'dm-ar-finders' require 'haml' # Configure DataMapper to use the App Engine datastore DataMapper.setup(:default, "appengine://auto") require 'models/chat' require 'models/chat_user' re...
Ruby
require 'appengine-rack' require 'chat' AppEngine::Rack.configure_app(:application => "jrubychat", :version => 1) configure :development do class Sinatra::Reloader < ::Rack::Reloader def safe_load(file, mtime, stderr) if File.expand_path(file) == File.expand_path(::Sinatra::Application.app_file) :...
Ruby
require 'appengine-rack' AppEngine::Rack.configure_app( :application => "application-id", :version => 1 ) run lambda { Rack::Response.new("Hello World!").finish }
Ruby
# Critical default settings: disable_system_gems disable_rubygems bundle_path ".gems/bundler_gems" # List gems to bundle here: gem "dm-appengine" gem "merb-core"
Ruby
require 'appengine-rack' AppEngine::Rack.configure_app( :application => 'application-id', :version => 1) require 'rubygems' require 'merb-core' Merb::Config.setup( :merb_root => File.dirname(__FILE__), :environment => AppEngine::Rack.environment) Merb.environment = Merb::Config[:environment] Merb....
Ruby
# Critical default settings: disable_system_gems disable_rubygems bundle_path '.gems/bundler_gems' # List gems to bundle here: gem 'rails_dm_datastore' gem 'jruby-openssl' gem 'jruby-rack', '1.0.5' gem 'rails', '2.3.9'
Ruby
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
class Rails::InfoController < ActionController::Base def properties info = [['Ruby version', "#{RUBY_VERSION} (#{RUBY_PLATFORM})"]] if defined? Gem::RubyGemsVersion info << ['RubyGems version', Gem::RubyGemsVersion] else info << ['RubyGems','disabled'] end info << ['Rack version', Rack...
Ruby