avm-tools 0.63.0 → 0.64.0

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
  SHA256:
3
- metadata.gz: 855b0d8610e334378c5f061444ae6c414739fa383b9d09d64229ef8014feba53
4
- data.tar.gz: '09008022bebd8de5a6c3104406c7b5f415f94b1c0f2d84700e92a2b29d4fa530'
3
+ metadata.gz: 1565797abcceccaa3a466abb16694b514ae9773b151142ad27628a0d344a6c2b
4
+ data.tar.gz: a2756806ed389c2d141a9d038cdb6a55aaa28c9747768cac97bb32ca27b49962
5
5
  SHA512:
6
- metadata.gz: c4f2e3cb91702b6b93963c1478c38498c0774617538b75a8401ce96b00b505156aeb5d6554c595d5837c678a6f245b86352a57f86056c6599a40f5fbefae3cd7
7
- data.tar.gz: a577468f0221af04fb6fc08a5f6ada465dc9e64228b4be577ac0b6cbdaed4cd995108ca0f88f713226cadacf4152b1243b18986f3d9212d20742b75a84e651ff
6
+ metadata.gz: 5d895b6ceef334e3b439291f2c2eed9477cc738864fede0f4426d0f7040768febf4759b3cc2267fa0ee34eb18301e8c0066e29b5c1a02b952fcacd7f711c91bd
7
+ data.tar.gz: 812e64910a913c855562bcea3f61aabf441cfafbd7a0af8e356dc217f66451f12361d30507343dbab2b56898313d319880d51bf59893ca11cab6c1d29ed90682
@@ -80,6 +80,7 @@ module Avm
80
80
 
81
81
  def publish?(stereotype)
82
82
  return false unless stereotype.publish_class
83
+ return false unless options.stereotype_publishable?(stereotype)
83
84
 
84
85
  filter = ::EacLauncher::Context.current.publish_options[:stereotype]
85
86
  filter.blank? ? true : filter == stereotype.name.demodulize
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Launcher
7
+ module Instances
8
+ class Settings
9
+ DEFAULT_CURRENT_REVISION = 'origin/master'
10
+ DEFAULT_PUBLISH_REMOTE = 'publish'
11
+ PUBLISHABLE_KEY = :publishable
12
+
13
+ common_constructor :data do
14
+ self.data = (data.is_a?(Hash) ? data : {}).with_indifferent_access
15
+ end
16
+
17
+ def git_current_revision
18
+ data[__method__] || DEFAULT_CURRENT_REVISION
19
+ end
20
+
21
+ def git_publish_remote
22
+ data[__method__] || DEFAULT_PUBLISH_REMOTE
23
+ end
24
+
25
+ def publishable?
26
+ !!publishable_value
27
+ end
28
+
29
+ def stereotype_publishable?(stereotype)
30
+ return publishable? unless publishable_value.is_a?(::Hash)
31
+
32
+ parse_publishable_value(publishable_value[stereotype.stereotype_name], true)
33
+ end
34
+
35
+ private
36
+
37
+ def publishable_value
38
+ parse_publishable_value(data[PUBLISHABLE_KEY], false)
39
+ end
40
+
41
+ def parse_publishable_value(value, hash_to_true)
42
+ return value.with_indifferent_access if !hash_to_true && value.is_a?(::Hash)
43
+ return true if value.nil? || value == true
44
+ return false if value == false
45
+
46
+ !!value
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.63.0'
5
+ VERSION = '0.64.0'
6
6
  end
7
7
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/launcher/instances/settings'
3
4
  require 'eac_ruby_utils/simple_cache'
4
5
  require 'yaml'
5
- require 'eac_launcher/instances/settings'
6
6
 
7
7
  module EacLauncher
8
8
  class Context
@@ -18,7 +18,7 @@ module EacLauncher
18
18
  end
19
19
 
20
20
  def instance_settings(instance)
21
- ::EacLauncher::Instances::Settings.new(value(['Instances', instance.name]))
21
+ ::Avm::Launcher::Instances::Settings.new(value(['Instances', instance.name]))
22
22
  end
23
23
 
24
24
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.0
4
+ version: 0.64.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-18 00:00:00.000000000 Z
11
+ date: 2020-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -373,6 +373,7 @@ files:
373
373
  - lib/avm/launcher/errors/non_project.rb
374
374
  - lib/avm/launcher/instances/base.rb
375
375
  - lib/avm/launcher/instances/base/cache.rb
376
+ - lib/avm/launcher/instances/settings.rb
376
377
  - lib/avm/local_projects.rb
377
378
  - lib/avm/local_projects/instance.rb
378
379
  - lib/avm/local_projects/jobs/update.rb
@@ -516,7 +517,6 @@ files:
516
517
  - lib/eac_launcher/instances.rb
517
518
  - lib/eac_launcher/instances/error.rb
518
519
  - lib/eac_launcher/instances/runner_helper.rb
519
- - lib/eac_launcher/instances/settings.rb
520
520
  - lib/eac_launcher/paths.rb
521
521
  - lib/eac_launcher/paths/logical.rb
522
522
  - lib/eac_launcher/paths/real.rb
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacLauncher
4
- module Instances
5
- class Settings
6
- def initialize(data)
7
- @data = ActiveSupport::HashWithIndifferentAccess.new(data.is_a?(Hash) ? data : {})
8
- end
9
-
10
- def git_current_revision
11
- @data[__method__] || 'origin/master'
12
- end
13
-
14
- def git_publish_remote
15
- @data[__method__] || 'publish'
16
- end
17
-
18
- def publishable?
19
- @data.key?(:publishable) ? @data[:publishable] : true
20
- end
21
- end
22
- end
23
- end