code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/usr/bin/ruby
# Copyright 2011 Google Inc. All Rights Reserved.
#
# 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.org/licenses/LICENSE-2.0
#
# Unless required ... | Ruby |
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'json'
require 'launchy'
require 'thin'
RESPONSE_HTML = <<stop
<html>
<head>
<title>OAuth 2 Flow Complete</title>
</head>
<body>
You have successfully completed the OAuth 2 flow. Please close this browser window and return to ... | Ruby |
#!/usr/bin/ruby
require 'benchmark'
Benchmark.bm do |x|
[1, 2, 5, 10, 20].each do |thread_count|
x.report("#{thread_count} threads:") do
system('./analyticsdump.rb', '--threads', thread_count.to_s)
end
sleep(60)
end
end | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
require 'logger'
require 'oauth/oauth_util'
require 'sqlite3'
require 'thread'
require 'trollop'
YOUTUBE_API_READONLY_SCOPE = 'https://www.googleapis.com/auth/youtube.readonly'
YOUTUBE_ANALYTICS_API_SCOPE = 'https://www.googleapis.com/auth/yt-analytics.re... | Ruby |
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'json'
require 'launchy'
require 'thin'
RESPONSE_HTML = <<stop
<html>
<head>
<title>OAuth 2 Flow Complete</title>
</head>
<body>
You have successfully completed the OAuth 2 flow. Please close this browser window and return to ... | Ruby |
#!/usr/bin/ruby
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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.org/licenses/LICENSE-2.0
#
# Unless required ... | Ruby |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Ruby |
require 'sinatra/activerecord/rake'
require './main' | Ruby |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'sinatra-activerecord'
gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client'
group :development do
gem 'rake'
gem 'sqlite3-ruby'
end
| Ruby |
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
t.string :profile_id
t.string :email
t.string :refresh_token
end
add_index :users, :profile_id
end
def down
drop_table :users
end
end
| Ruby |
# Copyright (C) 2012 Google Inc.
#
# 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Ruby |
require 'sinatra.rb'
# Sinatra defines #set at the top level as a way to set application configuration
set :run, false
set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development)
require './main'
run Sinatra::Application | Ruby |
# Requires that XmlSimple is already loaded, like it is from within script/console in the latest beta Rails
# Author: David Heinemeier Hansson, 37signals
require 'yaml'
require 'net/https'
class Backpack
attr_accessor :username, :token, :current_page_id
def initialize(username, token)
@username, @token = u... | Ruby |
#!/usr/local/bin/ruby
require 'rubygems'
require 'xmlsimple'
@home_dir = File.expand_path("~")
require File.join(@home_dir, 'backpack')
def format_time(t)
t.strftime("%B %d, %Y at %I:%M %p")
end
command = ARGV.shift
home_dir = ENV['HOME']
config_path = File.join(home_dir, '.backpack.yml')
if !File.exist?(config_... | Ruby |
#!/usr/local/bin/ruby
require 'rubygems'
require 'xmlsimple'
@home_dir = File.expand_path("~")
require File.join(@home_dir, 'backpack')
def format_time(t)
t.strftime("%B %d, %Y at %I:%M %p")
end
command = ARGV.shift
home_dir = ENV['HOME']
config_path = File.join(home_dir, '.backpack.yml')
if !File.exist?(config_... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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.lo... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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.lo... | Ruby |
#!/usr/local/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 impai... | 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/local/bin/ruby
require 'fileutils'
require 'yaml'
@command = ARGV.shift
@home_dir = File.expand_path("~")
@contacts_path = File.join(@home_dir, '.contacts.yml')
@config_path = File.join(@home_dir, '.mailjitsu.yml')
if File.exist?(@config_path)
# We go through this hack because otherwise when symlinking '~/... | 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/destroy'
| Ruby |
#!/usr/local/bin/ruby
require 'fileutils'
require 'yaml'
@command = ARGV.shift
@home_dir = File.expand_path("~")
@contacts_path = File.join(@home_dir, '.contacts.yml')
@config_path = File.join(@home_dir, '.mailjitsu.yml')
if File.exist?(@config_path)
# We go through this hack because otherwise when symlinking '~/... | 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/console'
| 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/server'
| 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/plugin'
| 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/spawner'
| 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/reaper'
| 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/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/benchmarker'
| 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/generate'
| Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
class Mailer < ActionMailer::Base
def email(recipient, subject, message)
@subject = subject
@body["message"] = message
@body["signature"] = MAILER_OPTIONS[:signature] || ''
@recipients = recipient
@from = "#{MAILER_OPTIONS[:from_name]} <#{MAILER_OPTIONS[:user_... | Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# i... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| Ruby |
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# ... | Ruby |
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
... | Ruby |
# Be sure to restart your server when you modify this file
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.0... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Full error repor... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.ca... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
| Ruby |
#!/usr/bin/env ruby
require "rubygems"
require "json"
require "yaml"
yamlfiles = Dir.glob("#{ File.dirname(__FILE__) }/*.yaml")
yamlfiles.each{ |file|
puts(file)
yaml = YAML.load_file(file)
json = JSON.pretty_generate(YAML.load_file(file))
File.open(file.gsub("\.yaml", "\.json"), 'w'){ |out| puts "writing #... | Ruby |
#!/usr/bin/env ruby
require "rubygems"
require "json"
require "yaml"
yamlfiles = Dir.glob("#{ File.dirname(__FILE__) }/*.yaml")
yamlfiles.each{ |file|
puts(file)
yaml = YAML.load_file(file)
json = JSON.pretty_generate(YAML.load_file(file))
File.open(file.gsub("\.yaml", "\.json"), 'w'){ |out| puts "writing #... | Ruby |
# test-loop
# loops a green light from left to right, and then a blue one from right to left
# put in our requirements.
require '../../libcombustd/libcombustd';
puts "\nRunning test-loop\n"
# Some dummy code to test the Ambx interface
# try to connect and open the device and then loop trough some colors.
if Ambx.co... | Ruby |
class ProtocolDefinitions
# Product information
USB_VENDOR_ID = 0x0471
USB_PRODUCT_ID = 0x083F
# Usb endpoints
ENDPOINT_IN = 0x81
ENDPOINT_OUT = 0x02
ENDPOINT_PNP = 0x83
# -- Commands --
# Set a single color, for a specific light
# Params 0xRR 0xGG 0xBB
# 0xRR = Red color
# 0xGG = Green c... | Ruby |
# Definitions so we do not need to remember the hex values for the lights
class Lights
# LEFT/RIGHT lights. Normally placed adjecent to your screen.
LEFT = 0x0B
RIGHT = 0x1B
# Wallwasher lights. Normally placed behind your screen.
WWLEFT = 0x2B
WWCENTER = 0x3B
WWRIGHT = 0x4B
end | Ruby |
REQUIREMENTPATH = File.dirname(__FILE__)
# ruby-usb; http://www.a-k-r.org/ruby-usb/
# a ruby wrapper around libusb, needs to be compiled from source and gem installed.
require 'usb'
# Classes for definitions
require REQUIREMENTPATH + '/data/protocoldefinitions'
require REQUIREMENTPATH + '/data/lights'
# Classes for ... | Ruby |
require 'singleton'
# Ambx class is a singleton to manage all traffic flowing to the ambx device.
# Handles all connections and errors, which can be boolean checked by the application.
# Example usage:
# Ambx.open
# Ambx.connect
# Ambx.write([0x01, Lights::WWCENTER, ProtocolDefinitions::SET_LIGHT_COLOR, 0x00, 0xFF, 0... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + '/../../libcombustd/libcombustd'
puts "\ncombustd - a small server to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail: combustd@sexybiggetje.... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nboblight - a small tool to listen to the output of boblight popen to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceaniu... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nsetcolor - a small utility to configure a set of Philips Ambx lights to a specific color.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail:... | Ruby |
# test-loop
# loops a green light from left to right, and then a blue one from right to left
# put in our requirements.
require '../../libcombustd/libcombustd';
puts "\nRunning test-loop\n"
# Some dummy code to test the Ambx interface
# try to connect and open the device and then loop trough some colors.
if Ambx.co... | Ruby |
class ProtocolDefinitions
# Product information
USB_VENDOR_ID = 0x0471
USB_PRODUCT_ID = 0x083F
# Usb endpoints
ENDPOINT_IN = 0x81
ENDPOINT_OUT = 0x02
ENDPOINT_PNP = 0x83
# -- Commands --
# Set a single color, for a specific light
# Params 0xRR 0xGG 0xBB
# 0xRR = Red color
# 0xGG = Green c... | Ruby |
# Definitions so we do not need to remember the hex values for the lights
class Lights
# LEFT/RIGHT lights. Normally placed adjecent to your screen.
LEFT = 0x0B
RIGHT = 0x1B
# Wallwasher lights. Normally placed behind your screen.
WWLEFT = 0x2B
WWCENTER = 0x3B
WWRIGHT = 0x4B
end | Ruby |
REQUIREMENTPATH = File.dirname(__FILE__)
# ruby-usb; http://www.a-k-r.org/ruby-usb/
# a ruby wrapper around libusb, needs to be compiled from source and gem installed.
require 'usb'
# Classes for definitions
require REQUIREMENTPATH + '/data/protocoldefinitions'
require REQUIREMENTPATH + '/data/lights'
# Classes for ... | Ruby |
require 'singleton'
# Ambx class is a singleton to manage all traffic flowing to the ambx device.
# Handles all connections and errors, which can be boolean checked by the application.
# Example usage:
# Ambx.open
# Ambx.connect
# Ambx.write([0x01, Lights::WWCENTER, ProtocolDefinitions::SET_LIGHT_COLOR, 0x00, 0xFF, 0... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + '/../../libcombustd/libcombustd'
puts "\ncombustd - a small server to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail: combustd@sexybiggetje.... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nboblight - a small tool to listen to the output of boblight popen to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceaniu... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nsetcolor - a small utility to configure a set of Philips Ambx lights to a specific color.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail:... | Ruby |
# test-loop
# loops a green light from left to right, and then a blue one from right to left
# put in our requirements.
require '../../libcombustd/libcombustd';
puts "\nRunning test-loop\n"
# Some dummy code to test the Ambx interface
# try to connect and open the device and then loop trough some colors.
if Ambx.co... | Ruby |
class ProtocolDefinitions
# Product information
USB_VENDOR_ID = 0x0471
USB_PRODUCT_ID = 0x083F
# Usb endpoints
ENDPOINT_IN = 0x81
ENDPOINT_OUT = 0x02
ENDPOINT_PNP = 0x83
# -- Commands --
# Set a single color, for a specific light
# Params 0xRR 0xGG 0xBB
# 0xRR = Red color
# 0xGG = Green c... | Ruby |
# Definitions so we do not need to remember the hex values for the lights
class Lights
# LEFT/RIGHT lights. Normally placed adjecent to your screen.
LEFT = 0x0B
RIGHT = 0x1B
# Wallwasher lights. Normally placed behind your screen.
WWLEFT = 0x2B
WWCENTER = 0x3B
WWRIGHT = 0x4B
end | Ruby |
REQUIREMENTPATH = File.dirname(__FILE__)
# ruby-usb; http://www.a-k-r.org/ruby-usb/
# a ruby wrapper around libusb, needs to be compiled from source and gem installed.
require 'usb'
# Classes for definitions
require REQUIREMENTPATH + '/data/protocoldefinitions'
require REQUIREMENTPATH + '/data/lights'
# Classes for ... | Ruby |
require 'singleton'
# Ambx class is a singleton to manage all traffic flowing to the ambx device.
# Handles all connections and errors, which can be boolean checked by the application.
# Example usage:
# Ambx.open
# Ambx.connect
# Ambx.write([0x01, Lights::WWCENTER, ProtocolDefinitions::SET_LIGHT_COLOR, 0x00, 0xFF, 0... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + '/../../libcombustd/libcombustd'
puts "\ncombustd - a small server to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail: combustd@sexybiggetje.... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nboblight - a small tool to listen to the output of boblight popen to control a set of Philips Ambx lights.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceaniu... | Ruby |
REQUIREMENTS = File.dirname(__FILE__)
require REQUIREMENTS + "/../../libcombustd/libcombustd"
puts "\nsetcolor - a small utility to configure a set of Philips Ambx lights to a specific color.\n"
puts "See README and docs/ for faq, usage and support.\n\n"
puts "Looking for support ?\nChat: irc.oceanius.com #dev\nMail:... | Ruby |
class CreateMasters < ActiveRecord::Migration
def self.up
create_table :masters do |t|
t.integer :toast_id
t.string :name
t.text :credentials
t.timestamps
end
end
def self.down
drop_table :masters
end
end
| Ruby |
class CreateToasts < ActiveRecord::Migration
def self.up
create_table :toasts do |t|
t.datetime :start_time
t.datetime :end_time
t.string :location
t.integer :capacity
t.timestamps
end
end
def self.down
drop_table :toasts
end
end
| Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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.lo... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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 impai... | Ruby |
#!/usr/local/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.lo... | Ruby |
#!/usr/local/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 impai... | Ruby |
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
namespace :deploy do
task :start, :roles => :app do
run "mv #{current_path}/config/database.yml #{deploy_to}/shared/database.yml"
run "ln -s #{deploy_to}/shared/database.yml #{current_path}/config/database.yml"
run "tou... | 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'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about' | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.