This file contains hidden or 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
(非关系性数据库的forum全部直接滤过了) | |
#communityengine | |
简介:一个将你现有的应用程序,包括用户、博客、照片、剪报、收藏,以及更多基于社交能力的功能集合到一起。 | |
官网: http://www.communityengine.org | |
github(rails3)地址: https://github.com/bborn/communityengine/tree/rails3 | |
优点: 功能多、多Rails版本支持,界面比较丰富,开发者贡献者多到目前还再维持更新中,wiki比较齐全 | |
缺点: 当不需要用到那么多功能时,庞大功能配置将会是很麻烦, | |
forum-monster | |
简介: forum-monster是在Rails 3 |
This file contains hidden or 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
module Settings | |
def self.get key | |
val = data.fetch(Rails.env, nil).try(:[], ENV["PLATFORM"]).try(:[], key) | |
raise "value nil in #{ Rails.en }" if val.nil? && Rails.env != "test" | |
val | |
end | |
def self.data | |
@data ||= YAML.load_file File.join(Rails.root, "config/settings.yml") | |
end |
This file contains hidden or 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 "redis" | |
redis = Redis.new | |
def get_prefixes word | |
Array.new(word.length) do |i| | |
if i == word.length - 1 | |
"#{ word }*" | |
else | |
word[0..i] |