code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
system("rsync Chipmunk-#{VERS}.tgz slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-5.x/")
system("rsync -r --exclude='doc-src' #{DIR}/doc/ slembcke.net:files.sl... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
# Build Objective-Chipmunk
system("cd ../Objective-Chipmunk; ruby BuildReleaseArchive.rb #{VERS}")
# Export, clean, and prepare
system("rm -rf #{DIR}")
system("svn expor... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
# Chipmunk Game Dynamics. Provides fast, easy to use, robust physics.
module CP
# The bias coefficient used for resolving penetrations. Setting 0.0 effectively disables
# penetration resolution. Setting 1.0 will try to resolve the penetration in a single step.
# (not recommended)
attr_accessor :bias_coef
... | Ruby |
require 'rubygems'
require_gem 'RedCloth'
cdocs = 'chipmunk-docs'
rc_cdocs = RedCloth.new(File.read(cdocs + '.textile'))
html_cdocs = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="e... | Ruby |
require 'mkmf'
system 'cp ../src/* ./'
$CFLAGS += ' -std=gnu99 -ffast-math'
create_makefile('chipmunk') | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
# Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
system("rsync Chipmunk-#{VERS}.tgz slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-5.x/")
system("rsync -r --exclude='doc-src' #{DIR}/doc/ slembcke.net:files.s... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
# Build Objective-Chipmunk
system("cd ../Objective-Chipmunk; ruby BuildReleaseArchive.rb #{VERS}")
# Export, clean, and prepare
system("rm -rf #{DIR}")
system("svn expor... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
system("rsync Chipmunk-#{VERS}.tgz slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-5.x/")
system("rsync -r --exclude='doc-src' #{DIR}/doc/ slembcke.net:files.sl... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
# Build Objective-Chipmunk
system("cd ../Objective-Chipmunk; ruby BuildReleaseArchive.rb #{VERS}")
# Export, clean, and prepare
system("rm -rf #{DIR}")
system("svn expor... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
system("rsync Chipmunk-#{VERS}.tgz slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-5.x/")
system("rsync -r --exclude='doc-src' #{DIR}/doc/ slembcke.net:files.sl... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
# Build Objective-Chipmunk
system("cd ../Objective-Chipmunk; ruby BuildReleaseArchive.rb #{VERS}")
# Export, clean, and prepare
system("rm -rf #{DIR}")
system("svn expor... | Ruby |
require 'rubygems'
require 'redcloth'
html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<t... | Ruby |
module CP
# Chipmunk Object
# Makes it easier to manage complex objects that reference many primitive Chipmunk objects such as bodies shapes and constraints.
# New composite objects simply need to include CP::Object and call #init_chipmunk_object(*objects) with the
# composite and primitive Chipmunk objects that ma... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
system("rsync Chipmunk-#{VERS}.tgz slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-6.x/")
system("rsync -r --exclude='doc-src' #{DIR}/doc/ slembcke.net:files.sl... | Ruby |
VERS = ARGV[0]
raise("No version number!") unless VERS
def system(command)
puts command
Kernel.system(command)
end
DIR = "/tmp/Chipmunk-#{VERS}"
# Build Objective-Chipmunk
system("cd ../Objective-Chipmunk; ruby BuildReleaseArchive.rb #{VERS}")
# Export, clean, and prepare
system("rm -rf #{DIR}")
system("svn expor... | Ruby |
FORMAT = ARGV[0]
# match 0 is the whole function proto
# match 1 is the return value
# match 2 returns pointer?
# match 3 is the function name
# match 4 is the remainder
REGEX = /.*?((\w+(\s+\*)?)\s*(cp\w*)\(.*?\))(.*)/
STDIN.readlines.each do|str|
while match = REGEX.match(str)
captures = match.captures
proto, ... | Ruby |
require 'rubygems'
require 'redcloth'
require 'erb'
require 'uri/common'
class Node
attr_reader :anchor
attr_reader :children
def initialize(title, anchor, parent)
@title = title
@anchor = (parent.anchor ? "#{parent.anchor}-#{anchor}" : anchor)
@children = []
parent.children << self
end
def outlin... | Ruby |
DOC_FILE = open("generated_docs", "w")
def output(str='')
DOC_FILE.puts str
end
def find_declarations(name)
IO.readlines("|find include -name \"*.h\" | xargs grep -h \"^#{name}.*;\\s*$\"")
end
def output_getter(struct_base, struct, type, name)
output "/// @fn static inline #{type} #{struct}Get#{name}(const #{stru... | Ruby |
# DSL for wmiirc configuration.
#--
# Copyright protects this work.
# See LICENSE file for details.
#++
require 'shellwords'
require 'pathname'
require 'yaml'
require 'rubygems'
gem 'rumai', '~> 3'
require 'rumai'
include Rumai
class Handler < Hash
def initialize
super {|h,k| h[k] = [] }
end
##
# If a ... | Ruby |
#!/usr/bin/env ruby
#
# Bootloader for wmii configuration.
#
#--
# Copyright protects this work.
# See LICENSE file for details.
#++
# create a logger to aid debugging
require 'logger'
LOG = Logger.new(__FILE__ + '.log', 5)
class << LOG
# emulate IO.write
alias write <<
def flush
# ignore
end
end
# capt... | Ruby |
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "theme/css"
sass_dir = "theme/scss"
images_dir = "images"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :co... | Ruby |
# encoding: utf-8
require 'rubygems'
require 'find'
require 'fileutils'
require 'gmail'
$buildresultfile = "buildresult.txt"
a = `svn log -r PREV:HEAD > lastchanges.txt`
#File.open("lastchanges.txt", "w") {|f| f.puts a}
system("android update project --target 7 --path ./ ")
system("cp ./lib/*jar ./libs")
system("... | 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|
require "omniauth-facebook"
config.omniauth :facebook, "137336349740898", "b0b5757dbf97ca89edf3e28d4587b516"
# ==> Mailer Configuration
# Conf... | 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.
Chococam::Application.config.session_store :cookie_store, key: '_chococam_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 |
Chococam::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# 2012-10-03 brucewang
# ActionMailer 관련
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "smtp.gmail.com",
authentication: "plain",
enable... | Ruby |
Chococam::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
# Devise 관련 설정.
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# 2012-10-03 brucewang
# ActionMailer 관련
config.action_mailer.smtp_settings = {... | Ruby |
Chococam::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
Chococam::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 |
Chococam::Application.routes.draw do
# 2012-08-30 brucewang
# 기본적으로welcome 페이지가 나오도록 한다.
# welcome 페이지에는 사용자가 로그인 상태인가 아닌가에 따라
# 로그인 페이지로 연결하는 링크가 나오거나, logout 링크가 나오게 된다.
root :to => 'welcome#index'
#get "welcome/index"
# 2012-08-30 brucewang
# omniAuth 에 의한 callback, 에를들어 Facebook인증후 Facebook이 callba... | Ruby |
module ApplicationHelper
end
| Ruby |
module WelcomeHelper
end
| Ruby |
#
# 2012-09-05 brucewang
# Created Class
#
# User 모델에 통합하려고 하였으나, amico 모델 처럼 따로 Followship을 분리해 두는것이
# 더 나을것으로 판단하였음.
# https://github.com/agoragames/amico
#
#
# Follow
#
#=================================================================
# Test Flow
#===========================================... | Ruby |
# 2012-09-03 brucewang
# Created Class
#
# Like count 등을 매번 MongoDb를 조회해서 반환해선 performance에 큰 영향을 주므로
# 클라이언트에 보내주는 기본 feed 정보에는 count정보를 포함시키지 말고
# count 정보가 필요할 때 명시적으로 클라이언트가 요청을 보낼 때에만 조회를 하도록 한다.
#
# 아니면, 추후에 count 필드를 아예 저장해 두는것도 한 방법이겠으나
# 상황 발생시 매번 DB 필드 정보를 새로 저장해야 하는 단점도 있다.
class Action
include Mongoid::Doc... | Ruby |
#Mongoid::Fields.option :null do |model, field, value|
# Your logic here...
#end
#Mongoid::Fields.option :limit do |model, field, value|
# # Your logic here...
#end
class User #< ActiveRecord::Base
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Paperclip
# Include default devise mod... | Ruby |
#
# 2012-09-04 brucewang
# Created Class
#
# 코멘트
#
class Comment
include Mongoid::Document
include Mongoid::Timestamps
# comment 를 게제한 사용자의 id
field :user_id, type: String
# 설명
field :description, type: String
belongs_to :post, index: true #, class_name: "Post"
belongs_to :reply_to, index: true, c... | Ruby |
# 2012-08-31 brucewang
# Created Class
#
# ActionFeed는 어떤 특정 Action 이 발생했음을 특정 구독자에게 알려주기 위해
# 만들어지는 레코드 이다.
#
# 이러한 ActionFeed는 Action을 수행한 사용자 (Actor)가 지정한 공개 대상에 따라
# 소식을 받을 수 있는 사용자도 있고 받을 수 없는 사용자도 있다. 어떤 사용자가
# ActionFeed들을 조회할 때,각 ActionFeed의 actor 친구들 정보를 일일이 확인해서
# Feed를 수신하는것 보다는, 미리 Feed를 받게될 사람들을 대상으로 Feed... | Ruby |
#
# 2012-09-03 brucewang
# Created Class
#
# 동영상
#
class Movie
include Mongoid::Document
include Mongoid::Timestamps
#embedded_in :post #, index: true #, class_name: "Post"
belongs_to :post, index: true
# CarrierWave를 사용한 파일 업로드 사용.
# https://github.com/jnicklas/carrierwave-mongoid
#attr_accessible :file... | Ruby |
#
# 2012-09-04 brucewang
# Created Class
#
# Like
#
class Like
include Mongoid::Document
include Mongoid::Timestamps
# comment 를 게제한 사용자의 id
field :user_id, type: String
belongs_to :post, index: true #, class_name: "Post"
belongs_to :comment, index: true #, class_name: "Post"
# 2012-10-08 brucewang
... | Ruby |
#
# 2012-09-03 brucewang
# Created Class
#
# ActionTarget 클래스로부터 파생.
#
class Post < ActionTarget
# ActionTarget 클래스에 이미 존재하는 필드들이므로 필요 없음.
# include Mongoid::Document
# include Mongoid::Timestamps
# Post를 게제한 사용자의 id
field :user_id, type: String
# 설명
field :description, type: String
# ref 된 사용자... | Ruby |
#
# 2012-08-31 brucewang
# Created Class
#
# Post, Comment, Like 등 Feed로서 등록될 수 있는 것들의 최상위 클래스이다.
# 이러한 자식클래스들은 모두 동일한 MongoDb collection에 저장되지만
# 자식클래스에서 where로 검색을 하면 자신의 클래스에 매치되는 것들만 따로 조회가 된다.
# 자세한 내용은 아래 링크 참고.
# 'http://mongoid.org/en/mongoid/docs/documents.html#inheritance'
#
class ActionTarget
include Mongoi... | Ruby |
class MoviesController < ApplicationController\
skip_before_filter :verify_authenticity_token
def new
@movie = Movie.new()
@movie.post = Post.new()
end
# CURL 로는 다음과 같이 테스트
# curl -F "movie[file]=@./image001.gif" -F "movie[name]=api" "http://localhost:3000/movies"
def create
@movie = M... | Ruby |
class WelcomeController < ApplicationController
def index
end
end
| Ruby |
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
@user = User.find_or_create_from_auth_hash(request.env["omniauth.auth"])
sign_in_and_redirect @user
end
# # 2012-08-30 brucewang
# # Mobile Web browser일 경우에 대한 처리.
# if mobile?
# @u... | Ruby |
class Api::V1::TokensController < ApplicationController
skip_before_filter :verify_authenticity_token
respond_to :json
def create
email = params[:email]
password = params[:password]
# 2012-08-31 brucewang
# Support Facebook login
facebook_id = params[:facebook_id]
... | Ruby |
class Api::V1::PostsController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :authenticate_user! #, :except=>[:create]
# 2012-09-13 brucewang
# 모든 post들을 반환.
# GET http://localhost:3000/api/v1/posts.json?auth_token=vWLsJF4au1StrEC7nPpf&page=0
# 파라미터로 get_co... | Ruby |
class Api::V1::ActionFeedsController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :authenticate_user!
# 2012-09-13 brucewang
# 현재 사용자를 위해 생성된 모든 feed 들을 반환.
# GET http://localhost:3000/api/v1/action_feeds.json?auth_token=vWLsJF4au1StrEC7nPpf&page=0
# 파라미터로 ... | Ruby |
class Api::V1::UsersController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:create]
before_filter :authenticate_user!, :except=>[:create]
respond_to :json
# 2012-09-06 brucewang
# 새로운 유저 생성
#
#
# 예를 들어 다음과 같이 호출하면 됨.
# POST로 http://localhost:3000/api/v1/users.js... | Ruby |
class ApplicationController < ActionController::Base
protect_from_forgery
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__)
Chococam::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 |
#!/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
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
| Ruby |
#!/usr/bin/env ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'pathname'
class Rails
def self.root
@@root ||= Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), ... | Ruby |
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
| Ruby |
#!/usr/bin/env ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'pathname'
class Rails
def self.root
@@root ||= Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), ... | 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
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'fileutils'
require 'yaml'
require 'active_model'
require 'active_model/serializers/xml'
if ARGV.length == 0
$stderr.... | Ruby |
#!/usr/bin/env ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'yaml'
require 'fileutils'
require 'active_model'
require 'active_model/serializers/xml'
if ARGV.length == 0
$stder... | Ruby |
#!/usr/bin/env ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'fileutils'
require 'yaml'
require 'active_model'
require 'active_model/serializers/xml'
if ARGV.length == 0
$stderr.... | Ruby |
#!/usr/bin/env ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'rubygems'
require 'yaml'
require 'fileutils'
require 'active_model'
require 'active_model/serializers/xml'
if ARGV.length == 0
$stder... | 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 |
#!/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__)
Chococam::Application.load_tasks
| Ruby |
source 'https://rubygems.org'
gem 'rails', '3.2.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'execjs'
gem 'therubyracer'
gem "omniauth-facebook"
gem "devise", ">= 2.1.2"
gem "mongoid", "~> 3.0.0"
# 테스팅과 관련한 rspec, 그리고 mongoid를위한 rspec
gem 'rspec-rails'... | Ruby |
module Helpers
def help
:available
end
def create_user_1_2_3
@user1 =User.create!(:fb_user_id => "1", :name => "user1", :email => "a1@test.com", :password=>"aaaaa1")
@user2 =User.create!(:fb_user_id => "2", :name => "user2", :email => "a2@test.com", :password=>"aaaaa2")
@user3 =User.create!(... | Ruby |
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/... | Ruby |
RSpec.configure do |config|
config.include Devise::TestHelpers, :type => :controller
end
| Ruby |
#
# 2012-09-12 brucwang
# 기본적으로는 githup의 paperclip-ffmpeg의 소스를 가져다 쓴 것이지만
# 몇가지 패치가 되어 있음. (https://github.com/owahab/paperclip-ffmpeg)
#
# 별도의 Custom processor를 작성하고자 할때는 다음의 정보들을 활용하기 바람.
# http://matthewhutchinson.net/2010/10/25/editing-file-uploads-with-a-paperclip-processor
# http://thewebfellas.com/blog/2009/2/22... | Ruby |
# 2012-09-11 brucewang
# Job 코드가 바뀌면 Delayed_job 을 restart시켜야 한다.
# > script/server restart
class MovieFileJob < Struct.new(#:movie_id, :bitrate => 22050, :thumb_second => 0, :thumb_width => 130)
:movie_id, :bitrate, :thumb_second, :thumb_width)
def perform
movie = Movie.find(movie_id... | Ruby |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Chococam::Application
| Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', '..', '..', 'resources', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
# Require any additional compass ... | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', '..', '..', 'resources', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
# Require any additional compass ... | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', '..', '..', 'resources', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
# Require any additional compass ... | Ruby |
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', '..', '..', 'resources', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
# Require any additional compass ... | 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 |
# 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 |
# 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 "English"
require "tempfile"
require "svn/error"
require "svn/util"
require "svn/core"
require "svn/repos"
require "svn/ext/ra"
module Svn
module Ra
Util.set_constants(Ext::Ra, self)
Util.set_methods(Ext::Ra, self)
@@ra_pool = Svn::Core::Pool.new
Ra.initialize(@@ra_pool)
... | Ruby |
require "English"
require "time"
require "digest/sha2"
require "tempfile"
require "nkf"
begin
require "uconv"
rescue LoadError
module Uconv
class Error < StandardError
end
def self.u8toeuc(str)
raise Error
end
end
end
require "svn/core"
require "svn/repos"
require "svn/... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.