Skip to content

Instantly share code, notes, and snippets.

@libryder
Created October 16, 2011 00:52
Show Gist options
  • Save libryder/1290375 to your computer and use it in GitHub Desktop.
Save libryder/1290375 to your computer and use it in GitHub Desktop.
Config files for integrating adhearsion and rails
# Use path_nesting to specify an arbitrarily nested. Could be used for additional security or in HTTP reverse proxy server.
path_nesting: /
port: 5000
# The "handler" option here can be any valid Rack::Handler constant name.
# Other options: WEBrick, EventedMongrel.
# If you don't know the differences between these, "Mongrel" is definitely a good choice.
handler: WEBrick
# In a production system, you should make this "false" since
show_exceptions: true
# The "authentication" config option can either be "false" or key/value pairs representing allowed usernames and passwords.
#authentication: false
authentication:
jicksta: roflcopterz
foo: bar6213671682
access: everyone # When allowing "everyone" access, no IPs are blocked.
#access: whitelist # When using a whitelist, the "whitelist" data below will be used.
#access: blacklist # When using a blacklist, the "blacklist" data below will be used.
# This is a list of IPs which are exclusively allowed to call this web service.
# Note: whitelists are far more secure than blacklists.
whitelist:
- 127.0.0.1
- 192.168.*.*
# This is a list of the IPs which are explicitly NOT allowed to call this web service. This will only be used if "access" is
# set to "blacklist" above.
blacklist:
- 100.200.100.200
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'jquery-rails'
module AhnCallengine
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
require 'rubygems'
require 'bundler'
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
AhnCallengine::Application.initialize!
source 'http://rubygems.org'
gem 'adhearsion', '>= 1.2.1'
gem 'ahn-restful-rpc'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
#!/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__)
AhnCallengine::Application.load_tasks
# This file is for the "rake" tool which automates project-related tasks. If you need to automate things, you can create
# a new Rake task here. See http://rake.rubyforge.org for more info.
require 'rubygems'
require 'bundler'
begin
require 'adhearsion/tasks'
rescue LoadError
STDERR.puts "\nCannot load Adhearsion! Not all Rake tasks will be loaded!\n\n"
end
desc "Writes a .gitignore file that ignores certain SCM annoyances such as log files"
task :gitignore do
ignore_file = "#{Dir.pwd}/.gitignore"
if File.exists? ignore_file
STDERR.puts "File #{ignore_file} already exists!"
else
File.open ignore_file, 'w' do |file|
# Add other files to the Array below
%w[ log ].each do |pattern|
file.puts pattern
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment