code
stringlengths
1
1.73M
language
stringclasses
1 value
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class Deceitful < FeatModel def initialize super @title = "Deceitful" @bonus_classes = [] @description = "+2 Bonus on Disguise and Forgery checks" @page = "PHB93" @link = "...
Ruby
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class SelfSufficient < FeatModel def initialize super @title = "Self-Sufficient" @bonus_classes = [] @description = "+2 Bonus on Heal and Survival checks" @page = "PHB100" ...
Ruby
class CombatExpertise < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Combat Expertise" @description = "When you use the attack action or the full attack action in melee, you can take a penalty of as much as -5 on your attack roll and add the same number (+5 or less) as ...
Ruby
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class NimbleFingers < FeatModel def initialize super @title = "Nimble Fingers" @bonus_classes = [] @description = "+2 Bonus on Disable Device and Open Lock checks" @page = "PH...
Ruby
class EschewMaterials < FeatModel @bonus_classes = [] def initialize super @title = "Eschew Materials" @description = "You can cast any spell that has a material component costing 1 gp or less without needing that component. (The casting of the spell still provokes attacks of opportunity as normal.) If ...
Ruby
class QuickDraw < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Quick Draw" @description = "You swiftly draw a weapon" @page = "PHB??" @link = "" end def self.available?(char) return !feat_taken(char) && char.BAB >= 1 end def self.is_bonus_feat?(class_ty...
Ruby
class Dodge < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Dodge" @description = "During your action, you designate an opponent and receive a +1 dodge bonus to Armor Class against attacks from that opponent. You can select a new opponent on any action. A condition that ma...
Ruby
class GreatFortitude < FeatModel @bonus_classes = [] def initialize super @title = "Great Fortitude" @description = "You get a +2 bonus on all Fortitude saving throws." @page = "PHB??" @link = "http://www.d20srd.org/srd/feats.htm#greatFortitude" end def self.available?(char) return !fe...
Ruby
class ImprovedCritical < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Improved Critical" @description = "When using the weapon you selected, your threat range is doubled." @page = "PHB??" @link = "http://www.d20srd.org/srd/feats.htm#improvedCritical" end def self.a...
Ruby
class IronWill < FeatModel def initialize super @title = "Iron Will" @description = "You have exceptional willpower." @page = "PHB??" @link = "" end def self.available?(char) return !feat_taken(char) end def self.add(char) super(char) char.will_save["misc"] += 2 end de...
Ruby
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class Stealthy < FeatModel def initialize super @title = "Stealthy" @bonus_classes = [] @description = "+2 Bonus on Hide and Move Silently checks" @page = "PHB100" @link = ...
Ruby
class WeaponFocus < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Weapon Focus" @description = "You gain a +1 bonus on all attack rolls you make using the selected weapon." @page = "PHB??" @link = "http://www.d20srd.org/srd/feats.htm#weaponFocus" end def self.availa...
Ruby
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class Athletic < FeatModel def initialize super @title = "Athletic" @bonus_classes = [] @description = "+2 Bonus on Climb and Swim checks" @page = "PHB 89" @link = "" end...
Ruby
class ImprovedShieldBash < FeatModel @bonus_classes = ["Fighter"] def initialize super @title = "Improved Shield Bash" @description = "When you perform a shield bash, you may still apply the shield's shield bonus to your AC." @page = "PHB??" @link = "http://www.d20srd.org/srd/feats.htm#improvedS...
Ruby
class Leadership < FeatModel @bonus_classes = [] def initialize super @title = "Leadership" @bonus_classes = [] @description = "Having this feat enables the character to attract loyal companions and devoted followers, subordinates who assist her. " @page = "PHB??" @link = "http://www.d20srd.org/...
Ruby
#require "FeatList" # require 'pathname' # require Pathname(__FILE__).ascend{|d| h=d+'FeatList.rb'; break h if h.file?} class DeftHands < FeatModel def initialize super @title = "Deft Hands" @bonus_classes = [] @description = "+2 Bonus on Sleight of Hand and Use Rope checks" @page = "PHB93" ...
Ruby
class CombatCasting < FeatModel def initialize super @title = "Combat Casting" @description = "You get a +4 bonus on Concentration checks made to cast a spell or use a spell-like ability while on the defensive or while you are grappling or pinned." @page = "PHB??" @link = "" end def self.ava...
Ruby
# ClericSpells - List of D&D Spells[SpellModel] for Cleric # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General ...
Ruby
# RangerSpells - List of D&D Spells[SpellModel] for Ranger # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
Ruby
# SorcererSpells - List of D&D Spells[SpellModel] for Sorcerer # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GN...
Ruby
# DruidSpells - List of D&D Spells[SpellModel] for Druid # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
Ruby
# BardSpells - List of D&D Spells[SpellModel] for Bard # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU Genera...
Ruby
# PaladinSpells - List of D&D Spells[SpellModel] for Paladin # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
Ruby
SpellList.granted_powers_list["Air Domain"] = "Turn or destroy earth creatures as a good cleric turns undead." + "Rebuke, command, or bolster air creatures as an evil cleric rebukes undead." + "Use these abilities a total number of times per day equal to 3 + your Charisma modifier." SpellList.granted_powers_procs...
Ruby
# WizardSpells - List of D&D Spells[SpellModel] for Wizard # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
Ruby
# Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Fo...
Ruby
# Storm Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Lizardfolk - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Gnoll - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the...
Ruby
# Drow - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the ...
Ruby
# Tiefling - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# Stone Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Half-Dragon - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Aquatic Elf - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Azer - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the ...
Ruby
# Medusa - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of th...
Ruby
# Kobold - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of th...
Ruby
# Hill Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Wild Elf - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# Troll - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the...
Ruby
# Minotaur - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# Vampire - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of t...
Ruby
# Orc - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the G...
Ruby
# Gray Elf - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# Goblin - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of th...
Ruby
# Troglodyte - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Fire Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Cloud Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Ogre Mage - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of...
Ruby
# Ogre - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the ...
Ruby
# Half-Celestial - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the ter...
Ruby
# Aasimar - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of t...
Ruby
# Hobgoblin - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of...
Ruby
# Half-Fiend - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Doppleganger - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms...
Ruby
# Frost Giant - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms ...
Ruby
# Wood Elf - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# Rakshasa - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of ...
Ruby
# ClassModel - Model of D&D classes and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the term...
Ruby
# SkillModel - Model of D&D spells and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms...
Ruby
#SPOOT
Ruby
# RaceModel - Model of D&D race and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of...
Ruby
# SkillModel - Model of D&D skills and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms...
Ruby
# FeatModel - Model of D&D feats and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms o...
Ruby
# Roll - manager for string based dice rolls # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
Ruby
# SpellList - Manager of D&D spells[SpellModel], spell generation and container for related methods # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or m...
Ruby
# ClassList - Manager of D&D Classes[ClassModel] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
Ruby
# FeatList - Manager of D&D Feats[FeatModel] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
Ruby
# SkillList - Manager of D&D skills[SkillModel], skill generation and container for related methods # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or m...
Ruby
# RaceList - Manager of D&D Races[RaceModel] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
Ruby
# LanguageList - Manager of D&D Languages[String] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
Ruby
# Skills - List of D&D Skills[SkillModel] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
Ruby
# Languages - Manager of D&D Languages[String] # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public...
Ruby
class Name attr_accessor :name, :pre, :post @@tokens = Hash.new(Hash.new(Hash.new([]))) @token_categories = ["General"] @alignment="" def self.load(relative_path="Names") Dir.glob(File.join("#{File.dirname(__FILE__)}", "/*/*.txt")).each do |file| #Dir.glob(File.join(".", "*/*.txt")).each do |file| ...
Ruby
class Background attr_accessor :primary_motivation, :secondary_motivation, :history @@background = Hash.new([]) @result = "" @alignment="" def self.load(relative_path="Backgrounds") Dir.glob(File.join("#{File.dirname(__FILE__)}", "/*.txt")).each do |file| File.open(file, "r") do |file| while(l...
Ruby
require_relative "Character" #require_relative "Lists" temp = ["PHB", "MM1"]#, "mm1","eberron","forgotten realms","frostburn"] temp.each { |book| Dir.glob("./**/"+book+"/*Races/*.rb").each {|file| require file} } temp.each { |book| Dir.glob("./**/"+book+"/*Classes/*.rb").each {|file| require file} } temp.each { ...
Ruby
# Character - Model for D&D characters and container for related information # Copyright (C) 2011 Cody Garrett, Josh Murphy, and Matt Ingram # This file is part of FishTornado D&D Character Generator. # FishTornado D&D Character Generator is free software: you can redistribute it and/or modify # it under the t...
Ruby
# Roll - manager for string based dice rolls # Copyright (C) 2011 Cody Garrett # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
Ruby
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name =>...
Ruby
class CreateDndCharacters < ActiveRecord::Migration def self.up create_table :dnd_characters do |t| t.string :name t.integer :seed t.string :settings t.timestamps end end def self.down drop_table :dnd_characters end end
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integrati...
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 'prawn' # Use unicorn as the web server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19...
Ruby
module ApplicationHelper end
Ruby
module DndCharactersHelper end
Ruby
class DndCharacter < ActiveRecord::Base validates_numericality_of :seed validates_length_of :seed, :maximum => 19 end
Ruby
class ApplicationController < ActionController::Base protect_from_forgery end
Ruby
require 'prawn' require "#{File.dirname(__FILE__)}/../../../../D&D 0.5/Character_Generator.rb" class DndCharactersController < ApplicationController # GET /dnd_characters # GET /dnd_characters.xml def index @dnd_characters = DndCharacter.all respond_to do |format| format.html # index.html.erb ...
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. # 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
# 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. # 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_alias "text/plain", :txt
Ruby
# Be sure to restart your server when you modify this file. CharacterGeneratorRails::Application.config.session_store :cookie_store, :key => '_Character_Generator_Rails_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (c...
Ruby
CharacterGeneratorRails::Application.routes.draw do resources :dnd_characters # 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 ...
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 CharacterGeneratorRails class Application < Rails::A...
Ruby
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application CharacterGeneratorRails::Application.initialize!
Ruby
CharacterGeneratorRails::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 cach...
Ruby
CharacterGeneratorRails::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 r...
Ruby
CharacterGeneratorRails::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 spac...
Ruby
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run CharacterGeneratorRails::Application
Ruby