code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'rake/rdoctask'
spec = Gem::Specification.new do |s|
s.name = 'crackup-s3'
s.version = '1.0.0'
s.author = 'Ryan Grove'
s.email = 'ryan@wonko.com'
s.homepage = 'http://wonko.com/software/crackup'
s.platform = ... | Ruby |
require 'rubygems'
require 'net/amazon/s3'
require 'uri'
module Crackup; module Driver
# Amazon S3 storage driver for Crackup. Use the following format for S3 URLs:
#
# s3://<access key id>:<secret access key>@s3.amazonaws.com/<bucket>
#
# If the specified storage bucket does not exist, the dr... | Ruby |
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'rake/rdoctask'
spec = Gem::Specification.new do |s|
s.name = 'crackup-file'
s.version = '1.0.2'
s.author = 'Ryan Grove'
s.email = 'ryan@wonko.com'
s.homepage = 'http://wonko.com/software/crackup'
s.platform ... | Ruby |
require 'fileutils'
require 'uri'
module Crackup; module Driver
# Filesystem storage driver for Crackup.
#
# Author:: Ryan Grove (mailto:ryan@wonko.com)
# Version:: 1.0.2
# Copyright:: Copyright (c) 2006 Ryan Grove. All rights reserved.
# License:: New BSD License (http://opensource.org/... | Ruby |
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'rake/rdoctask'
spec = Gem::Specification.new do |s|
s.name = 'crackup-ftp'
s.version = '1.0.2'
s.author = 'Ryan Grove'
s.email = 'ryan@wonko.com'
s.homepage = 'http://wonko.com/software/crackup'
s.platform =... | Ruby |
require 'net/ftp'
require 'uri'
module Crackup; module Driver
# FTP storage driver for Crackup.
#
# Author:: Ryan Grove (mailto:ryan@wonko.com)
# Version:: 1.0.2
# Copyright:: Copyright (c) 2006 Ryan Grove. All rights reserved.
# License:: New BSD License (http://opensource.org/licenses/... | Ruby |
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'rake/rdoctask'
spec = Gem::Specification.new do |s|
s.name = 'crackup'
s.version = '1.0.2'
s.author = 'Ryan Grove'
s.email = 'ryan@wonko.com'
s.homepage = 'http://wonko.com/software/crackup'
s.platform = Gem... | Ruby |
module Crackup
class Error < StandardError; end
class CompressionError < Crackup::Error; end
class EncryptionError < Crackup::Error; end
class IndexError < Crackup::Error; end
class StorageError < Crackup::Error; end
end
| Ruby |
require 'crackup/fs_object'
require 'fileutils'
module Crackup
# Represents a symbolic link on the local filesystem.
class SymlinkObject
include FileSystemObject
attr_reader :file_hash, :target, :url
#--
# Public Instance Methods
#++
def initialize(linkname)
unle... | Ruby |
require 'crackup/fs_object'
require 'digest/sha2'
require 'fileutils'
module Crackup
# Represents a file on the local filesystem.
class FileObject
include FileSystemObject
attr_reader :file_hash, :url
def initialize(filename)
unless File.file?(filename)
raise ArgumentEr... | Ruby |
require 'crackup/fs_object'
require 'fileutils'
module Crackup
# Represents a directory on the local filesystem. Can contain any number of
# Crackup::FileSystemObjects as children.
class DirectoryObject
include Enumerable
include FileSystemObject
attr_reader :children
#--
# P... | Ruby |
require 'digest/sha2'
module Crackup
# Represents a filesystem object on the local filesystem.
module FileSystemObject
attr_reader :name, :name_hash
#--
# Public Class Methods
#++
# Returns an instance of the appropriate FileSystemObject subclass to
# represent _pa... | Ruby |
require 'uri'
module Crackup
# Base storage driver module for Crackup.
#
# To write a Crackup storage driver:
#
# - Create a class in Crackup::Driver named "FooDriver", where "Foo" is the
# capitalized version of the URI scheme your driver will handle (e.g.,
# "Ftp", "Sftp", etc.).
# ... | Ruby |
require 'crackup/errors'
require 'crackup/directory_object'
require 'crackup/driver'
require 'crackup/file_object'
require 'crackup/symlink_object'
require 'find'
require 'tmpdir'
require 'zlib'
module Crackup
GPG_DECRYPT = 'echo :passphrase | :gpg --batch --quiet --no-tty --no-secmem-warning --cipher-al... | Ruby |
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'rake/rdoctask'
spec = Gem::Specification.new do |s|
s.name = 'crackup-gmail'
s.version = '1.0.0'
s.author = 'Brett Stimmerman'
s.email = 'brettstimmerman@gmail.com'
s.homepage = 'http://wonko.com/software/crackup'
s.plat... | Ruby |
require 'rubygems'
require 'gmailer'
require 'uri'
module Crackup; module Driver
# GMail storage driver for Crackup.
#
# gmail://<username>:<password>@gmail.com/<label>
#
# Author:: Brett Stimmerman (mailto:brettstimmerman@gmail.com)
# Version:: 1.0.0
# Copyright:: Copyright (c) 2006 Brett Stimmer... | Ruby |
NOT READY YET
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
require 'oauth/oauth_util'
client = Google::APIClient.new
youtube = client.discovered_api('youtube', 'v3alpha')
auth_util = CommandLineOAuthHelper.new('https://www.googleapis.com/auth/youtube')
client.authorization = auth_util.authorize()
... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
require 'trollop'
# This code assumes that there's a client_secrets.j... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
# A limited OAuth 2 access scope that allows for read-only access.
YO... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
require 'trollop'
# An OAuth 2 access scope that allows for full read... | 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 'rubygems'
require 'google/api_client'
require 'trollop'
# Set DEVELOPER_KEY to the "API key" value from the "Access" tab of the
# Google APIs Console <http://code.google.com/apis/console#access>
# Please ensure that you have enabled the YouTube Data API for your project.
DEVELOPER_KEY = "REP... | Ruby |
#!/usr/bin/ruby
require 'rubygems'
require 'google/api_client'
# oauth/oauth_util is not part of the official Ruby client library.
# Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb
require 'oauth/oauth_util'
# An OAuth 2 access scope that allows for full read/write access.
YOU... | Ruby |
#!/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 |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'data_mapper', '~> 1.2'
gem 'dm-postgres-adapter'
gem 'google-api-client', '>= 0.4.3'
group :development do
gem 'dm-sqlite-adapter', '~> 1.2'
gem 'do_sqlite3', '~> 0.10'
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 |
module Jekyll
module BugFilter
def bugify(input)
upstream_map = {
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
"IE" => ["https://connect.microsoft.com/IE/feedback/details/", "IE bug"],
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
... | Ruby |
require 'yaml'
module Bridge
class Generator < Jekyll::Generator
def generate(site)
site.data["configBridge"] = YAML.load_file("./grunt/configBridge.json")
end
end
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 |
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 |
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 |
require 'sinatra/activerecord/rake'
require './main' | 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 |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'data_mapper', '~> 1.2'
gem 'dm-postgres-adapter'
gem 'google-api-client', '>= 0.4.3'
group :development do
gem 'dm-sqlite-adapter', '~> 1.2'
gem 'do_sqlite3', '~> 0.10'
end
| Ruby |
# Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# 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... | Ruby |
#!/usr/bin/env ruby
class ExampleRemoteLibrary
def count_items_in_directory(path)
Dir.entries(path).find_all{|i| not i.match('^\.')}.length
end
def strings_should_be_equal(str1, str2)
puts "Comparing '#{str1}' to '#{str2}'"
if str1 != str2
raise RuntimeError, "Given strings are not equal"
... | Ruby |
class RubyLibraryExample
def get_server_language
'ruby'
end
# Basic communication
def passing
end
def failing(message)
raise message
end
def logging(message, level='INFO')
puts "*#{level}* #{message}"
end
def returning
'returned string'
end
# Logging
def one_message_w... | Ruby |
# export function prototypes to thisfile.h
# use:
# <% export "int dostuff(int x)" %> {
# return x;
# }
safeguard = @outputname.split('.')[0].upcase + "_H"
@header = File.new(@outputname.split('.')[0] + ".h", "w")
@header.puts "#infndef #{safeguard}"
@header.puts "#define #{safeguard}"
def export(str)
@header.put... | Ruby |
#!/usr/bin/ruby
require 'fileutils'
RUBY_OPEN = "<%"
RUBY_CLOSE = "%>"
# keep variables separate from <% variables %>
class SafeContext
attr_accessor :finally
def initialize (outputname)
@finally = []
@outputname = outputname
end
end
# cleanup keeps track of .tmp files created for deletion later
clea... | Ruby |
# build_dcss_release.rb
# Builds DOS and Windows binaries for a Stone Soup release.
# Needs rubyzip to be installed.
require 'fileutils'
require 'zip/zipfilesystem'
SVN_BASE_URL = 'https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/'
SVN_BRANCH = 'branches/stone_soup-0.3'
SVN_URL = SVN_BASE_URL... | Ruby |
#!/usr/bin/env ruby
# encoding: utf-8
RED = "\033[0;31m"
GRN = "\033[0;32m"
NC = "\033[0m"
PASS = "#{GRN}PASS!#{NC}"
FAIL = "#{RED}FAIL!#{NC}"
Stats = Struct.new :total, :ok, :fail
$stats = Stats.new 0, 0, 0
def print_fail_report(t, out, outexpected)
puts "#{t}: #{FAIL}"
puts "-"*65
puts "Got:\n#{out}"
puts "-... | 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):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | Ruby |
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use yo... | 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 |
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | Ruby |
# Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | Ruby |
# Be sure to restart your server when you modify this file.
CrazyBid::Application.config.session_store :cookie_store, key: '_CrazyBid_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails... | Ruby |
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | Ruby |
CrazyBid::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = true
config.action... | Ruby |
CrazyBid::Application.configure do
# Settings specified here will take precedence over those in config/application.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 web s... | Ruby |
CrazyBid::Application.configure do
# Settings specified here will take precedence over those in config/application.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 s... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
CrazyBid::Application.initialize!
| Ruby |
require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| Ruby |
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.requi... | Ruby |
CrazyBid::Application.routes.draw do
resources :user_bids
resources :bids
resources :products
resources :helps
devise_for :users
get "home/index"
get "admin/transaction"
get "admin/index"
get "admin"=>"admin#index"
get "admin/user"
get "admin/destroy"
get "admin/win"
get "admin/history"
... | Ruby |
module AdminHelper
end
| Ruby |
module ApplicationHelper
end
| Ruby |
module HelpsHelper
end
| Ruby |
module BidsHelper
end
| Ruby |
module UserBidsHelper
end
| Ruby |
module ProductsHelper
end
| Ruby |
module HomeHelper
end
| Ruby |
module CcHelper
end
| Ruby |
class Bid < ActiveRecord::Base
has_one :user
belongs_to :product
has_many :user_bids, :dependent => :destroy
validate :rightBidTime
def rightBidTime
end
def getRemainingTime()
if getStatus() == _STARTED
remain = self.bid_end_time - Time.now;
return (remain/3600).to_i.to_s+ ":" + (remain... | Ruby |
class User < ActiveRecord::Base
has_many :bids
has_many :user_bids, :dependent => :destroy
validates :email,:presence=>true,:uniqueness=>true
validates :user_id_card_number,:presence=>true,:length=>{:is=>9},:numericality=>true
validates :user_realname,:presence=>true
validates :user_job,:presence=>true
v... | Ruby |
class Product < ActiveRecord::Base
has_many :bids, :dependent => :destroy
validates :product_price, :presence => true
validates :product_name, :presence => true
validates :product_description, :presence => true
def self.save(upload)
require 'fileutils'
tmp = upload[:datafile].tempfile
... | Ruby |
class UserBid < ActiveRecord::Base
belongs_to :user
belongs_to :bid
validates :user_price,:numericality => {:greater_than => 0, :less_than =>9999}
end
| Ruby |
class HomeController < ApplicationController
def index
@bids = Bid.find(:all,:conditions=>{:transaction_status=>"1"},:order=>"bid_end_time");
@de_bids = Bid.find(:all,:conditions=>{:transaction_status=>"0"},:order=>"bid_end_time");
@de_bids.each do |bid|
start = bid.bid_start_time;
ends = bid... | Ruby |
class ProductsController < ApplicationController
# GET /products
# GET /products.json
def index
@products = Product.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @products }
end
end
# GET /products/1
# GET /products/1.json
# GET /products/... | Ruby |
class AdminController < ApplicationController
def index
if(current_user.level<2)
@products = Product.all;
respond_to do |format|
format.html {render :layout=>false}# index.html.erb
format.json { render json: @user_bids }
end
else
render :nothing=>true
end
end
def transaction
if(current_use... | Ruby |
class HelpsController < ApplicationController
def index
respond_to do |format|
format.html # index.html.erb
format.json { render json: @bids }
end
end
end
| Ruby |
class BidsController < ApplicationController
# GET /bids
# GET /bids.json
def index
@bids = Bid.find(:all,:conditions=>{:transaction_status=>"1"},:order=>"bid_end_time");
@user_bid = UserBid.new;
@bid = nil;
if(!params.has_key?(:id))
@bid = Bid.find(:first,:conditions=>{:transaction_st... | Ruby |
class ApplicationController < ActionController::Base
protect_from_forgery
end
| Ruby |
class UserBidsController < ApplicationController
# GET /user_bids
# GET /user_bids.json
def index
@user_bids = UserBid.find(:all,:conditions=>{:user_id=>current_user.id},:order=>"time")
respond_to do |format|
format.html # index.html.erb
format.json { render json: @user_bids }
end
end
... | Ruby |
class CcController < ApplicationController
def index
if user_signed_in?
@user = User.find(current_user.id)
@user.update_attributes(:user_balance=>100000)
redirect_to "/"
else
redirect_to "/"
end
end
end
| Ruby |
#!/usr/bin/env rake
# 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.expand_path('../config/application', __FILE__)
CrazyBid::Application.load_tasks
| Ruby |
#!/usr/bin/env ruby
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
if vendored_cucumber_bin
load File.expand_path(vendored_cucumber_bin)
else
require 'rubygems' unless ENV['NO_RUBYGEMS']
require 'cucumber'
load Cucumber::BINARY
end
| Ruby |
#!/usr/bin/env ruby
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
if vendored_cucumber_bin
load File.expand_path(vendored_cucumber_bin)
else
require 'rubygems' unless ENV['NO_RUBYGEMS']
require 'cucumber'
load Cucumber::BINARY
end
| Ruby |
#!/usr/bin/env rake
# 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.expand_path('../config/application', __FILE__)
CrazyBid::Application.load_tasks
| Ruby |
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'devise'
gem 'paperclip', '~> 3.0'
gem 'will_paginate', '~> 3.0'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem... | Ruby |
class AddBidIdToUserBids < ActiveRecord::Migration
def change
add_column :user_bids, :bid_id, :integer
end
end
| Ruby |
class AddUserEmailToUsers < ActiveRecord::Migration
def change
add_column :users, :user_email, :string
end
end
| Ruby |
class AddUserPhoneToUsers < ActiveRecord::Migration
def change
add_column :users, :user_phone, :string
end
end
| Ruby |
class AddUserIdToUserBids < ActiveRecord::Migration
def change
add_column :user_bids, :user_id, :integer
end
end
| Ruby |
class AddAwardToBids < ActiveRecord::Migration
def change
add_column :bids, :award, :integer, :default=>0
end
end
| Ruby |
class AddUserBalanceToUsers < ActiveRecord::Migration
def change
add_column :users, :user_balance, :integer
end
end
| Ruby |
class AddUserRealnameToUsers < ActiveRecord::Migration
def change
add_column :users, :user_realname, :string
end
end
| Ruby |
class AddProductIdToBids < ActiveRecord::Migration
def change
add_column :bids, :product_id, :integer
end
end
| Ruby |
class AddUserAddressToUsers < ActiveRecord::Migration
def change
add_column :users, :user_address, :string
end
end
| Ruby |
class AddUserIdCardNumberToUsers < ActiveRecord::Migration
def change
add_column :users, :user_id_card_number, :string
end
end
| Ruby |
class AddUserJobToUsers < ActiveRecord::Migration
def change
add_column :users, :user_job, :string
end
end
| Ruby |
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.string :product_name
t.integer :product_price
t.string :product_description
t.string :product_image
t.timestamps
end
end
end
| Ruby |
class AddLevelToUsers < ActiveRecord::Migration
def change
add_column :users, :level, :integer, :default=>2
end
end
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.