code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/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/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/breakpointer' | 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 |
require 'rubygems'
require 'youtube'
class Plugin::YoutubeController < ActionController::Base
uses_component_template_root
# before_filter :init_youtube
DEVELOPER_ID = "-aUPn8U5FrU"
USERNAME = 'iceskysl'
def youtube
youtube = YouTube::Client.new DEVELOPER_ID # Get one here: <http://youtub... | Ruby |
require 'flickr'
class Plugin::FlickrController < ActionController::Base
uses_component_template_root
EMAIL = 'iceskysl.1sters'
PASSWORD = '123456123'
def basics
# basics
flickr = Flickr.new # create a flickr client
flickr.login(EMAIL, PASSWORD) ... | Ruby |
class CreateConfigurations < ActiveRecord::Migration
def self.up
create_table :configurations do |t|
t.column :name, :string #名
t.column :title, :string #看到的名
t.column :description, :string #描述
t.column :value, :text #值
t.column :group, :string #值
end
#系统显示信息配置
... | Ruby |
class CreateThemes < ActiveRecord::Migration
def self.up
create_table :themes do |t|
t.string :name,:time,:author,:description,:homepage
t.string :preview,:pwd
t.string :useit, :default => '0' #
t.timestamps
end
Theme.load_theme_directory
end
def self.down
drop_table ... | Ruby |
class CreateLinks < ActiveRecord::Migration
def self.up
create_table :links do |t|
t.column :parent_id, :integer ,:default => 0 #小分类的父类 0代表是父类
t.column :title, :string
t.column :description, :string
t.column :weburl, :string, :default => "http://"
t.column :position ,:integer
t.column ... | Ruby |
class CreateStatistics < ActiveRecord::Migration
def self.up
create_table :statistics do |t|
t.string :name
t.string :value
t.timestamps
end
#初始化统计信息
%w{
viewed_count tags_count categories_count tags_count
links_count topics_count usergroups_count
users_count comme... | Ruby |
class CreateNatures < ActiveRecord::Migration
def self.up
create_table :natures do |t|
t.column :title, :string #性质 原创 转载 翻译
t.column :description, :string #描述
t.column :topics_count, :integer, :default => 0 #文章数
t.column :position, :integer ,:default => 0 #排列顺序
end
Nature.ne... | Ruby |
class CreateTrackBacks < ActiveRecord::Migration
def self.up
create_table :track_backs do |t|
t.column :topic_id, :integer #文章ID
t.column :title, :string ,:default => "TrackBack Titel"
t.column :excerpt, :string ,:default => "TrackBack Excerpt"
t.column :blog_name, :string ,:default => "Blog N... | Ruby |
class CreateAttachments < ActiveRecord::Migration
def self.up
create_table :attachments do |t|
t.column :topic_id,:integer #主题ID
t.column :filename, :string #文件名
t.column :filetype, :string #类型
t.column :filesize, :integer, :default => 0 #大小
t.column :filepath, :string, :default ... | Ruby |
class InitConfig < ActiveRecord::Migration
def self.up
Configuration.new(:group=>'Select',:name=>"editor_style",:title=>'编辑器风格', :description=>'选择你喜欢的编辑器,有四种风格',:value=>'default').save
Configuration.new(:group=>'Select',:name=>"editor_mode",:title=>'编辑器模式', :description=>'选择你喜欢的编辑器模式,简单模式还是完全模式',:value=>'简单模式').... | Ruby |
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.column :body,:text #内容
t.column :type_id,:integer #大分类ID
t.column :topic_id,:integer #主题ID
t.column :name,:string #回复者姓名
t.column :email,:string, :default => " @ " #回复者EAMIL
t.column... | Ruby |
class CreateTags < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.column :title, :string
t.column :description, :string
t.column :topics_count, :integer ,:default => 0
end
end
def self.down
drop_table :tags
end
end
| Ruby |
class AddTrackBacksCount < ActiveRecord::Migration
def self.up
add_column :topics, :track_backs_count, :integer , :default => 0 # 文章引用数
end
def self.down
remove_column :topics, :track_backs_count
end
end
| Ruby |
class AddNatureId < ActiveRecord::Migration
def self.up
add_column :topics, :nature_id, :integer , :default => 1 # 分类ID
end
def self.down
remove_column :topics, :nature_id
end
end
| Ruby |
class CreateTopics < ActiveRecord::Migration
def self.up
create_table :topics do |t|
t.column :title, :string #标题
t.column :body, :text #内容
t.column :created_at, :datetime #发表时间
t.column :updated_at, :datetime
t.column :type_id, :integer, :default => 0 #大类别 新闻 博客 文章
... | Ruby |
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.column :login_name, :string #登录名
t.column :nickname, :string#现实名
t.column :hashed_pass,:string #密码
t.column :email,:string #油箱
t.column :im,:string #IM
t.column :personality,:text ... | Ruby |
class CreateCategories < ActiveRecord::Migration
def self.up
create_table :categories do |t|
t.column :parent_id, :integer, :default => 0 #大类别 新闻 博客 文章
t.column :title, :string #小类分类名 新闻 博客 公告的二级分类
t.column :desc, :string #小分类分类描述
t.column :position, :integer ,:default => 0 #排列... | Ruby |
class CreateUserGroups < ActiveRecord::Migration
def self.up
create_table :user_groups do |t|
t.column :title, :string #人群分类名 管理员 设计师 用户等
t.column :description, :string #人群分类描述
t.column :users_count, :integer, :default => 0 #用户数,计数器缓存
end
UserGroup.new(:title=>'管理员', :descripti... | Ruby |
# We use this chunk of controller code all over to generate PDF files.
#
# To stay DRY we placed it here instead of repeating it all over the place.
#
module PdfHelper
require 'prince'
private
# Makes a pdf, returns it as data...
def make_pdf(template_path, pdf_name, landscape=false)
prince = Prince.... | Ruby |
#--
# Copyright (c) 2006 Shane Vitarana
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Ruby |
#!/usr/bin/ruby
# Backs up the databases of applications on Rails Machine.
# This script is intended to be called by cron on your Rails Machine.
#
# Andrew Stewart, AirBlade Software Ltd (boss at airbladesoftware dot com)
# Feedback gratefully received.
#
# Version 0.1
require 'rubygems'
require 'logger'
... | Ruby |
#!/usr/bin/ruby
# Backs up the databases of applications on Rails Machine.
# This script is intended to be called by cron on your Rails Machine.
#
# Andrew Stewart, AirBlade Software Ltd (boss at airbladesoftware dot com)
# Feedback gratefully received.
#
# Version 0.1
require 'rubygems'
require 'logger'
... | Ruby |
# = Flickr
# An insanely easy interface to the Flickr photo-sharing service. By Scott Raymond.
#
# Author:: Scott Raymond <sco@redgreenblu.com>
# Copyright:: Copyright (c) 2005 Scott Raymond <sco@redgreenblu.com>
# License:: MIT <http://www.opensource.org/licenses/mit-license.php>
#
# USAGE:
# require 'flick... | Ruby |
module ActionView
module Helpers
module TextHelper
ALLOWED_TAGS = %w(a img) unless defined?(ALLOWED_TAGS)
def whitelist(html)
#only do this if absolutely necessary
if html.index("<")
tokenizer = HTML::Tokenizer.new(html)
new_te... | Ruby |
# Prince XML Ruby interface.
# http://www.princexml.com
#
# Library by Subimage Interactive - http://www.subimage.com
#
#
# USAGE
# -----------------------------------------------------------------------------
# prince = Prince.new()
# html_string = render_to_string(:template => 'some_document')
# send_data(
# ... | Ruby |
# = XmlSimple
#
# Author:: Maik Schmidt <contact@maik-schmidt.de>
# Copyright:: Copyright (c) 2003-2006 Maik Schmidt
# License:: Distributes under the same terms as Ruby.
#
require 'rexml/document'
require 'stringio'
# Easy API to maintain XML (especially configuration files).
class XmlSimple
include REXML
@... | Ruby |
#!/usr/bin/env 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 impaire... | Ruby |
#!D:/soft/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 imp... | Ruby |
#!/usr/bin/env 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 im... | Ruby |
#!/usr/bin/env 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 |
#!/usr/bin/env 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 impaire... | Ruby |
#!/usr/bin/env 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 im... | Ruby |
#!/usr/bin/env 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 |
#!D:/soft/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 imp... | Ruby |
#!D:/soft/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.... | 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 |
#!D:/soft/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.... | 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 |
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "NAME"
spec.version = '1.0'
spec.authors = ["Your Name Here"]
spec.email = ["youremail@yourdomain.com"]
spec.summary ... | Ruby |
require "./lib/firstapp.rb"
require "test/unit"
class TestName < Test::Unit::TestCase
def test_sample
assert_equal(4, 2+2)
end
end
| Ruby |
require "date"
namespace :appcache do
desc "update the date in the appcache file (in the gh-pages branch)"
task :update do
appcache = File.read("cache.appcache")
updated = "# Updated: #{DateTime.now}"
File.write("cache.appcache", appcache.sub(/^# Updated:.*$/, updated))
end
end
| Ruby |
require "date"
namespace :appcache do
desc "update the date in the appcache file (in the gh-pages branch)"
task :update do
appcache = File.read("cache.appcache")
updated = "# Updated: #{DateTime.now}"
File.write("cache.appcache", appcache.sub(/^# Updated:.*$/, updated))
end
end
| Ruby |
require 'sinatra'
require 'sqlite3'
require 'sinatra/activerecord'
require './models/produto'
require './models/cliente'
require './models/venda'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => './loja.db')
enable :sessions
get '/' do
@produtos = Produto.all
erb :index
end
... | Ruby |
class Admin < ActiveRecord::Base
end | Ruby |
class Cliente < ActiveRecord::Base
has_many :vendas
end | Ruby |
class Produto < ActiveRecord::Base
end | Ruby |
class Venda < ActiveRecord::Base
belongs_to :cliente
end | Ruby |
class Sistema > ??
empresa = Empresa.getEmpresa()
def gerar_boleto(cliente, carrinho,empresa)
return new Boleto(empresa, carrinho.valor, carrinho.data, carrinho.cliente.nome)
end
def finalizar_venta(carrinho, boleto)
venda = new Venda(carrinho, boleto)
carrinho.reservar_estoque ??
end
end
class Carrinho >... | Ruby |
require 'mkmf'
$CPPFLAGS = $CPPFLAGS + " -I../../include"
$LDFLAGS = $LDFLAGS + " -L../../"
$LIBS = $LIBS + " -lhpdf -lpng -lz"
create_makefile 'hpdf'
| Ruby |
#
# << Haru Free PDF Library 2.0.0 >> -- demo.rb
#
# Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appea... | Ruby |
#
# << Haru Free PDF Library 2.0.0 >> -- encryption.rb
#
# Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice... | Ruby |
#
# << Haru Free PDF Library 2.0.0 >> -- font_example.rb
#
# Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright noti... | Ruby |
#
# << Haru Free PDF Library 2.0.2 >> -- arc_demo.rb
#
# http://libharu.org/
#
# Copyright (c) 1999-2006 Takeshi Kanno
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear ... | Ruby |
#
# << Haru Free PDF Library 2.0.6 >> -- ext_gstate_demo.rb
#
# http://libharu.org/
#
# Copyright (c) 1999-2006 Takeshi Kanno
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice ... | Ruby |
#
# << Haru Free PDF Library 2.0.2 >> -- ttfont_demo.rb
#
# http://libharu.org/
#
# Copyright (c) 1999-2006 Takeshi Kanno
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appe... | Ruby |
#
# << Haru Free PDF Library 2.0.0 >> -- text_demo2.rb
#
# Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice... | Ruby |
#
# << Haru Free PDF Library 2.0.2 >> -- line_demo.rb
#
# http://libharu.org/
#
# Copyright (c) 1999-2006 Takeshi Kanno
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear... | Ruby |
#
# << Haru Free PDF Library 2.0.6 >> -- slideshow_demo.rb
#
# http://libharu.org/
#
# Copyright (c) 1999-2006 Takeshi Kanno
#
# Permission to use, copy, modify, distribute and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice 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 |
# 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.
Blog::Application.config.session_store :cookie_store, :key => '_blog_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 gene... | 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 |
set :application, "set your application name here"
set :repository, "set your repository location here"
set :scm, :subversion
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
role :web, "your web-server here" # Your HTTP server, Apache/etc
role :... | Ruby |
Blog::Application.configure do
# Settings specified here will take precedence over those in config/application.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
... | Ruby |
Blog::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 webserve... | Ruby |
Blog::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 sui... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Blog::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 you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Blog
class Application < Rails::Application
# Se... | Ruby |
Blog::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products... | Ruby |
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
bash: q: command not found
load 'config/deploy' # remove this line to skip loading ... | Ruby |
module ApplicationHelper
end
| Ruby |
class ApplicationController < ActionController::Base
protect_from_forgery
end
| 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.expand_path('../config/application', __FILE__)
require 'rake'
Blog::Application.load_tasks
| Ruby |
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
| Ruby |
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'activesupport'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-de... | Ruby |
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.