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 'hpricot' | |
| require 'open-uri' | |
| require 'work_queue' | |
| dir = Dir.new("path/to/your/dir") | |
| class DownloadWiki | |
| def initialize | |
| @locales = collect_locales | |
| @host = "http://download.wikimedia.org/" |
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 UserCommonLogic | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| #Class methods | |
| module ClassMethods | |
| def authenticate(username, password) | |
| u = find :first, :conditions => ['username = ?', username] |