code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!C:/ruby/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
#... | Ruby |
#!C:/ruby/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... | Ruby |
#!C:/ruby/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... | Ruby |
#!C:/ruby/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
#... | 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 |
# Steps definitions for security
# Fixture instantiation
Given /a "(.*)" group/ do |group|
Given 'I visit admin/security'
And 'I click the "Security Groups" link'
And 'I click the "Create" button'
And "I put \"#{group}\" in the \"Title\" field"
And 'I click the "Save" button'
end
Given /a user called "(.*)... | Ruby |
## FIXTURE GENERATON
Given /^the site can be edited by the "([^\"]*)" group$/i do |arg1|
pending
end
Given /^the "([^\"]*)" page can be edited by the "([^\"]*)" group$/i do |arg1, arg2|
pending
end
Given /a "(.*)" page called "(.*)" as a child of "(.*)"/i do |type, title, parent|
Given "I click the \"#{paren... | Ruby |
# Log in
Given /log in as (.*)$/ do |user|
Given "I fill out the log in form with user \"#{user}\" and password \"password\""
And 'I see "You\'re logged in as"'
end
Given /log into the CMS as (.*)/ do |user|
Given "I log in as #{user}"
And "I visit admin/"
And "I load the root node"
end
Given /log out$/ do
... | Ruby |
##
## General rules for the SilverStripe CMS as a whole. They mostly have to do with the LeftAndMain
## interface
# Match general CMS tabs, ModelAdmin needs another system
Given /I click on the "([^\"]*)" tab/ do |tab|
found = nil
links = @salad.browser.links()
links.each {|link|
if /^tab-.+/.match(link.id) then... | Ruby |
##
## Step definitions for testing the front-end site
##
Given /I go to the draft site/ do
pending
Given 'I click the "viewStageSite" link'
# |''element''|//a[@id="viewStageSite"]|''exists''|
# |''checking timeout''|@{fast_checking_timeout}|
# |''optionally''|''element''|//a[@id="viewStageSite"][@style=""]|''e... | Ruby |
def loadFixture(fileName)
if $baseURL and $browser then
$browser.goto $baseURL + "dev/tests/sessionloadyml?fixture=" + fileName + "&flush=1"
else
fail("No \$baseUrl or \$browser found")
end
end
def startSession
# Reset database
if $baseURL and $browser then
$browser.goto $baseURL + 'dev/tests/endsession'
e... | Ruby |
#
# jQuery File Tree Ruby Connector
#
# Version 1.01
#
# Erik Lax
# http://datahack.se
# 13 July 2008
#
# History
#
# 1.01 Initial Release
#
# Output a list of files for jQuery File Tree
#
#<settings>
#root = "/absolute/path/"
# or
root = File.expand_path(".")
#</settings>
#<code>
require "cgi"... | Ruby |
h1 = {
'a'=>'One',
'b'=>'Two',
'c'=>'Three',
'd'=>'Four'
}
p(h1)
print "--------------------------------------------------------------------------------------------------\n"
$continue
begin
$continue = ''
print "[Ban nhap key can seach]\n"
key = gets.to_s.chomp
if h1[key]!=nil
... | Ruby |
require File.dirname(__FILE__) + '/library.rb'
print "Ban nhap key can thuc thi\n HinhVuong key [1]\n HinhTron key [2]\n HinhChunhat key [3]\n"
$key = gets.to_i
if $key == 1
hv = HinhVuong.new
a = gets.to_i
print "#{hv.Dientich (a)}\n"
print "#{hv.Chuvi (a)}"
end
if $key == 2
ht = Hinhtron.new
... | Ruby |
$temp = ""
if File.exist? "input"
infile = File.open("input",'r')
while line=infile .gets
$temp <<line
end
$temp.swapcase!
infile.close
outfile = File.new("output", 'w+')
outfile.puts "#{$temp}"
outfile.close
else
puts "File Not Found"
end
| Ruby |
class HinhVuong
def initialize
puts "[Tinh dien tich hoac chu vi hinh vuong ban can nhap chieu dai 1 canh]"
puts "Chieu dai canh a:"
end
def Dientich (a)
puts "Dien tich hinh vuong: [canh]*[canh]:"
return a*a
end
def Chuvi (a)
puts "Chu vi hinh vuong: [canh]*[4]:"
return a*4... | Ruby |
'check prime'
def isPrime (num)
if num<2
return FALSE
end
if num==2
return TRUE
end
stemp = Math .sqrt (num)
for x in 2..stemp do
if num%x==0 then
return FALSE
end
end
return TRUE
end
'printf prime power'
def printPrimePower (num)
$result = Array.new(... | Ruby |
print("Giai Phuong trinh bac 2\n")
print('a = ')
a = gets.to_i
print('b = ')
b = gets.to_i
print('c = ')
c = gets.to_i
d = b*b - 4*a*c
if d>0
x1 = (-b-Math.sqrt(d))/(2*a)
x2 = (-b+Math.sqrt(d))/(2*a)
print("Phuong trinh co 2 nghiem phan biet\n")
puts "%.4f"%x1
puts "%.4f"%x2
elsif d==0
... | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css-debug")
environment = :development
output_style = :expanded | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
environment = :production
output_style = :compressed | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
environment = :development
output_style = :expanded
| Ruby |
# This file registers the sencha-touch framework with compass
# It's a magic name that compass knows how to find.
dir = File.dirname(__FILE__)
require File.join(dir, 'lib', 'theme_images.rb')
Compass::Frameworks.register 'sencha-touch', dir
| Ruby |
stylesheet 'sencha-touch.scss' | Ruby |
module SenchaTouch
module SassExtensions
module Functions
module ThemeImages
def theme_image(theme, path, mime_type = nil)
path = path.value
images_path = File.join(File.dirname(__FILE__), "..", "images", theme.value)
real_path = File.join(images_path, path)
i... | Ruby |
require 'net/http'
server = "msdl.microsoft.com"
pdb = "ntkrnlmp"
guid = "30092be745b24fe2a311a936e7b7486f2"
uri = "/download/symbols/#{pdb}.pdb/#{guid}/#{pdb}.pd_"
dest = "#{pdb}.pd_"
puts uri
Net::HTTP.start(server) { |http|
headers = {"User-Agent" => "Microsoft-Symbol-Server/6.6.0007.5"}
resp = http.get(u... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
require 'metasm'
require 'virtdbg'
require 'optparse'
$VERBOSE = false
# parse arguments
opts = { :device => 0 }
OptionParser.new { |opt|
opt.banner = 'Usage: virtdbg.... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
module VirtDbg
VIRTDBGDIR = File.dirname(__FILE__)
# add it to the ruby library path
$: << VIRTDBGDIR
end
%w[forensic1394 virtdbg util main system].each { |f|
require ... | Ruby |
# This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
#
# this exemple illustrates the use of the cparser/preprocessor #factorize functionnality:
# we write some code using standard headers, and t... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
require 'metasm'
require 'metasm/dynldr'
include Metasm
module VirtDbg
class Forensic1394 < Metasm::DynLdr
new_api_c File.read(File.join(VIRTDBGDIR, "inc", ... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
require 'metasm'
require 'metasm/dynldr'
include Metasm
module VirtDbg
class VirtDbgMem < VirtualString
def initialize(impl, addr=0, length=nil)
... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
require 'metasm'
require 'metasm/dynldr'
require 'iconv'
class String
def utf16_to_iso
converter = Iconv.new('ISO-8859-1//IGNORE//TRANSLIT', 'UTF-16')
... | Ruby |
# This file is part of Virtdbg
# Copyright (C) 2010-2011 Damien AUMAITRE
#
# Licence is GPLv3, see LICENCE.txt in the top-level directory
require 'metasm'
require 'metasm/dynldr'
include Metasm
def calc_checksum(data)
data.unpack('C*').inject(0) { |sum, byte| sum+byte }
end
module VirtDbg
class ... | Ruby |
# ripped from metasm/misc
class IO
def hexdump(ctx={})
ctx[:noend] = true
while buf = read(512) and not buf.empty?
buf.hexdump(ctx)
end
ctx.delete :noend
''.hexdump(ctx)
end
end
class String
def hexdump(ctx={})
fmt = ctx[:fmt] ||= ['c', 'd', 'a']
... | 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 |
#定义每页显示数目全局变量
$perPage = 25
#----------开发环境配置-----------#
#系统相对路径
$urr = "http://localhost:3000/"
#上传文件服务器路径
$upload_path = "D://work/tomcat5.5/webapps/img"
#图片展示路径
$img_path = "http://localhost:8880/img"
#扫描上传文件路径
$img_upload = "d://upload"
#----------------------------------#
#----------生产环境配置-------------#
#系统相对路径... | Ruby |
require 'rubygems'
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.start_new
#every day at 2:00
scheduler.cron '0 2 * * 1-7' do
sql = "update resources set day_score = 0"
ActiveRecord::Base.connection.execute(sql)
end
#every weekend
scheduler.cron '00 2 * * 7' do
sql = "update resources set week_score = ... | Ruby |
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveReco... | 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
Mime::Type.register "text/vnd.wap.wml", :wml
| Ruby |
# Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions 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 attacks.
Act... | 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 do debug a probl... | 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
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_reque... | 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 |
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
... | 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 |
ActionController::Routing::Routes.draw do |map|
map.connect '', :controller => "wap"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
| Ruby |
module AdHelper
#首页广告
def get_wap_ads
@ad = nil
ads = Ad.find :all,
:conditions =>['status = ? and orders = ?','1',1],
:order => 'rand()',
:limit => '1'
if ads.size > 0
@ad = ads[0]
end
return @ad
end
#栏目广告
def get_col_ads
@ad = nil
ads = Ad.find :all,
... | Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def get_host_name
host = request.domain
lel = Level.find_last_by_host host.swapcase
le_default = Level.find_last_by_is_default true
@hots_name = le_default.name
unless lel.nil?
@hot... | Ruby |
module GuideHelper
end
| Ruby |
module ChannelsHelper
def list_options
lists = find(:all, :select=>"id,name",rder=>"name").collect{|p| [p.name,p.id]}
end
end
| Ruby |
module UserHelper
end
| Ruby |
module LevelHelper
end
| Ruby |
module SectionsHelper
end
| Ruby |
module ColHelper
#根据资源得到分页后的具体资源数组,针对show的单个图片
def get_resource_pagin(resource,type,pp_num)
#得到的图片的数组
src_arry = Array.new
return_arry = Array.new
small_path = File.join($upload_path,resource.res_dir,type)
src_arry = DataFile.traverse_dir(small_path, src_arry)
src_arry.each do |str|... | Ruby |
module ResourcesHelper
def check_boxes(form_name, field_name, choices, options)
object = self.instance_variable_get("@#{form_name}")
selected = object ? object.send("#{field_name}").to_a : []
choices = choices.to_a if Hash === choices
choices.inject([]) do |tags, element|
if !element.is_a?(Strin... | Ruby |
module WapHelper
def ge_date
Time.now.strftime("%m-%d")
end
#sid
def my_sid
if cookies[:sid].nil?
@sid = request.params[:sid]
else
@sid = cookies[:sid]
end
return @sid
end
#click_num
def my_cn
@cn = request.params[:cn]
return @cn
end
def get_section... | Ruby |
module AdStHelper
def get_ad id
@ad = nil
begin
@ad = Ad.find(id)
end
return @ad
end
end
| Ruby |
module ChangeHelper
#随机图片
def get_resource_rand(resource,type)
#得到的图片的数组
src_arry = Array.new
return_arry = Array.new
pic_path = File.join($upload_path,resource.res_dir,type)
src_arry = DataFile.traverse_dir(pic_path, src_arry)
src_arry.each do |str|
return_arry.push str.gsub($upload_... | Ruby |
# Prototype Window Class Helper (http://pwc-helper.xurdeonrails.com)
# by Jorge D�az (http://xurde.info)
# thanks to Sebastien Gruhier for his Prototype Window Class (http://prototype-window.xilinus.com/)
#Quick use:
#Reference this helper in your rails applicaction adding -> helper :prototype_window_class in your app... | Ruby |
module LogHelper
end
| Ruby |
module UserCfgHelper
#得到图片的真实路径
def get_img_path user_collect,type
src_arry = []
small_path = File.join($upload_path,user_collect.img_path,type)
src_arry = DataFile.traverse_dir(small_path, src_arry)
index = user_collect.img_index
@img_path = src_arry[index].gsub($upload_path, $img_path)
end
... | Ruby |
class Channel < ActiveRecord::Base
def self.list_options
find(:all, :select=>"id,name",rder=>"name").collect{|p| [p.name,p.id]}
end
end
| Ruby |
class GuideExec < ActiveRecord::Base
def self.set_guide_map g
ges = GuideExec.find_by_sql("select * from guide_execs as ge where date_format(ge.created_at,'%Y-%m-%d') = '#{Time.now.strftime('%Y-%m-%d')}' and ge.guide_id = #{g.id}")
if ges.size > 0
ge = ges[0]
if g.num.to_i > ge.need_num.to_i
... | Ruby |
class Section < ActiveRecord::Base
belongs_to :channel, :class_name => "Channel", :foreign_key => "channel_id"
end
| Ruby |
class ResTag < ActiveRecord::Base
set_table_name "res_tags"
belongs_to :resource, :class_name =>"Resource", :foreign_key=>"res_id"
belongs_to :tag, :class_name =>"Tag", :foreign_key=>"tag_id"
end
| Ruby |
class AdStatic < ActiveRecord::Base
end
| Ruby |
class Log < ActiveRecord::Base
end
| Ruby |
class Fr < ActiveRecord::Base
end
| Ruby |
class DataFile < ActiveRecord::Base
def self.save(upload)
name = upload['datafile'].original_filename
directory = "public/data"
# create the file path
FileUtils.makedirs("#{RAILS_ROOT}/public/upload")
path = File.join(directory, name)
# write the file
File.open(path, "wb") { |f| f.write(u... | Ruby |
class UserCfg < ActiveRecord::Base
has_many :user_comment, :class_name =>"UserComment", :foreign_key=>"user_id",
:dependent=> :delete_all
has_many :user_collect, :class_name =>"UserCollect", :foreign_key=>"user_id",
:dependent=> :delete_all
end
| Ruby |
class Level < ActiveRecord::Base
def self.get_level_by_host(host)
Level.find_last_by_host(host)
end
def self.set_level_map
levels = Level.find :all
$level_map.clear
levels.each do |l|
$level_map[l.host.swapcase] = l
end
end
end
| Ruby |
class Guide < ActiveRecord::Base
end
| Ruby |
class User < ActiveRecord::Base
end
| Ruby |
class FrStat < ActiveRecord::Base
belongs_to :fr, :class_name => "Fr", :foreign_key => "fr_id"
end
| Ruby |
class Tag < ActiveRecord::Base
has_many :res_tag, :class_name =>"ResTag", :foreign_key=>"tag_id",
:dependent=> :delete_all
has_many :resources, :through => :res_tag
end
| Ruby |
class Ad < ActiveRecord::Base
end
| Ruby |
class UserCollect < ActiveRecord::Base
belongs_to :user_cfg, :class_name => "UserCfg", :foreign_key => "user_id"
belongs_to :resource, :class_name => "Resource", :foreign_key => "res_id"
end
| Ruby |
class Resource < ActiveRecord::Base
belongs_to :section, :class_name => "Section", :foreign_key => "col_id"
has_many :res_tag, :class_name =>"ResTag", :foreign_key=>"res_id",
:dependent=> :delete_all
has_many :tags, :through => :res_tag
has_many :user_comment, :class_name =>"UserComment", :foreign_key=... | Ruby |
class UserComment < ActiveRecord::Base
belongs_to :user_cfg, :class_name => "UserCfg", :foreign_key => "user_id"
belongs_to :resource, :class_name => "Resource", :foreign_key => "res_id"
end
| Ruby |
class WapController < ApplicationController
before_filter :set_cookies_or_url
after_filter :log_filter,:except => [:index]
layout "wap"
include WapHelper
def index
redirect_to params.merge!(:action => 'show')
end
def show
params[:cn] = params[:cn].to_i + 1
@oper_type = 1
@img_style = p... | Ruby |
class AdStController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
#查询广告
def list
#提交表单为post
@ads = AdStatic.find_by_sql("SELECT count(*)as ct,ad_id,ad_name,date_format(created_at,'%Y-%m-%d') as created_date FROM `ad_statics` GRO... | Ruby |
class UserCfgController < ApplicationController
before_filter :set_cookies_or_url
after_filter :log_filter,:except => [:index]
layout "user_cfg"
include UserCfgHelper
def index
redirect_to params.merge!(:action => 'user_cfg')
end
#我的地盘
def user_cfg
params[:cn] = params[:cn].to_i + 1
@titles... | Ruby |
require 'digest/md5'
class UserController < ApplicationController
def login
end
def verify
hash_pass = Digest::MD5.hexdigest(params[:user][:userpass])
user = User.find(:first , :conditions => ["name=? and pass=?",params[:user][:username],hash_pass ] )
if not user
#有时候我们手动添加用户到数据库的时候可能添加的md5值中字母... | Ruby |
class ResourcesController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
# redirect_to :action=>'list'
redirect_to params.merge!(:action => 'list')
end
def list
@section = Section.new
@col = Section.new
@res_name = params[:res_name]
@channel_id = par... | Ruby |
class ChangeController < ApplicationController
before_filter :set_cookies_or_url
after_filter :log_filter,:except => [:index]
include ChangeHelper
def index
redirect_to params.merge!(:action => 'show')
end
def show
params[:cn] = params[:cn].to_i
@oper_type = 11
@img_style = '1'
if par... | Ruby |
class LogController < ApplicationController
def log
end
end
| Ruby |
class ColController < ApplicationController
before_filter :set_cookies_or_url
after_filter :log_filter,:except => [:index]
layout "col"
include ColHelper
def index
redirect_to params.merge!(:action => 'show')
end
def show
params[:cn] = params[:cn].to_i + 1
@oper_type = 3
@img_style = ... | Ruby |
class AdController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
def new
@ad = Ad.new
@titles = "新增广告"
end
def create
@ad = Ad.new(params[:ad])
if @ad && @ad.save
flash[:notice] = '搞定一个!'
redirect_to :a... | Ruby |
class ChannelsController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
def new
@channel = Channel.new
@titles = "新增频道"
end
def create
@channel = Channel.new(params[:channel])
channel = Channel.find_all_by_order... | Ruby |
class LevelController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
def new
@level = Level.new
@titles = "新增级别"
end
def create
@level = Level.new(params[:level])
level = Level.find_all_by_host @level[:host]
if @leve... | 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
# before_filter :set_wap_content_type,:only => [:wap,:col,:user_cfg]
# before_filter :adjust_format_for_beta... | Ruby |
class GuideController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
def new
@guide = Guide.new
@titles = "新增导量"
end
def create
@guide = Guide.new(params[:guide])
if @guide && @guide.save
GuideExec.set_guide_ma... | Ruby |
class SectionsController < ApplicationController
#权限验证
before_filter :auth
layout "admin"
def index
redirect_to :action=>'list'
end
def list
#提交表单为post
if request.post?
@section = params[:section]
name = @section[:name]
channel_id = @section[:channel_id]
... | 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 File.dirname(__FILE__) + '/../config/boot'
require 'commands/dbconsole'
| 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/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/profiler'
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.