chef-zero 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b00232a363d25d0bd7a96ce90fe890da73e828c
4
- data.tar.gz: 588b5fcd98c7df1f73df1a3c8e9b881bd992bfa1
3
+ metadata.gz: cdca57f2c1f1b6b83c281e4b47b8ddd84fca03eb
4
+ data.tar.gz: cfb147366f9d3a05f26855fcb6e33335f484c4e0
5
5
  SHA512:
6
- metadata.gz: 9563e75f68e99b6d113778834468f4c5bd40a705fccfc6007432a0c390d9494d8669b245f12f04aae0d250d01551f27c67bc9c4c4075846076cd0835e5c8c45a
7
- data.tar.gz: 6c669dac6b41d749bd5a99e515caf6cc95099925e890ceff4b98ade5a0b3db8e09dee999d54324789caafc9b88b6d67d509ca95753cb963ee01d065cee727d03
6
+ metadata.gz: 12c4155f7402cdda0364fbb0b09e52249419f50eadd70536089168e05379579e0ab5f40384c4a917ee9b53c10efcad49f1035b36263e05202dcc341e7ae23d40
7
+ data.tar.gz: 2ea8061572057a986dc50064a4e81cbcd673e1a7042028f7eda72650a97d6f5d2807f1e85cb3055a4a85af5a0f30123e7c2da3f5d87a54c234bb1d854f5e03b5
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec
3
3
 
4
- # gem 'rest-client', :github => 'chef/rest-client'
4
+ # gem 'rest-client', :git => 'https://github.com/chef/rest-client.git'
5
5
 
6
- gem "oc-chef-pedant", :github => "chef/chef-server"
6
+ gem "oc-chef-pedant", :git => "https://github.com/chef/chef-server.git"
7
7
 
8
8
  group :changelog do
9
9
  gem "github_changelog_generator"
@@ -13,10 +13,7 @@ group :development, :test do
13
13
  gem "chefstyle", "= 0.3.1"
14
14
  end
15
15
 
16
- # bundler resolve failure on "rspec_junit_formatter"
17
- # gem 'chef-pedant', :github => 'opscode/chef-pedant', :ref => "server-cli-option"
18
-
19
- gem "chef", github: "chef/chef" # until chef 12.15 is released
16
+ gem "chef"
20
17
 
21
18
  if ENV["GEMFILE_MOD"]
22
19
  puts "GEMFILE_MOD: #{ENV['GEMFILE_MOD']}"
data/README.md CHANGED
@@ -145,6 +145,10 @@ Usage: chef-zero [ARGS]
145
145
  --version Show version
146
146
  ```
147
147
 
148
+ ## Contributing
149
+
150
+ For information on contributing to this project see <https://github.com/chef/chef/blob/master/CONTRIBUTING.md>
151
+
148
152
  ## License
149
153
 
150
154
  Copyright 2012-2016, Chef Software, Inc.
@@ -221,7 +221,7 @@ module ChefZero
221
221
  end
222
222
 
223
223
  def self.normalize_run_list(run_list)
224
- run_list.map {|item|
224
+ run_list.map do |item|
225
225
  case item
226
226
  when /^recipe\[.*\]$/
227
227
  item # explicit recipe
@@ -230,7 +230,7 @@ module ChefZero
230
230
  else
231
231
  "recipe[#{item}]"
232
232
  end
233
- }.uniq
233
+ end.uniq
234
234
  end
235
235
  end
236
236
  end
@@ -12,7 +12,9 @@ module ChefZero
12
12
  def get(request)
13
13
  orgname = request.rest_path[1]
14
14
  results = search(request, orgname)
15
+
15
16
  results["rows"] = results["rows"].map { |name, uri, value, search_value| value }
17
+
16
18
  json_response(200, results)
17
19
  rescue ChefZero::Solr::ParseError
18
20
  bad_search_request(request)
@@ -112,10 +114,8 @@ module ChefZero
112
114
  query_string = request.query_params["q"] || "*:*"
113
115
  solr_query = ChefZero::Solr::SolrParser.new(query_string).parse
114
116
  sort_string = request.query_params["sort"]
115
- start = request.query_params["start"]
116
- start = start.to_i if start
117
- rows = request.query_params["rows"]
118
- rows = rows.to_i if rows
117
+ start = request.query_params["start"].to_i
118
+ rows = request.query_params["rows"].to_i
119
119
 
120
120
  # Get the search container
121
121
  container, expander = search_container(request, index, orgname)
@@ -139,13 +139,18 @@ module ChefZero
139
139
  result = result.reverse if sort_order == "DESC"
140
140
  end
141
141
 
142
- # Paginate
143
- if start
144
- result = result[start..start + (rows || -1)]
145
- end
146
142
  {
147
- "rows" => result,
148
- "start" => start || 0,
143
+ # Paginate
144
+ #
145
+ # Slice the array based on the value of the "rows" query parameter. If
146
+ # this is a positive integer, we'll get the number of rows asked for.
147
+ # If it's nil, we'll get -1, which gives us all of the elements.
148
+ #
149
+ # Do the same for "start", which will start at 0 if that value is not
150
+ # given.
151
+ "rows" => result[start..(rows - 1)],
152
+ # Also return start and total in the object
153
+ "start" => start,
149
154
  "total" => total,
150
155
  }
151
156
  end
@@ -200,7 +205,6 @@ module ChefZero
200
205
  end
201
206
  dest
202
207
  end # deep_merge!
203
-
204
208
  end
205
209
  end
206
210
  end
@@ -60,13 +60,13 @@ module ChefZero
60
60
  end
61
61
 
62
62
  def log_response(response)
63
- ChefZero::Log.debug {
63
+ ChefZero::Log.debug do
64
64
  [ "",
65
65
  "--- RESPONSE (#{response[0]}) ---",
66
66
  response[2].chomp,
67
67
  "--- END RESPONSE ---",
68
68
  ].join("\n")
69
- }
69
+ end
70
70
  end
71
71
  end
72
72
  end
@@ -48,13 +48,13 @@ module ChefZero
48
48
 
49
49
  # Take the passed-in options
50
50
 
51
- define_singleton_method(:chef_server_options) {
51
+ define_singleton_method(:chef_server_options) do
52
52
  @chef_server_options ||= begin
53
53
  _chef_server_options = { port: 8900, signals: false, log_requests: true }
54
54
  _chef_server_options = _chef_server_options.merge(tags.last) if tags.last.is_a?(Hash)
55
55
  _chef_server_options = _chef_server_options.freeze
56
56
  end
57
- }
57
+ end
58
58
 
59
59
  # Merge in chef_server_options from let(:chef_server_options)
60
60
  def chef_server_options
@@ -287,9 +287,9 @@ module ChefZero
287
287
  :SSLEnable => options[:ssl],
288
288
  :SSLOptions => ssl_opts,
289
289
  :SSLCertName => [ [ "CN", WEBrick::Utils.getservername ] ],
290
- :StartCallback => proc {
290
+ :StartCallback => proc do
291
291
  @running = true
292
- }
292
+ end
293
293
  )
294
294
  ENV["HTTPS"] = "on" if options[:ssl]
295
295
  @server.mount("/", Rack::Handler::WEBrick, app)
@@ -320,9 +320,7 @@ module ChefZero
320
320
  end
321
321
 
322
322
  # Do not return until the web server is genuinely started.
323
- while !@running && @thread.alive?
324
- sleep(0.01)
325
- end
323
+ sleep(0.01) while !@running && @thread.alive?
326
324
 
327
325
  SocketlessServerMap.instance.register_port(@port, self)
328
326
 
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = "5.1.0"
2
+ VERSION = "5.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-07 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  version: '0'
303
303
  requirements: []
304
304
  rubyforge_project:
305
- rubygems_version: 2.6.6
305
+ rubygems_version: 2.6.8
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing