code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/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/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'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/dbconsole'
| 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'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin'
| Ruby |
class AddPageantToRound < ActiveRecord::Migration
def self.up
add_column :rounds, :pageant_id, :integer
end
def self.down
remove_column :rounds, :pageant_id
end
end
| Ruby |
class AddPositionToRounds < ActiveRecord::Migration
def self.up
add_column :rounds, :position, :integer
end
def self.down
remove_column :rounds, :position
end
end
| Ruby |
class RemoveManualScoreFromRounds < ActiveRecord::Migration
def self.up
remove_column :rounds, :manual_score
end
def self.down
add_column :rounds, :manual_score, :float
end
end
| Ruby |
class AddPositionToContestants < ActiveRecord::Migration
def self.up
add_column :contestants, :position, :integer
end
def self.down
remove_column :contestants, :position
end
end
| Ruby |
class AddPageantIdToContestant < ActiveRecord::Migration
def self.up
add_column :contestants, :pageant_id, :integer
end
def self.down
remove_column :contestants, :pageant_id
end
end
| Ruby |
class CreateScores < ActiveRecord::Migration
def self.up
create_table :scores do |t|
t.integer :contestant_id
t.integer :judge_id
t.integer :round_id
t.float :value
t.timestamps
end
end
def self.down
drop_table :scores
end
end
| Ruby |
class AddPageantIdToScores < ActiveRecord::Migration
def self.up
add_column :scores, :pageant_id, :integer
end
def self.down
remove_column :scores, :pageant_id
end
end
| Ruby |
class AddManualScoreToRounds < ActiveRecord::Migration
def self.up
add_column :rounds, :manual, :boolean
add_column :rounds, :manual_score, :float
end
def self.down
remove_column :rounds, :manual
remove_column :rounds, :manual_score
end
end
| Ruby |
class CreatePageants < ActiveRecord::Migration
def self.up
create_table :pageants do |t|
t.string :title
t.timestamps
end
end
def self.down
drop_table :pageants
end
end
| Ruby |
class DropJudgesRounds < ActiveRecord::Migration
def self.up
drop_table :judges_rounds
end
def self.down
create_table :judges_rounds, :id=> false do |t|
t.integer :round_id, :null => false
t.integer :judge_id, :null => false
end
end
end
| Ruby |
class CreateJudges < ActiveRecord::Migration
def self.up
create_table :judges do |t|
t.string :alias
t.string :username
t.string :hashed_password
t.string :salt
t.timestamps
end
end
def self.down
drop_table :judges
end
end
| Ruby |
class AddPageantIdToJudge < ActiveRecord::Migration
def self.up
add_column :judges, :pageant_id, :integer
end
def self.down
remove_column :judges, :pageant_id
end
end
| Ruby |
class AddAbbreviationToRound < ActiveRecord::Migration
def self.up
add_column :rounds, :abbreviation, :string, :limit => 8
end
def self.down
remove_column :rounds, :abbreviation
end
end
| Ruby |
class CreateRounds < ActiveRecord::Migration
def self.up
create_table :rounds do |t|
t.string :description
t.float :max_score
t.timestamps
end
end
def self.down
drop_table :rounds
end
end
| Ruby |
class AddOrderingToRound < ActiveRecord::Migration
def self.up
add_column :rounds, :ordering, :integer
end
def self.down
remove_column :rounds, :ordering
end
end
| Ruby |
class CreateAdmins < ActiveRecord::Migration
def self.up
create_table :admins do |t|
t.string :hashed_password
t.string :salt
t.timestamps
end
end
def self.down
drop_table :admins
end
end | Ruby |
class RemoveNumberFromContestants < ActiveRecord::Migration
def self.up
remove_column :contestants, :number
end
def self.down
add_column :contestants, :number, :integer
end
end
| Ruby |
class AddNameToJudge < ActiveRecord::Migration
def self.up
add_column :judges, :name, :string
end
def self.down
remove_column :judges, :name
end
end
| Ruby |
class AddLockedToScore < ActiveRecord::Migration
def self.up
add_column :scores, :locked, :boolean
end
def self.down
remove_column :scores, :locked
end
end
| Ruby |
class CreateJudgesRounds < ActiveRecord::Migration
def self.up
create_table :judges_rounds, :id=> false do |t|
t.integer :round_id, :null => false
t.integer :judge_id, :null => false
end
end
def self.down
drop_table :judges_rounds
end
end
| Ruby |
class RemoveOrderingFromRound < ActiveRecord::Migration
def self.up
remove_column :rounds, :ordering
end
def self.down
add_column :rounds, :ordering, :integer
end
end
| Ruby |
class CreateContestants < ActiveRecord::Migration
def self.up
create_table :contestants do |t|
t.integer :number
t.string :name
t.timestamps
end
end
def self.down
drop_table :contestants
end
end
| Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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/dispat... | Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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/dispat... | Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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 Fast... | Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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/dispat... | Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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/dispat... | Ruby |
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/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 Fast... | 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 |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Major.create(:name... | Ruby |
class CreateShangpins < ActiveRecord::Migration
def self.up
create_table :shangpins do |t|
t.string :biaoti
t.string :neirong
t.string :tupian
t.string :url
t.decimal :jiage
t.decimal:laojiage
t.integer :shuliang
t.timestamps
end
end
def self.down
drop... | Ruby |
class CreateDingdans < ActiveRecord::Migration
def self.up
create_table :dingdans do |t|
t.string :shouhuoren
t.string :dizhi
t.string :youbian
t.integer :tel
t.string :peisong
t.string :zhifu
t.integer :youhu_id
t.timestamps
end
end
def self.down
drop... | Ruby |
class CreateCanshus < ActiveRecord::Migration
def self.up
create_table :canshus do |t|
t.string:biaoti
t.string :neirong
t.timestamps
end
d=Canshu.new
d.biaoti='sp'
d.save
end
def self.down
drop_table :canshus
end
end
| Ruby |
class CreateDingdan2shangpins < ActiveRecord::Migration
def self.up
create_table :dingdan2shangpins do |t|
t.integer :dingdan_id
t.integer :shangpin_id
t.integer :shuliang
t.timestamps
end
end
def self.down
drop_table :dingdan2shangpins
end
end
| Ruby |
class CreateYonghus < ActiveRecord::Migration
def self.up
create_table :yonghus do |t|
t.string :xingming
t.string :username
t.string :password
t.string :xingbie
t.date :shengri
t.integer :tel
t.string :dizhi
t.string :email
t.integer :tuijianid
t.intege... | Ruby |
class CreateCaijisps < ActiveRecord::Migration
def self.up
create_table :caijisps do |t|
t.string :biaoti
t.string :neirong
t.string :tupian
t.string :url
t.decimal :jiage
t.decimal :laojiage
t.integer :shuliang
t.date :shangcigenxin
t.timestamps
end
en... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class ActiveSupport::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 da... | Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/destroy'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/generate'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/destroy'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/plugin'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/plugin'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/generate'
| Ruby |
module ShangpinsHelper
end
| Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module CaijispsHelper
end
| Ruby |
module Dingdan2shangpinsHelper
end
| Ruby |
module DingdansHelper
end
| Ruby |
module CanshusHelper
end
| Ruby |
module YonghusHelper
end
| Ruby |
class Canshu < ActiveRecord::Base
end
| Ruby |
class Shangpin < ActiveRecord::Base
has_many:dingdan2shangpins
end
| Ruby |
class Yonghu < ActiveRecord::Base
end
| Ruby |
class Mymail < ActionMailer::Base
def send(email,name)
recipients email
from "aontimer@gmail.com"
subject "new project"
sent_on Time.now
body :name=>name
content_type "text/html"
end
end
| Ruby |
class Caijisp < ActiveRecord::Base
end
| Ruby |
class Dingdan2shangpin < ActiveRecord::Base
belongs_to:dingdan
belongs_to:shangpin
end
| Ruby |
class Dingdan < ActiveRecord::Base
has_many:dingdan2shangpins
belongs_to:yonghu
end
| 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
protect_from_forgery # See ActionController::RequestForgeryPr... | Ruby |
class ShangpinsController < ApplicationController
# GET /shangpins
# GET /shangpins.xml
def daoru
require 'hpricot'
require 'open-uri'
@doc=""
@doc=Hpricot(Iconv.iconv("UTF-8//IGNORE","euc-kr//IGNORE",open("http://sampleshop.co.kr/template/1/categ_list.asp?categ_code=16&page=1&cv=6&orderOPT=0&pagesize=612").... | Ruby |
class YonghusController < ApplicationController
# GET /yonghus
# GET /yonghus.xml
def index
@yonghus = Yonghu.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @yonghus }
end
end
def login
yonghu=0
if params[:yonghu]!=nil
yh=Yonghu.find(:first... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.