Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
229 lines (212 sloc) 57.9 KB
require 'rubygems'
gem 'json', '~> 1.4.6'
require 'benchmark'
require 'active_support/core_ext/class/attribute_accessors'
require 'active_record'
config = YAML::load_file("config/summer.yml")
ActiveRecord::Base.establish_connection(config["database"])
ActiveRecord::Schema.define do
create_table :channels, :force => true do |t|
t.string :name
end
create_table :constants, :force => true do |t|
t.string :name, :url
t.integer :api_id
end
add_index :constants, :api_id
create_table :entries, :force => true do |t|
t.string :name, :url
t.integer :constant_id
end
add_index :entries, :constant_id
create_table :messages, :force => true do |t|
t.string :text
t.integer :channel_id
t.integer :person_id
end
create_table :people, :force => true do |t|
t.string :nick
t.boolean :authorized, :default => false
end
create_table :tips, :force => true do |t|
t.string :command
t.text :text
end
end
Dir["lib/models/*.rb"].each { |f| require f }
["radar","workmad3","toretore","augustl","Remear","SuperTaz","eladmeidar","ReinH","Hates_","JayM","mark[oz]","anathematic","pjammer","confounds","dpickett","camonz","crankharder","fowlduck","Derander","tobago","bjeanes","omarqureshi","wmoxam","dfr | work","kithpom","jschoolcraft","Dreamer3","philcrissman","halogenandtoast","edavis10","withanx","leethal","djones","djones_","wycats","apow","wuputah","jasonking","dfr","m4rtijn | lap","rsl","hates","lenary","apeiros_","Caius","foucist","magneto","xanderbeedle","RubyPanther","rds","nate-","zodiak","apeiros","rohit","hosh_work","Tass_","erikh","twe4ked","Tasser","aperios_","aperios", "SpaceGhostC2C", "samuelkadolph"].each do | p |
Person.create!(:nick => p, :authorized => true)
end
require 'cucumber/ast'
tips = Cucumber::Ast::Table.new(
%Q{
| twonklist | http://twonklist.com - A place to name and shame the less desirable people of the world. |
| finders | http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg |
| routing | http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy |
| associations | http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy |
| bt | http://guides.rubyonrails.org/association_basics.html#the-belongs_to-association |
| ho | http://guides.rubyonrails.org/association_basics.html#the-has_one-association |
| hm | http://guides.rubyonrails.org/association_basics.html#the-has_many-association |
| hmt | http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association |
| habtm | http://guides.rubyonrails.org/association_basics.html#the-has_and_belongs_to_many-association |
| rails-view-lookup | http://stuff.lilleaas.net/how_rails_selects_which_view_to_render - Which conditions Rails uses in order to determine which view file to render when controller actions are invoked. |
| routing-overview | http://guides.rubyonrails.org/routing.html - A guide to Rails routing. |
| guides | http://guides.rubyonrails.org/ - Ruby on Rails guides, part of the ongoing hackfest |
| botsnack | Nom nom. Thanks, {nick}! |
| peepcode | http://peepcode.com - Awesome screencasts of very high quality and relevance. The $9 is totally worth it. |
| railscasts | http://railscasts.com - Great free screencasts by Ryan Bates. Tips, tricks and best practices. |
| lighthouse | http://lighthouseapp.com -- beautiful simple issue tracking |
| fatmodel | http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model - Place the logic where it's supposed to be placed |
| rails-lighthouse | http://rails.lighthouseapp.com - Rails issue tracking |
| wwrd | What would Radar do? |
| windows | http://lmgtfy.com/?q=installing+rails+on+windows |
| scaffold | http://tpope.us/rubyonrailsfaq.html |
| passenger | Passenger (mod_rails) is an Apache / nginx module for running Rails applications. It is fast, sexy and very easy to setup. http://www.modrails.com/. Other resources: Peepcode's setup guide: http://peepcode.com/products/phusion-passenger Railscasts: http://railscasts.com/episodes/122-passenger-in-development |
| webhosts | http://lmgtfy.com/?q=rails+web+hosts |
| php | <Narley>: PHP is Russia and Ruby on Rails is America |
| rubyonrails-talk | http://groups.google.com/group/rubyonrails-talk |
| yourownblog | http://nubyonrails.com/articles/about-this-blog-memcached - Every beginning Rails developer should write their own blog software. |
| vampire | Help vampire detected by {nick}. Dispersing e-Garlic and wooden stakes. |
| select_all | http://guides.rubyonrails.org/active_record_querying.html#select_all |
| i18n | http://guides.rubyonrails.org/i18n.html - Guide on i18n by Sven Fuchs and Karel Minařík |
| howtoaskforhelp | http://www.catb.org/~esr/faqs/smart-questions.html#before |
| acl | http://ruby-toolbox.com/categories/rails_authorization.html |
| skitch | http://skitch.com - Image sharing site with related application for Mac OS X |
| quickref | http://www.zenspider.com/Languages/Ruby/QuickRef.html - Quick reference for the Ruby Language |
| multi-updates | http://github.com/Radar/multi-updates/tree/master - An example application of how to update multiple rows from the same model at the same time. |
| editor | Commonly used Rails editors: Textmate, Vim, Aptana, Emacs, Netbeans, Eclipse and (NOT) Dreamweaver (see !ide for ide lists) |
| ide | Eclipse, Netbeans and Aptana. Please note if you are on Mac Os X an IDE is not recommended. |
| git | Git is a version control system used for both Ruby on Rails and most plugin / gems. See http://git.or.cz/ for Git, http://github.com/ or http://unfuddle.com for hosting and http://railscasts.com/episodes/96 for managing Rails applications with git |
| beginner | Resources for beginning in Ruby on Rails: http://guides.rubyonrails.org/ - http://peepcode.com/ - http://railscasts.com/ |
| cms | Content Managmenet Systems for Ruby on Rails: Typo http://typosphere.org - Mephisto http://mephistoblog.com/ - RadiantCMS http://radiantcms.org/ |
| haml | Haml is an alternative markup to HTML, for help and information please see the documentation http://haml-lang.com/docs.html or ##haml |
| docs | Rails: http://api.rubyonrails.org/ Ruby: http://www.ruby-doc.org/core/ Both, and more: http://railsapi.com/ |
| hosts | http://lmgtfy.com/?q=rails+web+hosts |
| ask | Don't ask to ask, just ask! http://www.catb.org/~esr/faqs/smart-questions.html |
| capistrano | Capistrano is a neat deployment method for Rails applications, see the capistrano site for more details https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started |
| contributing | How to contribute to Rails, http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html |
| wwod | What would Obama do? |
| ajax | New to Ajax / Javascript? Before asking a million questions in the channel please have a look through some great resources: http://peepcode.com/products/javascript-with-prototypejs http://peepcode.com/products/ajax-with-prototypejs |
| demons | No John you are the demons |
| association-basics | http://guides.rubyonrails.org/association_basics.html by Mike Gunderloy |
| notabug | It's probably not a bug: http://www.catb.org/esr/faqs/smart-questions.html#id306810 |
| pebkac | PEBKAC: Problem Existing Between Keyboard And Chair. Also known as "User Error" |
| used | Don't ask "has anybody used <thing>?". It's better to just ask your problem and if anyone has used <thing> they will most likely answer. |
| best | "Best" and "better" are subjective. Try to use a different term. |
| cte | You must remove the line from config/environments/development.rb and config/environments/production.rb in order to get your app to function correctly. |
| textmate | Kick-ass text editor for Macs. If you have a Mac, code, and don't use TextMate you're a fool. http://macromates.com/ |
| zen | Relax, take a deep breath, find your center - peace is waiting for you there. |
| scale | Ruby on Rails doesn't scale - nothing to see here - move along. http://twitter.com/ |
| try | Why don't you try it and find out for yourself? |
| pickaxe | http://rubycentral.com/book - Programming Ruby is a free online book on Ruby. |
| everused | just post the fucking bug already |
| rtft | This channel has a topic that contains helpful links. One of these links may help you. If you cannot see the topic, type /topic and press enter. |
| version | Please tell us what version of Ruby, Rubygems and Rails you're running on so we can better help you. Also if you haven't already tell us your operating system too. |
| logs | Check your logs. Namely everything in the log folder of your rails app and the error and access logs from Apache or whatever else you're using. |
| language | wash your mouth out! |
| expert | we all like to think we're experts; just ask your question |
| section | Please section your pasties using the syntax of "## section header", for more information see this: http://skitch.com/radarlistener/9d6i/new-pastie |
| paperclip | https://github.com/thoughtbot/paperclip - A file upload plugin for Rails. w/ example http://github.com/anathematic/paperclip_example/tree/master |
| attachment_fu | http://github.com/technoweenie/attachment_fu/tree/master - A file upload plugin for Rails. |
| rboard | http://github.com/radar/rboard - A forum system built in Rails. It's compatible with Rails 2.2 and includes internationalization support. |
| fucktard | Dear sir, I am not of high opinion of your intelligence. |
| camel | I would rather mate with a camel than listen to you bitching, go google your issue and stop being a gibbon! |
| cock | you must be compensating for having a very small penis, otherwise it escapes my why you would be such a giant cock in public! |
| flame | look my texteditor is better than yours STFU |
| monkeyattack | we are winding up the clockwork monkeys, they will be round to collect your liver shortly... |
| trout | Im terribly sorry about this! I am a pacifist but I must do my masters bidding so would you mind awfully holding still whilst I insert this trout up your nostril? |
| tutorial | you can probably find a tutorial on it on either, http://www.railscasts.com or http://www.peepcode.com |
| migrations | http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung |
| gettingstarted | http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy |
| will_paginate | http://github.com/mislav/will_paginate/tree/master - Pagination plugin for Rails. |
| howlong | http://www.google.com.au/search?q=how+long+is+a+piece+of+string |
| ohgoditburns | Your HTML skills are inferior: http://catb.org/esr/html-hell.html |
| jquery | Main site: http://jquery.com/ Docs: http://visualjquery.com/ Using it in Rails: https://github.com/rails/jquery-ujs |
| rubygems | http://rubygems.org/ - The latest version of Rubygems (and all other versions) can be found here. |
| rspec | http://rspec.info - RSpec is a Behaviour Driven Development framework for Ruby. |
| cucumber | Cucumber - Successor to stories for rspec http://github.com/aslakhellesoy/cucumber/tree/master |
| arrayconditions | How to use array conditions in find statements (["field = ?", some_variable]) http://guides.rubyonrails.org/finders.html#_array_conditions |
| rest | REST - (REpresentational State Transfer) - http://en.wikipedia.org/wiki/Representational_State_Transfer |
| thinkingsphinx | http://ts.freelancing-gods.com/ - Thinking Sphinx - Plugin for Rails, uses Sphinx (full-text search engine for MySQL and PostgreSQL) |
| dry | Don't repeat yourself. Asking the same question repeatedly will not give you more answers. |
| books | What book should you get? - http://is.gd/hYWq |
| gist | http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages. |
| slicehost | http://slicehost.com - A hosting company that provides a box that you can install Ruby on Rails on to. |
| activemerchant | Activemerchant provides you with a way to interact between your application and supported payment gateways: http://github.com/Shopify/active_merchant/tree/master |
| saasy | SaaSy: Scaffold-like application for payment gateways (uses ActiveMerchant): http://github.com/maccman/saasy/tree/master |
| auth | If you want to implement user's with passwords in your application, you can use AuthLogic: http://github.com/binarylogic/authlogic/tree/master or Restful Authentication: http://github.com/technoweenie/restful-authentication/tree/master |
| survivalguide | http://tore.darell.no/doc.html - Survival guide for Ruby. Must read. |
| wiki | http://wiki.rubyonrails.org/ |
| ducktyping | Learn about Duck Typing here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/100511 |
| tags | tag plugins : http://github.com/mbleigh/acts-as-taggable-on/tree/master w/ plugin example: http://github.com/anathematic/taggable-example/tree/master |
| application | As of Rails 2.3 ApplicationController has been moved from app/controllers/application.rb to app/controllers/application_controller.rb to better follow convention. Rename your application.rb file using 'rake rails:update:application_controller'. |
| render | Layouts and Rendering Guide http://guides.rubyonrails.org/layouts_and_rendering.html |
| layout | Layouts and Rendering Guide http://guides.rubyonrails.org/layouts_and_rendering.html |
| cache_template_loading | cache_template_loading= is a deprecated method. Remove this from all files in config/environments |
| tasks | Have you checked the rake tasks for your project, yet? Simply type 'rake -T' inside your application's directory to list the available rake tasks. |
| expectedgot | If you're getting Model(#[num]) expected, got String(#[num]) this is because you're passing in from the form a parameter with the name of a belongs_to association. Make sure you change the field name to association_id. |
| elaborate | Instead of simply saying 'something is broken' please elaborate on this by showing us the code and the error that you are getting by making a Gist (http://gist.github.com) about it. |
| files | Storing files in the database will only lead to misery and heartbreak. Store files where they belong, in the filesystem. Use a file-upload plugin such as Paperclip to acheive this. |
| caching | Caching with Rails Guide - http://guides.rubyonrails.org/caching_with_rails.html - by Aditya Chadha |
| topic | Read the topic. It contains useful information. Failure to read the topic will result in horrible consequences. |
| validations | How to make your own custom validations: http://august.lilleaas.net/creating_your_own_validations |
| command_line | Command Line Guide written by Colin Curtin |
| locales | A comprehensive list of locales and exxamples of translation Rails' default messages - http://github.com/svenfuchs/rails-i18n/tree/d19c80c14b1c3da06822a0cde6ed0ce048f5971f/rails/locale |
| mindread | Sorry, we are unable to read your mind at this time. Please gist (http://gist.github.com) your code and any relevant stacktrace so we can assist you. |
| subjective | What you just asked could be classed as subjective. Subjective questions often start flamewars, which are tedious and boring. Try all the available options and see which one suits you the best. |
| doubleroutes | It looks like you have the same resource defined twice. Try removing one of them and seeing if that fixes your problem. |
| ydiw | Be open to the idea that you're doing it wrong. |
| bion | Believe it or not, we're actually here to help you be a better programmer. |
| fans | Looking to create a has_and_belongs_to_many relationship through the same table? (e.g. friends or followers?) look no further than http://github.com/radar/fans |
| pastebinsucks | Pastebin sucks! Use http://gist.github.com please! |
| pbcompare | Pastebin: http://skitch.com/ryanbigg/nnxxn/pastebin vs Pastie: http://skitch.com/ryanbigg/nnxxf/pastie. I know which I'd prefer |
| explain | Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful! |
| exceptional | http://getexceptional.com/ - Get Exceptional - Exception logging for your Rails application |
| hoptoad | http://www.hoptoadapp.com/ - Hoptoad - Exception logging for your Rails application |
| newrelic | http://www.newrelic.com/ - New Relic - Reports for your Rails application |
| acl9 | http://github.com/be9/acl9 - Access Control List for controlling what users have access to what resources |
| lies | As the bot of the channel I have determined through my computational prowess that what you said was untruthful. If you believe this to be in error, you are wrong. Computers do not make mistkaes. |
| e | Instead of simply saying 'something is broken' please elaborate on this by showing us the code and the error that you are getting by making a Gist (http://gist.github.org) about it. |
| shrug | Sorry, {{nick}} is not able to help you any further as they do not know. |
| nike | Just do it! |
| no_relations | Code to find all records without associated ones: http://stackoverflow.com/questions/1314408/finding-all-records-without-associated-ones |
| path | If you're getting undefined method <name>_path it usually means you haven't defined map.resources :<name> in your config/routes.rb file. Go do that now. |
| canihazquote | no. now go back to work. |
| mysqlres | You haven't installed your MySQL gem correctly. Do this: sudo gem uninstall mysql; export ARCHFLAGS="-arch i386 -arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config |
| better | There's a better way to do that. |
| troll | TROLL DETECTED! |
| linode | http://linode.com - A hosting company that provides a box that you can install Ruby on Rails on to. |
| raw | The new default for Rails 3 is that anything inside of <%= %> is escaped automatically. To turn this off use this syntax: <%= raw(text) %>. |
| usage | To use the bot you have to be trustworthy enough. This is determined through a top-secret government-provisioned process of code and politics. tl;dr: Help out. Earn the respect of your peers. Receive bot access. |
| rubular | http://rubular.com - Ruby regular expression test site |
| mysql-mac | Follow these instructions to install mysql on Mac OS X (helps with gem install): http://hivelogic.com/articles/installing-mysql-on-mac-os-x |
| mysql-sl | Follow these instructions to install MySQL on Snow Leopard (helps with gem install): http://hivelogic.com/articles/compiling-mysql-on-snow-leopard |
| nosql | Should your project use a noSQL solution? http://nosql.mypopescu.com/post/398352022/recipes-for-using-nosql-solutions |
| whatisnosql | NoSQL landscape, an article in progress: http://www.vineetgupta.com/2010/01/nosql-databases-part-1-landscape.html |
| EvilEpoch | The EvilEpoch never speaks about The EvilEpoch in the First Person. The EvilEpoch has ascended above this level. The first rule about EvilEpoch is not talk about EvilEpoch in the first person. |
| rtfm | I believe you will find the answer to that question in the documentation, good Sir or Madam. |
| tldr | Your line was too long and was cut off. Try splitting it into more appropriate bite-sized chunks but remember the enter key is not the space bar. |
| authlogic | http://github.com/binarylogic/authlogic - Authlogic - An extensible yet lightweight authentication gem for Rails. |
| read | If you read the error message it may help you. |
| homework | This channel is not here to do your homework for you. |
| foo | Please do not use fake variables for your name such as "foo", "bar" or "x". Use the real names, as if it makes sense to you it probably will make sense to the people helping you. |
| enternotspace | The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long. |
| oneq | You only need to put one question mark at the end of a sentence to mark it as a question: http://en.wikipedia.org/wiki/Question_Mark |
| domain | http://ryanbigg.com/2010/04/rubyonrails-org-is-down/ |
| reserved | Choosing model/variable names is hard. when you do find one, pay attention it's not one of those: http://wiki.rubyonrails.org/rails/pages/reservedwords |
| so | If you're not getting an answer here perhaps try asking on http://stackoverflow.com Use the tag "ruby-on-rails" |
| law | http://en.wikipedia.org/wiki/Law_of_the_instrument Just because you could use Ruby/Rails for something, doesn't mean you should always use it. Look for alternatives. |
| angry | Getting angry at the people who are trying to help you is not the way to win favours. Play nice, or go away. |
| listen | Please, listen to us: http://ryanbigg.com/2010/05/listen-to-us/ |
| koans | http://github.com/edgecase/ruby_koans |
| r3ia | Use the discount code rails350 to get 50% off Rails 3 in Action - http://manning.com/katz - The upcoming book written by Yehuda Katz and Ryan Bigg (Radar) |
| rvm | RVM (Ruby Version Manager) - http://rvm.beginrescueend.com/ |
| ror | Please ask Ruby on Rails questions in the #rubyonrails channel. |
| eieo | Please show us your expected input and output. By providing this, it makes it easier for us to understand what you're trying to do. |
| indent | Two spaces is *the* standard indentation for Ruby. Please always use two-space indentation. Tabs are evil. See http://www.caliban.org/ruby/rubyguide.shtml#indentation |
| mlb | Multi-lined blocks should use `do` and `end` rather than curly braces. |
| example | Please show us an example of what you want. |
}.strip.split("\n").map { |tip| tip.split("|")[1..-1].map(&:strip) }).raw
tips.each do |command, text|
Tip.create!(:command => command, :text => text)
end