Skip to content

Instantly share code, notes, and snippets.

{
"doc": {
"_all": {
"enabled": false
},
"_source": {
"enabled": true
},
"dynamic_templates": [
{
def select2 text, options
page.find("#s2id_#{options[:from]} a").click
find(:xpath, "//body").find("input.select2-input").set(text)
page.execute_script(%|$("input.select2-input:visible").keyup();|)
find(:xpath, '//body').find('ul.select2-results li', text: text).click
end
@andreierdoss
andreierdoss / nokogiri build fix
Created October 1, 2011 18:30
WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3
gem install nokogiri -- --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include
#!/usr/bin/env ruby
#
# A complete URL-shortening web application, written in Ruby/Sinatra. Run it
# from the command line, and then visit http://localhost:4567/
#
# Or to run it under apache/passenger, you'll need a config.ru file with the
# following contents:
#
# require 'tinyurl'
# run Sinatra::Application
run "gem sources -a http://gems.github.com"
plugin 'acts_as_commentable', :svn => "http://juixe.com/svn/acts_as_commentable"
file "db/migrate/" + Time.now.strftime("%Y%m%d%H%M%S") + "_acts_as_commentable.rb",
%q{class ActsAsCommentable < ActiveRecord::Migration
def self.up
create_table "comments", :force => true do |t|
t.column "title", :string, :limit => 50, :default => ""
t.column "comment", :text, :default => ""
(in /home/andrei/Desktop/tog_to_232)
(in /home/andrei/Desktop/tog_to_232/vendor/plugins/tog_core)
Adding [:mail_user_observer, :user_observer] to []
Loaded suite /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
................F................................F...
Finished in 6.108315 seconds.
1) Failure:
test: The Tog config system when setting a value for a key should change "Tog::Config.count" by 1. (ConfigTest)
ActionController::Routing::Routes.draw do |map|
map.resources :users
map.resource :session
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.signup '/signup', :controller => 'users', :action => 'new'
map.forgot '/forgot', :controller => 'users', :action => 'forgot'
map.denied '/denied', :controller => 'authorization', :action => 'denied'
map.reset '/reset/:reset_code', :controller => 'users', :action => 'reset'
ActionController::Routing::Routes.draw do |map|
map.resources :profiles
map.resources :streams, :only => [:index, :show]
map.with_options(:controller => 'groups') do |group|
group.tag_groups '/groups/tag/:tag', :action => 'tag'
end
map.resources :groups, :collection => { :search => :get }, :member => { :join => :get, :leave => :get }
ActionController::Routing::Routes.draw do |map|
map.namespace(:member) do |member|
member.with_options(:controller => 'messages') do |messages|
messages.resources :messages,
:collection => { :move => :post,
:copy => :post,
:mark_as_read => :post,
:mark_as_unread => :post,
:search => :get
# Add your custom routes here. If in config/routes.rb you would
# add <tt>map.resources</tt>, here you would add just <tt>resources</tt>
ActionController::Routing::Routes.draw do |map|
map.root :controller => "home"
map.with_options(:controller => 'search') do |search|
search.do_search 'search', :action => 'search'
end