This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@items = Item.find(:all, :conditions => {:visible => true, :equipment_slot => GameConfig.equipment_slots.index(params[:slot])}). | |
inject(Hash.new { |hash, new_key| hash[new_key] = [] }) { |category_groups, item| category_groups[item.category_id] << item; category_groups }. | |
values. | |
collect {|category_group| category_group.sort_by(&:cost)}. | |
flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def query_parse(qs, d = '&;') | |
params = {} | |
(qs||'').split(/[#{d}] */n).inject(params) { |h,p| | |
k, v=unescape(p).split('=',2) | |
if cur = params[k] | |
if cur.class == Array | |
params[k] << v | |
else | |
params[k] = [cur, v] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rfacebook' | |
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/..') unless defined? RAILS_ROOT | |
RAILS_ENV = ENV['RAILS_ENV'] || 'development' unless defined? RAILS_ENV | |
require File.join(RAILS_ROOT, 'config', 'initializers', 'starling') | |
ConfigFace = YAML.load_file(File.join(RAILS_ROOT, 'config', 'facebook.yml'))[RAILS_ENV] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testing |
NewerOlder