gem 'tire'ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL']Bonsai offers a Heroku add-on for ElasticSearch.
ElasticSearch is the latest generation search engine built on the powerful Lucene library. Its API is freshly designed around modern RESTful JSON conventions, making it easy to learn and understand. ElasticSearch will automatically index your JSON data with sensible defaults, which means that you can get started without writing a single line of configuration. ElasticSearch is the perfect place to start for anyone new to full-text search engine concepts, or for anyone who is looking for more clarity and less ceremony in their search engine.
The ElasticSearch internals are designed from the ground up with data distribution in mind. This means you get greater scalability, performance and reliability in a cloud hosted environment. An ElasticSearch index can automatically shard your data, to scale to the largest indexes and support high volumes of write traffic. All of our
| #! /bin/bash | |
| # | |
| # This script repairs Mac OS X site_ruby and ruby symbolic links if they are broken. | |
| # For more information on this problem please see: http://openradar.appspot.com/9202152 | |
| # | |
| set -e | |
| set -u | |
| timestamp=$(date +%s) |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential | |
| apt-get -y install git-core | |
| # Install rbenv | |
| git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # Add rbenv to the path: |
| These properties can be used to alter runtime behavior for perf or compatibility. | |
| Specify them by passing -X<property>=<value> | |
| or if passing directly to Java, -Djruby.<property>=<value> | |
| or put <property>=<value> in .jrubyrc | |
| compiler settings: | |
| compile.mode=[JIT, FORCE, OFF] | |
| Set compilation mode. JIT = at runtime; FORCE = before execution. Default is JIT. | |
| compile.dump=[true, false] |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| # WAIT! Do consider that `wait` may not be needed. This article describes | |
| # that reasoning. Please read it and make informed decisions. | |
| # https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path |
| # add this to your ../app/controllers/application_controller.rb | |
| class ApplicationController < ActionController::Base | |
| before_filter { |c| _admin_prolog(c) } # should be the first one! | |
| after_filter { |c| _admin_epilog(c) } # should be the last one! |
| # gem install datamapper dm-sqlite-adapter sunspot sunspot_rails activesupport | |
| require 'rubygems' | |
| require 'datamapper' | |
| require 'sunspot' | |
| require 'sunspot/rails' | |
| require 'active_support/all' | |
| DataMapper::Logger.new($stdout, :debug) | |
| DataMapper.setup(:default, 'sqlite::memory:') |
| connection = DataObjects::Connection.new(uri) | |
| connection.close | |
| # immediately executed statements | |
| reader = connection.query('SELECT * FROM table WHERE id = ?', 1) | |
| reader.set_types(Integer) # returns self for chaining | |
| reader.each { |row| ... } |