1 Description: Replace orderedhash gem with active_support
2 Gem orderedhash <https://rubygems.org/gems/orderedhash/>
4 * not packaged in Debian (so not used by some other software)
5 * does not look maintained (last version 0.0.6 is from 2008)
6 * no license file included (just one mention of public domain
9 On the other hand, replacement active_support gem is rather
10 popular (albeit somewhat big) and does not experience any of
12 Author: Valentin Vidic <Valentin.Vidic@CARNet.hr>
13 Last-Update: 2017-06-17
15 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
20 -require 'orderedhash'
21 +require 'active_support/ordered_hash'
24 require 'permissions.rb'
29 - out_hash = OrderedHash.new
30 + out_hash = ActiveSupport::OrderedHash.new
31 out_hash['format_version'] = CURRENT_FORMAT
32 out_hash['data_version'] = @data_version
33 out_hash['clusters'] = []
34 - out_hash['permissions'] = OrderedHash.new
35 + out_hash['permissions'] = ActiveSupport::OrderedHash.new
36 out_hash['permissions']['local_cluster'] = []
39 - c_hash = OrderedHash.new
40 + c_hash = ActiveSupport::OrderedHash.new
41 c_hash['name'] = c.name
42 c_hash['nodes'] = c.nodes.uniq.sort
43 out_hash['clusters'] << c_hash
48 - tokens_hash = OrderedHash.new
49 + tokens_hash = ActiveSupport::OrderedHash.new
50 @tokens.keys.sort.each { |key| tokens_hash[key] = @tokens[key] }
52 - out_hash = OrderedHash.new
53 + out_hash = ActiveSupport::OrderedHash.new
54 out_hash['format_version'] = CURRENT_FORMAT
55 out_hash['data_version'] = @data_version
56 out_hash['tokens'] = tokens_hash
57 --- a/pcsd/pcsd-cli.rb
58 +++ b/pcsd/pcsd-cli.rb
63 -require 'orderedhash'
64 +require 'active_support/ordered_hash'
66 require 'bootstrap.rb'
70 def cli_format_response(status, text=nil, data=nil)
71 - response = OrderedHash.new
72 + response = ActiveSupport::OrderedHash.new
73 response['status'] = status
74 response['text'] = text if text
75 response['data'] = data if data
76 --- a/pcsd/permissions.rb
77 +++ b/pcsd/permissions.rb
79 -require 'orderedhash'
80 +require 'active_support/ordered_hash'
88 - perm_hash = OrderedHash.new
89 + perm_hash = ActiveSupport::OrderedHash.new
90 perm_hash['type'] = @type
91 perm_hash['name'] = @name
92 perm_hash['allow'] = @allow_list.uniq.sort