easy_app_helper 4.1.1 → 4.1.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8ad72833020b17d6a18aa5d80a3ec6b39752f1d
|
4
|
+
data.tar.gz: 27b76179f874b068bce02b666b9877096f67db44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffee1008b3e25274dc63b75946723f24d28f9a8b0f26c510c04b8741b7c783d4d0093b5c4cecafb8499a1c6a41f8eaaa67cbe3712a414a3e45174df0a97aefb6
|
7
|
+
data.tar.gz: 011cd2a385b3a3e3548df86174f876c05ff5c1e8b26df392a43e4498fdbddacdb5674c69d6ba8feb28dce601f33b2dde4dbd88fe817bf5912eacae651ae41bb1
|
@@ -40,6 +40,9 @@ module EasyAppHelper
|
|
40
40
|
unless self::ALIASES.nil? or self::ALIASES.empty?
|
41
41
|
line += ' (aliases: %s).' % [ self::ALIASES.join(', ') ]
|
42
42
|
end
|
43
|
+
unless self::PROVIDER == EasyAppHelper::Scripts::SubCommandBase::PROVIDER
|
44
|
+
line += ' Provided by %s plugin.' % [ self::PROVIDER ]
|
45
|
+
end
|
43
46
|
line
|
44
47
|
end
|
45
48
|
|
@@ -35,21 +35,24 @@ module EasyAppHelper
|
|
35
35
|
@by_name ||= {}
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.sub_command_class(command_name_or_alias,
|
39
|
-
candidates =
|
40
|
-
raise "There is no provider declared for command '#{command_name_or_alias}'" if candidates.nil?
|
41
|
-
candidates.select! do |sub_command_class|
|
38
|
+
def self.sub_command_class(command_name_or_alias, preferred_provider=EasyAppHelper::Scripts::SubCommandBase::PROVIDER)
|
39
|
+
candidates = by_name[command_name_or_alias].select do |sub_command_class|
|
42
40
|
command_classes_for_command = by_name[command_name_or_alias]
|
43
41
|
raise "There is no provider declared for command '#{command_name_or_alias}'" if command_classes_for_command.nil?
|
44
42
|
command_classes_for_command.include? sub_command_class
|
45
43
|
end
|
46
|
-
|
44
|
+
if candidates.size > 1
|
45
|
+
candidates.select! do |sub_command_class|
|
46
|
+
sub_command_class::PROVIDER == preferred_provider
|
47
|
+
end
|
48
|
+
raise "Cannot determine provider to use for '#{command_name_or_alias}'. Multiple providers exist !"
|
49
|
+
end
|
47
50
|
candidates.first
|
48
51
|
end
|
49
52
|
|
50
|
-
def delegate_to_sub_command(
|
53
|
+
def delegate_to_sub_command(preferred_provider=EasyAppHelper::Scripts::SubCommandBase::PROVIDER)
|
51
54
|
sub_command_name = extra_parameters.shift
|
52
|
-
sub_command = EasyAppHelper::Scripts::SubCommandManager.sub_command_class(sub_command_name,
|
55
|
+
sub_command = EasyAppHelper::Scripts::SubCommandManager.sub_command_class(sub_command_name, preferred_provider).new
|
53
56
|
sub_command.pre_process
|
54
57
|
raise 'You have to implement \'do_process\'' unless sub_command.respond_to? :do_process
|
55
58
|
sub_command.do_process
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_app_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L.Briais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|