From 2a12ea839ee255fa8e49176e27ad1e5c026137b5 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Sat, 23 Aug 2014 17:50:25 -0500 Subject: [PATCH] Fixed incompatiblity with Couchie.Transcoder and Jazz. --- README.md | 46 +++++++++++++--------------------------------- lib/transcoder.ex | 3 ++- mix.exs | 4 +--- mix.lock | 2 +- 4 files changed, 17 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 3ec1cfa..77ff24f 100644 --- a/README.md +++ b/README.md @@ -17,50 +17,30 @@ Note: to build, you need to have libcouchbase installed. brew install libcouchbase ### Example -(this is a bit obsolete) + +``` $ iex -S mix Erlang R16B (erts-5.10.1) [source-05f1189] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] Interactive Elixir (0.8.1) - press Ctrl+C to exit (type h() ENTER for help) - iex(1)> Couchie.open(:default) - {:ok,#PID<0.63.0>} - iex(2)> Couchie.set(:default, "3-18-13-6-57", "value") - :ok - iex(3)> Couchie.get(:default, "3-18-13-6-57") - {"3-18-13-6-57",16538602597327634432,"value"} - iex(5)> Couchie.set(:default, "3-18-13-7-07", [:a, :b, :c]) - :ok - iex(6)> Couchie.get(:default, "3-18-13-7-07") - {"3-18-13-7-07",11380463241031450624,["a","b","c"]} - iex(7)> Couchie.open(:cache, 10, 'localhost:8091', 'cache', 'cache') - {:ok,#PID<0.77.0>} - iex(8)> Couchie.set(:cache, "3-18-13-7-11", "test value") - :ok - iex(9)> Couchie.set(:cache, "3-18-13-7-12", ["a", 'b'], 10) - :ok - # more than ten seconds later... - iex(10)> Couchie.get(:cache, "3-18-13-7-12") - {"3-18-13-7-12",{:error,:key_enoent}} #key has expired from memcached bucket. - iex(11)> Couchie.get(:cache, "3-18-13-7-11") - {"3-18-13-7-11",72057594037927936,"test value"} - iex(12)> Couchie.set(:cache, "3-18-13-7-12", ["a", 'b'], 100) + iex(1)> Couchie.open(:d) + Opening d, 10, localhost:8091 + Opening d, 10, localhost:8091, , , + Opened d, 10, localhost:8091 :ok - iex(13)> Couchie.get(:cache, "3-18-13-7-12") - {"3-18-13-7-12",216172782113783808,["a",'b']} - # Storing data structures, like a HashDict - iex(14)> bar = HashDict.new - #HashDict<[]> - iex(15)> bar = bar |> HashDict.put("key", "value") - #HashDict<[{"key", "value"}]> - iex(16)> Couchie.set(:default, "bar", bar) + iex(2)> Couchie.set(:d, "foo", %{foo: "bar"}) :ok - iex(17)> Couchie.get(:default, "bar") - {"bar", 983466356890402816, #HashDict<[{"key", "value"}]>} + iex(3)> Couchie.get(:d, "foo") + {"foo", 10812679138524069888, %{foo: "bar"}} + iex(4)> +``` ## Simple support for cberl views" +``` Couchie.open(:beer, 10, 'cb.server.w.beer.sample:8091', 'beer-sample', 'beer-sample', '') Couchie.query(:beer, 'beer', 'brewery_beers', [{:limit, 10}]) +``` ##Current functionality - Basic commands: Set, Get, MGet, Delete diff --git a/lib/transcoder.ex b/lib/transcoder.ex index 0359a47..ef42ff0 100644 --- a/lib/transcoder.ex +++ b/lib/transcoder.ex @@ -1,6 +1,7 @@ defmodule Couchie.Transcoder do require Bitwise - + use Jazz + @cbe_json 0x02 @cbe_raw 0x04 @cbe_str 0x08 diff --git a/mix.exs b/mix.exs index 6b9f61a..b15befb 100644 --- a/mix.exs +++ b/mix.exs @@ -9,11 +9,10 @@ defmodule Couchie.Mixfile do @doc "Project Details" def project do [ app: :couchie, - version: "0.0.1", + version: "0.0.6", deps: deps ] end - @doc "Configuration for the OTP application" def application do [ applications: [:cberl] #, :ibrowse @@ -25,7 +24,6 @@ defmodule Couchie.Mixfile do defp deps do [ {:cberl, github: "chitika/cberl"}, #chitika is authoritative source - #{:jazz, github: "devinus/jazz", branch: "0.13"} {:jazz, github: "meh/jazz"} ] end diff --git a/mix.lock b/mix.lock index 4440ecb..e6322b5 100644 --- a/mix.lock +++ b/mix.lock @@ -1,4 +1,4 @@ %{"cberl": {:git, "git://github.com/chitika/cberl.git", "00c4a4b2b9a7f5054f69303b0be64a5266e8de3a", []}, "jazz": {:git, "git://github.com/meh/jazz.git", "e0cf73011f64868534cd229c458e205ce04a6619", []}, - "jiffy": {:git, "https://github.com/davisp/jiffy.git", "2dbf89f51c547914e994f51457140df9e9a1ca83", [branch: "master"]}, + "jiffy": {:git, "https://github.com/davisp/jiffy.git", "5cd89c1eda3801bdef790b1e7c0e09259332c0fc", [branch: "master"]}, "poolboy": {:git, "https://github.com/devinus/poolboy.git", "17d1582533af5c076117e2e1270f4b43faa02f12", [branch: "master"]}}