mumukit-service 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6bf6480ae3161541ab76818bf3c371d8a33dc58
4
- data.tar.gz: 39cf1dbfa393b16978ce16930d00a231504681cf
3
+ metadata.gz: c4d739b198a8e915f59970d7b6f175a16f7d0da2
4
+ data.tar.gz: 68ba28f1f312a29f3711c9400d7a4133738c56e1
5
5
  SHA512:
6
- metadata.gz: b52f5934b147ad57acd5b5132d35d9470f33c4fff2c90b35aae5316fa230851a3203af658e95a43bf834a26deb7348ffb7dca4f781ac2a7e82c7647bfde1f639
7
- data.tar.gz: fc9870456f43db6a7e9a37f20acb7d746d7137f8aa072f376b1ff601dcd542c7b8357ee41f737124214bf977a266d8e3797c71f3bab281025553d262b102d896
6
+ metadata.gz: 5dc288ba551ff95fc1355fc0678d96448e7b35d02e5f077f726751fee659ced0cb716f69476155e2aff9c0ca518f9c884abf221ef939c85c96b829d7ffc2efb5
7
+ data.tar.gz: 8cc21f96d86580afc5ba48f938e7662fe48d74493ab23a62f46d7e71b932ce884ac8b14eb40b16f593c592c48938c4855a7018b7608b8394f9b1121aecf69b28
@@ -57,7 +57,7 @@ module Mumukit::Service
57
57
  document.validate!
58
58
 
59
59
  with_id(id_for_query(query) || new_id) do |id|
60
- mongo_collection.update_one(query, document.raw.merge(id), {upsert: true})
60
+ upsert_attributes!(query, document.raw.merge(id))
61
61
  end
62
62
  end
63
63
 
@@ -49,7 +49,16 @@ end
49
49
 
50
50
  after do
51
51
  error_message = env['sinatra.error']
52
- if error_message.blank?
52
+ if response.body.is_a?(Array)&& response.body[0].is_a?(String)
53
+ content_type 'text/html'
54
+ response.body = <<HTML
55
+ <html>
56
+ <body>
57
+ #{response.body[0]}
58
+ </body>
59
+ </html>
60
+ HTML
61
+ elsif error_message.blank?
53
62
  response.body = response.body.to_json
54
63
  else
55
64
  response.body = {message: env['sinatra.error'].message}.to_json
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Service
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-09 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler