Skip to content

Commit

Permalink
install bundler version 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
thilo committed Jan 21, 2016
1 parent 0068f94 commit 93dd7f6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ gemfile:
- gemfiles/active_support_4_0
- gemfiles/active_support_4_1
- gemfiles/active_support_4_2
before_install:
gem install bundler --version 1.11.2
before_script:
- sudo sh -c 'echo "[native_query_servers]" >> /etc/couchdb/local.ini'
- sudo sh -c 'echo "erlang = {couch_native_process, start_link, []}" >> /etc/couchdb/local.ini'
Expand Down
3 changes: 2 additions & 1 deletion couch_potato.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Gem::Specification.new do |s|
s.version = CouchPotato::VERSION
s.platform = Gem::Platform::RUBY

s.add_dependency 'json', '~> 1.6'
s.add_dependency 'oj'
s.add_dependency 'oj_mimic_json'
s.add_dependency 'couchrest', '~>2.0.0.rc3'
s.add_dependency 'activemodel', '~> 4.0'

Expand Down
4 changes: 2 additions & 2 deletions lib/couch_potato.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'couchrest'
require 'json'
require 'oj'

require 'ostruct'

JSON.create_id = 'ruby_class'
Oj.default_options = {mode: :compat}
CouchRest.decode_json_objects = true

module CouchPotato
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/model_view_spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
describe CouchPotato::View::ModelViewSpec, '#map_function' do
it "should include conditions" do
spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {:conditions => 'doc.closed = true'}, {}
expect(spec.map_function).to include('if(doc.ruby_class && doc.ruby_class == \'Object\' && (doc.closed = true))')
expect(spec.map_function).to include('if(doc.json_class && doc.json_class == \'Object\' && (doc.closed = true))')
end

it 'generates an erlang map function with a single key if the language is erlang' do
spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {:key => :name, :language => :erlang}, {}
expect(spec.map_function).to eql_ignoring_indentation(<<-ERL
fun({Doc}) ->
case proplists:get_value(<<"ruby_class">>, Doc) of
case proplists:get_value(<<"json_class">>, Doc) of
<<"Object">> ->
Key = proplists:get_value(<<"name">>, Doc, null),
Emit(Key, 1);
Expand All @@ -49,7 +49,7 @@
spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {:key => [:code, :name], :language => :erlang}, {}
expect(spec.map_function).to eql_ignoring_indentation(<<-ERL
fun({Doc}) ->
case proplists:get_value(<<"ruby_class">>, Doc) of
case proplists:get_value(<<"json_class">>, Doc) of
<<"Object">> ->
Key_0 = proplists:get_value(<<"code">>, Doc, null),
Key_1 = proplists:get_value(<<"name">>, Doc, null),
Expand Down Expand Up @@ -78,7 +78,7 @@

it "should not include conditions when they are nil" do
spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {}, {}
expect(spec.map_function).to include('if(doc.ruby_class && doc.ruby_class == \'Object\')')
expect(spec.map_function).to include('if(doc.json_class && doc.json_class == \'Object\')')
end

it "should have a custom emit value when specified as symbol" do
Expand Down
2 changes: 1 addition & 1 deletion spec/views_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ErlangBuild
end

it 'does not crash couchdb when a document does not have the key' do
build = {'ruby_class' => 'ErlangBuild'}
build = {'json_class' => 'ErlangBuild'}
@db.couchrest_database.save_doc build

results = @db.view(ErlangBuild.by_name(:key => nil))
Expand Down

0 comments on commit 93dd7f6

Please sign in to comment.