diff --git a/Gemfile b/Gemfile index 27532fa..37c3972 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,12 @@ group :test do gem 'smart_proxy', :git => "https://github.com/theforeman/smart-proxy", :branch => "develop" end +if RUBY_VERSION < "2.0" + gem 'json', '< 2.0.0' + gem 'rest-client', '< 1.7' + gem 'mime-types', '~> 1.0' +end + # load bundler.d Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle| self.instance_eval(Bundler.read_file(bundle)) diff --git a/lib/smart_proxy_dynflow/plugin.rb b/lib/smart_proxy_dynflow/plugin.rb index c3f374d..64890d3 100644 --- a/lib/smart_proxy_dynflow/plugin.rb +++ b/lib/smart_proxy_dynflow/plugin.rb @@ -14,6 +14,7 @@ class Plugin < Proxy::Plugin https_rackup_path File.expand_path(rackup_path, File.expand_path("../", __FILE__)) settings_file "dynflow.yml" + requires :foreman_proxy, ">= 1.12.0" default_settings :core_url => 'http://localhost:8008' plugin :dynflow, Proxy::Dynflow::VERSION end diff --git a/lib/smart_proxy_dynflow_core/settings.rb b/lib/smart_proxy_dynflow_core/settings.rb index 32b34a6..c028a31 100644 --- a/lib/smart_proxy_dynflow_core/settings.rb +++ b/lib/smart_proxy_dynflow_core/settings.rb @@ -69,12 +69,12 @@ def self.loaded! Log.reload! end - def self.load_from_proxy(plugin) + def self.load_from_proxy(settings) PROXY_SETTINGS.each do |key| SETTINGS[key] = Proxy::SETTINGS[key] end PLUGIN_SETTINGS.each do |key| - SETTINGS[key] = plugin.settings[key] + SETTINGS[key] = settings[key] end SETTINGS.plugins.values.each { |plugin| plugin.load_settings_from_proxy } Settings.loaded!