smart_proxy_dynflow 0.2.2 → 0.2.3

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
- SHA1:
3
- metadata.gz: 23e6132a792409de0a63851c335a1cbbbbe6c539
4
- data.tar.gz: d9eeb7b70c68915fc84b36008e043942cbbcddd9
2
+ SHA256:
3
+ metadata.gz: 0e7c4b7a5345d0fea21625215d19a42ec7a541c5978d2291a2fb8e8cb7ecc378
4
+ data.tar.gz: c7b4448023317d8c5e72afc6ea835ca2bf40bceec8a2ab30f426a2f7c990be7a
5
5
  SHA512:
6
- metadata.gz: 38be1713aabfeea11b229752bd65fe925b30bf05f1bf15a9105bc70066f3181bdedef45a966c377874efae42e8fa01abb2aefcc1c6caa93b1ba00ca6365bccca
7
- data.tar.gz: 740e626094df5c0f64580bb94159a03dc1b075409f5b602be0dd8ed1490c6a3efe9e79b439c497056bfc4a6ba3998137a7d7edaf8d54a830126e20fd917f01ae
6
+ metadata.gz: 0e86febbe3ca408556048ec71330272836f04425ef3c45bc619bb0dd9f53403af23d6b653d3d0f6e84237e6068e7ddc9fe3231e33923ea77dff639d017aa7966
7
+ data.tar.gz: c73d982c4ec17251509b5ec1aa967893597a391bc529b09f2aaec3d2736c213e69706d1f64a7bfc23e7faf4dfe72bf0a06ad1c833ca6d47ec9748b4e29e86d13
data/Gemfile CHANGED
@@ -13,7 +13,6 @@ group :test do
13
13
  if RUBY_VERSION < '2.1'
14
14
  gem 'public_suffix', '< 3'
15
15
  gem 'rainbow', '< 3'
16
- gem 'rubocop', '< 0.51.0'
17
16
  else
18
17
  gem 'public_suffix'
19
18
  gem 'rubocop', '~> 0.52.1'
@@ -1,7 +1,21 @@
1
- require 'smart_proxy_dynflow/api'
1
+ # Internal core will be used if external core is either disabled or unset
2
+ # and the core gem can be loaded
2
3
 
3
- map "/dynflow" do
4
- map '/' do
5
- run Proxy::Dynflow::Api
4
+ if !::Proxy::Dynflow::Plugin.settings.external_core && Proxy::Dynflow::Plugin.internal_core_available?
5
+ require 'smart_proxy_dynflow_core/api'
6
+ require 'smart_proxy_dynflow_core/launcher'
7
+
8
+ SmartProxyDynflowCore::Settings.load_from_proxy(p)
9
+
10
+ map "/dynflow" do
11
+ SmartProxyDynflowCore::Launcher.route_mapping(self)
12
+ end
13
+ else
14
+ require 'smart_proxy_dynflow/api'
15
+
16
+ map "/dynflow" do
17
+ map '/' do
18
+ run Proxy::Dynflow::Api
19
+ end
6
20
  end
7
21
  end
@@ -4,29 +4,28 @@ require 'proxy/plugin'
4
4
 
5
5
  class Proxy::Dynflow
6
6
  class Plugin < Proxy::Plugin
7
- rackup_path = begin
8
- require 'smart_proxy_dynflow_core'
9
- 'http_config_with_executor.ru'
10
- rescue LoadError
11
- 'http_config.ru'
12
- end
13
- http_rackup_path File.expand_path(rackup_path, File.expand_path("../", __FILE__))
14
- https_rackup_path File.expand_path(rackup_path, File.expand_path("../", __FILE__))
7
+ rackup_path = File.expand_path('http_config.ru', __dir__)
8
+ http_rackup_path rackup_path
9
+ https_rackup_path rackup_path
15
10
 
16
11
  settings_file "dynflow.yml"
17
12
  requires :foreman_proxy, ">= 1.12.0"
18
13
  default_settings :core_url => 'http://localhost:8008'
19
14
  plugin :dynflow, Proxy::Dynflow::VERSION
20
15
 
21
- # rubocop:disable Lint/HandleExceptions
22
16
  after_activation do
23
- begin
24
- require 'smart_proxy_dynflow_core'
25
- rescue LoadError
26
- # Dynflow core is not available in the proxy, will be handled
27
- # by standalone Dynflow core
17
+ # Ensure the core gem is loaded, if configure NOT to use the external core
18
+ if Proxy::Dynflow::Plugin.settings.external_core == false && !internal_core_available?
19
+ raise "'smart_proxy_dynflow_core' gem is required, but not available"
28
20
  end
29
21
  end
30
- # rubocop:enable Lint/HandleExceptions
22
+
23
+ def self.internal_core_available?
24
+ @core_available ||= begin
25
+ require 'smart_proxy_dynflow_core'
26
+ true
27
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
28
+ end
29
+ end
31
30
  end
32
31
  end
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  class Dynflow
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.2.3'.freeze
4
4
  end
5
5
  end
@@ -2,3 +2,8 @@
2
2
  :enabled: true
3
3
  :database: /var/lib/foreman-proxy/dynflow/dynflow.sqlite
4
4
  :core_url: 'http://127.0.0.1:8008'
5
+
6
+ # If true, external core will be used even if the core gem is available
7
+ # If false, the feature will be disabled if the core gem is not available
8
+ # If unset, the process will fallback to external core if the core gem is not available
9
+ # :external_core: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,7 +109,6 @@ files:
109
109
  - lib/smart_proxy_dynflow/callback.rb
110
110
  - lib/smart_proxy_dynflow/helpers.rb
111
111
  - lib/smart_proxy_dynflow/http_config.ru
112
- - lib/smart_proxy_dynflow/http_config_with_executor.ru
113
112
  - lib/smart_proxy_dynflow/plugin.rb
114
113
  - lib/smart_proxy_dynflow/proxy_adapter.rb
115
114
  - lib/smart_proxy_dynflow/version.rb
@@ -134,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
133
  version: '0'
135
134
  requirements: []
136
135
  rubyforge_project:
137
- rubygems_version: 2.6.12
136
+ rubygems_version: 2.7.6
138
137
  signing_key:
139
138
  specification_version: 4
140
139
  summary: Dynflow runtime for Foreman smart proxy
@@ -1,8 +0,0 @@
1
- require 'smart_proxy_dynflow_core/api'
2
- require 'smart_proxy_dynflow_core/launcher'
3
-
4
- SmartProxyDynflowCore::Settings.load_from_proxy(p)
5
-
6
- map "/dynflow" do
7
- SmartProxyDynflowCore::Launcher.route_mapping(self)
8
- end