Skip to content

Commit

Permalink
cleanup rubygems for ruby 2.0 and newer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjelinek committed Feb 26, 2018
1 parent 3ef9c8f commit 67675f3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 25 deletions.
7 changes: 1 addition & 6 deletions pcsd/Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
source 'https://rubygems.org'

source 'https://tojeline.fedorapeople.org/rubygems/' do
gem 'rpam-ruby19-feist', :platform => :ruby_18
end

gem 'sinatra'
gem 'sinatra-contrib'
gem 'rack'
gem 'rack-protection'
gem 'tilt'
gem 'rack-test'
gem 'backports'
gem 'rpam-ruby19', :platform => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
gem 'rpam-ruby19'
gem 'json'
gem 'multi_json'
gem 'open4'
gem 'orderedhash'
gem 'ffi'
gem 'ethon'
3 changes: 0 additions & 3 deletions pcsd/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
GEM
remote: https://rubygems.org/
remote: https://tojeline.fedorapeople.org/rubygems/
specs:
backports (3.9.1)
ethon (0.10.1)
ffi (1.9.18)
json (2.1.0)
multi_json (1.12.2)
open4 (1.3.4)
orderedhash (0.0.6)
rack (1.6.4)
rack-protection (1.5.3)
rack
Expand Down Expand Up @@ -38,7 +36,6 @@ DEPENDENCIES
json
multi_json
open4
orderedhash
rack
rack-protection
rack-test
Expand Down
7 changes: 2 additions & 5 deletions pcsd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ build_gems: get_gems
fi; \
done;

# RHEL6 needs special rpam-ruby19 gem to work with 1.8.7
# also bundler is not available on RHEL6 in rpm
build_gems_rhel6:
build_gems_without_bundler:
mkdir -p vendor/bundle/ruby
gem install --verbose --no-rdoc --no-ri -l -i vendor/bundle/ruby \
vendor/cache/backports-3.6.8.gem \
Expand All @@ -23,11 +21,10 @@ build_gems_rhel6:
vendor/cache/json-2.0.3.gem \
vendor/cache/multi_json-1.12.1.gem \
vendor/cache/open4-1.3.4.gem \
vendor/cache/orderedhash-0.0.6.gem \
vendor/cache/rack-1.6.4.gem \
vendor/cache/rack-protection-1.5.3.gem \
vendor/cache/rack-test-0.6.3.gem \
vendor/cache/rpam-ruby19-feist-1.2.1.1.gem \
vendor/cache/rpam-ruby19-1.2.1.gem \
vendor/cache/sinatra-1.4.8.gem \
vendor/cache/sinatra-contrib-1.4.7.gem \
vendor/cache/tilt-2.0.6.gem \
Expand Down
11 changes: 5 additions & 6 deletions pcsd/config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'json'
require 'orderedhash'

require 'cluster.rb'
require 'permissions.rb'
Expand Down Expand Up @@ -124,15 +123,15 @@ def update_cluster(cluster_name, node_list)
end

def text()
out_hash = OrderedHash.new
out_hash = Hash.new
out_hash['format_version'] = CURRENT_FORMAT
out_hash['data_version'] = @data_version
out_hash['clusters'] = []
out_hash['permissions'] = OrderedHash.new
out_hash['permissions'] = Hash.new
out_hash['permissions']['local_cluster'] = []

@clusters.each { |c|
c_hash = OrderedHash.new
c_hash = Hash.new
c_hash['name'] = c.name
c_hash['nodes'] = c.nodes.uniq.sort
out_hash['clusters'] << c_hash
Expand Down Expand Up @@ -182,7 +181,7 @@ def cluster_nodes_equal?(cluster_name, nodes)
end

def hash_to_ordered_hash(hash)
new_hash = OrderedHash.new
new_hash = Hash.new
hash.keys.sort.each { |key| new_hash[key] = hash[key] }
return new_hash
end
Expand Down Expand Up @@ -235,7 +234,7 @@ def initialize(cfg_text)
end

def text()
out_hash = OrderedHash.new
out_hash = Hash.new
out_hash['format_version'] = CURRENT_FORMAT
out_hash['data_version'] = @data_version
out_hash['tokens'] = hash_to_ordered_hash(@tokens)
Expand Down
3 changes: 1 addition & 2 deletions pcsd/pcsd-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
require 'etc'
require 'json'
require 'stringio'
require 'orderedhash'

require 'bootstrap.rb'
require 'pcs.rb'
require 'auth.rb'
require 'remote.rb'

def cli_format_response(status, text=nil, data=nil)
response = OrderedHash.new
response = Hash.new
response['status'] = status
response['text'] = text if text
response['data'] = data if data
Expand Down
4 changes: 1 addition & 3 deletions pcsd/permissions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'orderedhash'

module Permissions

TYPE_USER = 'user'
Expand Down Expand Up @@ -104,7 +102,7 @@ def merge!(other)
end

def to_hash()
perm_hash = OrderedHash.new
perm_hash = Hash.new
perm_hash['type'] = @type
perm_hash['name'] = @name
perm_hash['allow'] = @allow_list.uniq.sort
Expand Down

0 comments on commit 67675f3

Please sign in to comment.