code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
# file:: $Name$
# author:: $Author$
# version:: $Revision$
# date:: $Date$
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
module IsDescribable
def describe
se... | Ruby |
# file:: item.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'models/entity'
require 'models/con... | Ruby |
# file:: region.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'models/entity'
require 'models/c... | Ruby |
# file:: game.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'models/entity'
class Game < Enti... | Ruby |
# file:: user_connection.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'observer'
require 'netw... | Ruby |
# file:: telnet_commands.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
module TelnetCommands
RESET ... | Ruby |
# file:: net_connection.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
# Base Class for all network conne... | Ruby |
# file:: server.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'network/listener'
class MUDServe... | Ruby |
# file:: listener.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'observer'
require 'socket'
re... | Ruby |
# file:: player_connection.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'util/simple_stack'
re... | Ruby |
# file:: handler.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'util/connection_utils'
require ... | Ruby |
# file:: manager.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'network/player_connection'
requ... | Ruby |
# file:: telnet_reporter.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'engine/logic'
require '... | Ruby |
# file:: test.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'engine/logic'
require 'models/char... | Ruby |
# file:: connection_utils.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
require 'network/telnet_commands... | Ruby |
# file:: $Name$
# author:: $Author$
# version:: $Revision$
# date:: $Date$
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
# Just a clever util class to allow m... | Ruby |
# file:: interaction_utils.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2005 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
module PlayerInteractionUt... | Ruby |
# file:: simple_stack.rb
# author:: Ralph M. Churchill
# version::
# date::
#
# This source code copyright (C) 2006 by Ralph M. Churchill
# All rights reserved.
#
# Released under the terms of the GNU General Public License
# See LICENSE file for additional information.
class SimpleStack
include Enume... | Ruby |
require 'test/unit'
require 'database/game_database'
require 'models/entity'
require 'models/container'
class Room < Entity
include HasManyCharacters
end
class Portal < Entity
include BelongsToRoom
end
class Character < Entity
uses_templates_from CharacterDatabase
end
class TCTemplate < Ent... | Ruby |
require 'test/unit'
require 'mock_connection'
require 'network/handler'
class LogonHandler
def state
@state
end
end
class HandlerTest < Test::Unit::TestCase
def setup
# create a connection and start it
@conn = MockConnection.new
@conn.switch_handler(LogonHandl... | Ruby |
require 'test/unit'
require 'engine/game_engine'
require 'engine/logic'
# to make test indempotent# {{{
class VectorDatabase
def reset; @container = [] end
end
class MapDatabase
def reset; @container = {} end
end
class TemplateInstanceDatabase
def reset
@instances.reset
@templ... | Ruby |
require 'test/unit'
require 'engine/action'
require 'models/character'
require 'models/item'
class CharacterDatabase
def add(c)
@instances.add(c)
end
end
class SubAction < Action
end
class ActionTest < Test::Unit::TestCase
def setup
@char = Character.new
@char.oid =... | Ruby |
require 'test/unit'
require 'models/item'
require 'database/game_database'
class EntityTemplateTest < Test::Unit::TestCase
def setup
tmpl = ItemTemplate.new
tmpl.name = "Item"
ItemDatabase.instance.use_templates([tmpl],false)
end
def test_item
tmpl = ItemDatabas... | Ruby |
require 'test/unit'
require 'models/game'
require 'models/region'
require 'engine/game_setup'
class TCMud
include GameDatabaseSetup
end
class GameTest < Test::Unit::TestCase
require 'fileutils'
def setup
@root_dir = ['test','game'].join(File::SEPARATOR)
template_dir = [@root... | Ruby |
require 'test/unit'
require 'engine/command'
require 'models/character'
require 'models/room'
require 'models/item'
require 'command/builder'
class Command
def inform(msg)
puts msg
end
end
class BuilderTest < Test::Unit::TestCase
def setup
@char = Character.new
@cha... | Ruby |
require 'test/unit'
require 'models/character'
require 'engine/action'
require 'engine/logic'
class CharacterDatabase
def add(c)
@instances.add(c)
end
end
class TCLogic < Logic
applicable_to Character
invoked_by
def do_logic(action)
if action.type == :true
... | Ruby |
require 'test/unit'
require 'models/room'
require 'models/portal'
class PortalTest < Test::Unit::TestCase
def setup
if @door.nil? or @door.oid.nil? then
@door = Portal.new
@door.name = 'Door'
@door = PortalDatabase.instance.add(@door)
end
if ... | Ruby |
require 'test/unit'
require 'models/region'
require 'models/account'
require 'models/container'
require 'database/game_database'
require 'engine/game_setup'
class TCGame
include GameDatabaseSetup
end
class TCChar < Entity
include BelongsToAccount
uses_templates_from CharacterDatabase
def... | Ruby |
require 'network/player_connection'
require 'observer'
class MockConnection < PlayerConnection
def initialize(echo=false)
@echo = echo
class << $stdin# {{{
include Observable
def subscribe(s)
@s = s
end
def update(s)
... | Ruby |
require 'test/unit'
require 'models/account'
class AccountTest < Test::Unit::TestCase
def test_acceptable_name
assert_raise(RuntimeError){Account.acceptable_name?("")}
assert_raise(RuntimeError){Account.acceptable_name?(" ")}
assert_raise(RuntimeError){Account.acceptable_name?("... | Ruby |
require 'test/unit'
require 'database/game_database'
require 'models/entity'
class TCRoom < Entity
end
class GameDatabaseTest < Test::Unit::TestCase
def setup
end
def test_room_database
room = TCRoom.new
room.name = "A Room"
room = RoomDatabase.instance.add(room)
... | Ruby |
require 'test/unit'
require 'observer'
require 'network/player_connection'
require 'network/handler'
class TCSocket
include Observable
def subscribe(o)
add_observer(o)
end
def update(data)
puts data
$global = :socketio
end
def rcv(data='')
change... | Ruby |
require 'test/unit'
require 'models/entity'
class SomeProperty
attr_accessor :what,:when
end
class ComplexEntity < Entity
properties :some
end
module MixinModule
properties :mixin_property
end
class MixinEntity < Entity
include MixinModule
properties :entity_property
end
class Ent... | Ruby |
require 'test/unit'
require 'models/character'
require 'models/account'
class CharacterTest < Test::Unit::TestCase
def setup
end
def test_player_or_npc
c = Character.new
c.oid = 1
assert(! c.player?)
a = Account.new
a.oid = 1
AccountDatabas... | Ruby |
require 'test/unit'
require 'engine/command'
require 'models/entity'
class TCCommand < Command
def initialize(executor)
super(executor,"command","command <string>",
"prints the <string> passed to the command")
end
def execute(params)
raise UsageException if params.... | Ruby |
require 'test/unit'
require 'engine/command'
require 'models/character'
class CharacterDatabase
def add(c)
@instances.add(c)
end
end
class TCCommand < Command
def initialize(executor)
super(executor,"command","command <string>",
"prints the <string> passed to the... | Ruby |
require 'test/unit'
require 'tc_account'
require 'tc_action'
require 'tc_character'
require 'tc_command'
require 'tc_container'
require 'tc_database'
require 'tc_entity'
require 'tc_entity_templates'
require 'tc_logic'
require 'tc_logic_entity'
require 'tc_portals'
require 'tc_region'
| Ruby |
require 'test/unit'
require 'models/region'
class RegionTest < Test::Unit::TestCase
def test_region
r = Region.new
assert(r.characters.empty?)
assert(r.items.empty?)
assert(r.rooms.empty?)
assert(r.portals.empty?)
r.name = "A Region"
assert_equal... | Ruby |
require 'test/unit'
require 'database/database'
require 'models/entity'
class DatabaseTest < Test::Unit::TestCase
def setup
@one = Entity.new; @one.name="one"
@two = Entity.new; @two.name="Two"
@three = Entity.new; @three.name="th r ee"
@v_names = VectorDatabase.new
... | Ruby |
require 'test/unit'
require 'engine/logic'
require 'models/character'
class NilLogic < Logic
end
class EmptyLogic < Logic
invoked_by
needs_data
optionally
end
class TestLogic < Logic
invoked_by :a,:b,:c
needs_data :x,:y,:z
optionally :xx,:yy
saveable
stackable :repla... | Ruby |
require 'redcarpet'
module Jekyll
class UserGuideFor < Liquid::For
def render(context)
sort_by = @attributes['sort_by']
category = @attributes['category']
sorted_collection = context[@collection_name].dup
sorted_collection = sorted_collection.sort_by { |i| (i && i.to_liquid[@att... | Ruby |
require 'redcarpet'
module Jekyll
class UserGuideFor < Liquid::For
def render(context)
sort_by = @attributes['sort_by']
category = @attributes['category']
sorted_collection = context[@collection_name].dup
sorted_collection = sorted_collection.sort_by { |i| (i && i.to_liquid[@att... | 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.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 >> -- 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.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.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 >> -- 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 |
#
# << 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.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 >> -- 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 |
ciew = lambda do |env|
if env['REQUEST_URI'] == '/style.css'
require 'redcloth'
require 'sass'
css = Sass::Engine.new(File.read('style.sass')).render
return [200, {'Content-Type' => 'text/css'}, [css]]
else
require 'cgi'
require 'fileutils'
require 'rubygems'
require 'haml'
requi... | Ruby |
require 'fileutils'
class Wiki
def initialize(article_root, archive_root)
@Article_root = article_root
@Archive_root = archive_root
end
# copy the article into the archive, and put a timestamp on it
def archive(article)
path = path(article)
if File.exist?(path)
if File.directory?(path)
... | 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.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 >> -- 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.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.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 >> -- 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 |
#
# << 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.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 >> -- 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 |
# 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 |
# 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 |
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "ec2-23-21-28-8.compute-1.amazonaws.com",
:user_name => "service.projectbox",
:password => "cics530project",
:authentication => "pla... | Ruby |
Rabl.configure do |config|
config.include_json_root = false
end
| Ruby |
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "Project Box"
# Set the link url for the title. For example, to take
# users to your main site. Defaults to no link.
#
# config.site_titl... | Ruby |
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
# complete input. You can remove any component from the
# wrapper, change the order or even add your own to the
# stack. The options given below are used to... | 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 |
Time::DATE_FORMATS[:slash_time] = "%D %H:%M"
Time::DATE_FORMATS[:slash_date] = "%D"
Time::DATE_FORMATS[:wordy_time] = "%B %e, %Y %I:%M%P"
Time::DATE_FORMATS[:wordy_date] = "%B %e, %Y"
Time::DATE_FORMATS[:blog_time] = "%I:%M%P on %B %e, %Y"
Time::DATE_FORMATS[:service_timestamp] = "%Y-%m-%d %H:%M:%SZ"
| 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.
CmsRails::Application.config.session_store :cookie_store, key: '_cms_rails_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 "rail... | 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 |
root = "/home/ubuntu/apps/project_box/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.blog.sock"
worker_processes 2
timeout 30 | Ruby |
require "bundler/capistrano"
server "ec2-23-21-28-8.compute-1.amazonaws.com", :web, :app, :db, primary: true
set :application, "project_box"
set :user, "ubuntu"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, :git
set :repository, "git@github.com:matt... | Ruby |
CmsRails::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 = false
config.actio... | Ruby |
CmsRails::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 ... | Ruby |
CmsRails::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... | Ruby |
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
CmsRails::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 |
CmsRails::Application.routes.draw do
ActiveAdmin.routes(self)
devise_for :admin_users, ActiveAdmin::Devise.config
resources :staffs
resources :projects do
resources :resources, :shallow => true
resources :announcements, :shallow => true
resources :invitations
resources :contributions, :only =... | Ruby |
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks | Ruby |
collection @users
extends "users/show"
| Ruby |
object@user
attributes :id,:name
child :projects=> :managed_projects do
attributes :id, :name, :description
node(:url) { |project| project_url(project) }
end
child :contributions => :contrib_projects do
attributes :id, :name, :description
node(:url) { |project| project_url(project) }
end
| Ruby |
collection @announcement
extends "announcements/show"
| Ruby |
object@announcement
attributes :id,:user_id, :project_id, :topic, :content, :created_at
child :user do
attributes :id, :name, :email
node(:url) { |user| user_url(user) }
end
child :project do
attributes :name, :description, :started_at, :ended_at
node(:url) { |resource| resource_url(resource) }
end
| Ruby |
collection @projects
extends "projects/show"
| Ruby |
object@project
attributes :id,:name
child :users do
attributes :id, :name, :email
node(:url) { |user| user_url(user) }
end
child :resources do
attributes :name, :description, :created_at, :version
node(:url) { |resource| resource_url(resource) }
end
child :contributions do
attributes :id
end
| Ruby |
collection @resources
extends "resources/show"
| Ruby |
object@resource
attributes :id,:name, :description, :version, :created_at
child :user do
attributes :id, :name, :email
node(:url) { |user| user_url(user) }
end
child :project do
attributes :name, :description, :started_at, :ended_at
node(:url) { |resource| resource_url(resource) }
end
| Ruby |
module ApplicationHelper
def title title
content_for :head do
title
end
end
end
| Ruby |
module StaffsHelper
end
| Ruby |
module UsersHelper
end
| Ruby |
module PasswordResetsHelper
end
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.