This file contains 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
def raw_find(view, key) | |
url = URI::parse(CouchPotato::Config.database_name) | |
if key.is_a?(String) | |
http_client = Curl::Easy.new("#{url}/_design/advocacy_polygon/_view/#{EscapeUtils.escape_url(view)}?key=%22#{EscapeUtils.escape_url(key.to_s)}%22&reduce=false&include_docs=true") | |
elsif key.is_a?(Integer) | |
http_client = Curl::Easy.new("#{url}/_design/advocacy_polygon/_view/#{EscapeUtils.escape_url(view)}?key=#{EscapeUtils.escape_url(key.to_s)}&reduce=false&include_docs=true") | |
elsif key.is_a?(Range) | |
http_client = Curl::Easy.new("#{url}/_design/advocacy_polygon/_view/#{EscapeUtils.escape_url(view)}?startkey=#{EscapeUtils.escape_url(key.begin)}&endkey=#{EscapeUtils.escape_url(key.end)}&reduce=false&include_docs=true") | |
else | |
raise SyntaxError |
This file contains 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
# Run these commands | |
# Uses Homebrew install of libxml2 with Snow Leopard version of libxslt | |
brew install libxml2 | |
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xslt-lib=/usr/lib/libxslt.1.dylib |
This file contains 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
# Install Ruby 1.9.2 on OS 10.6 | |
# Uses RVM and homebrew | |
# Install RVM (if you haven't already) | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
# Install homebrew (if you haven't already) | |
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)" | |
# If you already had rvm installed (older versions only) |
NewerOlder