chef-server-api 0.9.14.beta.1 → 0.9.14.rc.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.
@@ -22,7 +22,7 @@
22
22
  require "chef/mixin/checksum"
23
23
  require "chef/cookbook_loader"
24
24
  require "mixlib/authentication/signatureverification"
25
- require "chef/json"
25
+ require 'chef/json_compat'
26
26
 
27
27
  class Application < Merb::Controller
28
28
 
@@ -119,13 +119,18 @@ class Application < Merb::Controller
119
119
  available_recipes
120
120
  end
121
121
 
122
- # Use Chef's JSON conversion library for sending JSON instead of the
123
- # default Merb, which calls obj.to_json. Fixes CHEF-1292/PL-538.
122
+ # Fix CHEF-1292/PL-538; cause Merb to pass the max nesting constant into
123
+ # obj.to_json, which it calls by default based on the original request's
124
+ # accept headers and the type passed into Merb::Controller.display
125
+ #--
126
+ # TODO: tim, 2010-11-24: would be nice to instead have Merb call
127
+ # Chef::JSONCompat.to_json, instead of obj.to_json, but changing that
128
+ # behavior is convoluted in Merb. This override is assuming that
129
+ # Merb is eventually calling obj.to_json, which takes the :max_nesting
130
+ # option.
124
131
  override! :display
125
132
  def display(obj)
126
- super(obj, nil, {:max_nesting => Chef::JSON::JSON_MAX_NESTING})
127
- #super.display(Chef::JSON.to_json(obj))
128
- #Chef::JSON.to_json(obj)
133
+ super(obj, nil, {:max_nesting => Chef::JSONCompat::JSON_MAX_NESTING})
129
134
  end
130
135
 
131
136
  end
data/config/init.rb CHANGED
@@ -38,6 +38,7 @@ require 'chef/data_bag_item'
38
38
  require 'chef/cookbook_version'
39
39
  require 'chef/sandbox'
40
40
  require 'chef/checksum'
41
+ require 'chef/monkey_patches/regexp'
41
42
 
42
43
  require 'mixlib/authentication'
43
44
 
data/config/router.rb CHANGED
@@ -122,7 +122,7 @@ Merb::Router.prepare do
122
122
  begin
123
123
  # Call Chef's JSON utility instead of the default in Merb,
124
124
  # JSON.parse.
125
- jobj = Chef::JSON.from_json(raw_post)
125
+ jobj = Chef::JSONCompat.from_json(raw_post)
126
126
  jobj = jobj.to_mash if jobj.is_a?(Hash)
127
127
  rescue JSON::ParserError
128
128
  jobj = Mash.new
@@ -1,3 +1,3 @@
1
1
  module ChefServerApi
2
- VERSION = '0.9.14.beta.1'
2
+ VERSION = '0.9.14.rc.1'
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-server-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196289
4
+ hash: 15424247
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 14
10
- - beta
10
+ - rc
11
11
  - 1
12
- version: 0.9.14.beta.1
12
+ version: 0.9.14.rc.1
13
13
  platform: ruby
14
14
  authors:
15
15
  - Opscode
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-02-09 00:00:00 -08:00
20
+ date: 2011-02-25 00:00:00 -08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency