foreman_custom_tab 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d0fb2f3f74e8bd32d92bf58686a1ebb5ecee46dd
|
|
4
|
+
data.tar.gz: bb8bb4be5d01050b673019414bc8117e4b0203ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 09586ea806dd6a7c53365eb4b20afce605633405577d255ae8c53ca9c3cce16e717fa35822ab2aeb63e5ca6c65ad317d8f336d1781befa03fc62b16a230c7379
|
|
7
|
+
data.tar.gz: 844a89ca7f0c246334699547cc0aad51d264964c9c40e5366d2c77b0c021d6a6516fccccdd0b5831d3e58e31ca02b15ba0058feb6ac79cc90ba6dbc602b57fd1
|
data/Rakefile
CHANGED
|
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
APP_RAKEFILE = File.expand_path('
|
|
23
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
|
24
24
|
|
|
25
25
|
Bundler::GemHelper.install_tasks
|
|
26
26
|
|
|
@@ -8,9 +8,9 @@ module ForemanCustomTab
|
|
|
8
8
|
config_fields.each do |key, value|
|
|
9
9
|
# chain the method calls for attibutes like operatingsystem.title
|
|
10
10
|
host_attr_val = value.split('.').inject(host) do |memo, method|
|
|
11
|
-
if m = method.match(/(.*)\((.*)\)/)
|
|
12
|
-
memo.try(
|
|
13
|
-
elsif m = method.match(/(.*)\[(.*)\]/)
|
|
11
|
+
if (m = method.match(/(.*)\((.*)\)/))
|
|
12
|
+
memo.try(m[1], *m[2].split(/,\s?/))
|
|
13
|
+
elsif (m = method.match(/(.*)\[(.*)\]/))
|
|
14
14
|
memo.try(m[1]).try('[]', m[2])
|
|
15
15
|
else
|
|
16
16
|
memo.try(method)
|
|
@@ -20,9 +20,12 @@ module ForemanCustomTab
|
|
|
20
20
|
requires_foreman '>= 1.7'
|
|
21
21
|
|
|
22
22
|
security_block :foreman_custom_tab do
|
|
23
|
-
permission :view_hosts,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
ps = permission :view_hosts,
|
|
24
|
+
{ :hosts => [:custom_tab] },
|
|
25
|
+
:resource_type => 'Host'
|
|
26
|
+
pn = ps.pop
|
|
27
|
+
po = ps.detect { |p| p.name == :view_hosts }
|
|
28
|
+
po.actions << pn.actions.first
|
|
26
29
|
end
|
|
27
30
|
end
|
|
28
31
|
end
|
|
@@ -41,7 +44,7 @@ module ForemanCustomTab
|
|
|
41
44
|
end
|
|
42
45
|
|
|
43
46
|
initializer 'foreman_custom_tab.register_gettext', after: :load_config_initializers do |_app|
|
|
44
|
-
locale_dir = File.join(File.expand_path('
|
|
47
|
+
locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
|
|
45
48
|
locale_domain = 'foreman_custom_tab'
|
|
46
49
|
Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
|
|
47
50
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_custom_tab
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joe Stannard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deface
|