foreman_custom_tab 0.0.1 → 0.1.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
  SHA1:
3
- metadata.gz: 33a87ef0fdaeba196f93a466aed1c46674af6fd5
4
- data.tar.gz: 0324756000e6a7caef3c89d2031192961b1a93af
3
+ metadata.gz: 193542ee87777c74b898096451c7dfb169441eb3
4
+ data.tar.gz: 5fc5dd2d13b1be5ac4b9559dbffbe72e5bb5cc4b
5
5
  SHA512:
6
- metadata.gz: 0a0c11658a57a0bbc448af52c5d8ede9b524f0eb9174949b4a96d1729ee7351d6668f639acf0a78d748d0ea52a31ae127af41985e85db2fb523e4ea89b02aa2b
7
- data.tar.gz: cdf067d2c6d06f786deb56823982dcd2b424cb17d83e9125e051574241e18f4c5fd36f2cfac6a584cdbf720cbd0f3886b906d5377cc671b1204f87c55fd39923
6
+ metadata.gz: c985a2f2e0e4c5bcc7b7142964b3109ca9ef582752e46bd6d306d755e394e724141059a96b38412dc45e92ec829102ef0e67eb222551a755beb49f22e98d4432
7
+ data.tar.gz: 5c9ff283052091fd658c7eafd219d9ebf10b11997e362b4c5139225330026cc00ef1871a8952d9b29f492428349de40ede5cbf6df20f3514bde139d2c3e0d505
data/README.md CHANGED
@@ -18,23 +18,38 @@ If there is no configuration file then the tab should not appear on the detailed
18
18
  there is one and it is empty then it will appear without any fields. To setup the configuration file create
19
19
  a new file named 'foreman_custom_tab.yaml' at the location /etc/foreman/plugins/
20
20
 
21
- The format for your yaml file should look like the following:
21
+ The keys are the display title and the values are the methods that are actually called to produce the value.
22
22
 
23
- ---
24
- :custom_tab:
25
- :fields:
26
- IP Address, ip
27
- MAC Address, mac
23
+ Example configuration:
28
24
 
29
- ##TODO
25
+ ```
26
+ :custom_tab:
27
+ :fields:
28
+ 'Host Name': name
29
+ 'MAC Address': mac
30
+ 'IP Address': ip
31
+ 'Architecture': arch
32
+ 'Certificate Name': certname
33
+ 'OS Title': operatingsystem.title
34
+ 'OS Type': operatingsystem.type
35
+ :title: foo
36
+ ```
30
37
 
31
- *add plugin settings file
38
+ ## Verify the Custom Tab is loaded
39
+ Navigate to /hosts/, click on one of the listed host. There should be tabs: 'Properties', 'Metrics', 'Templates', 'NICs' and 'custom_tab.title or Custom Tab'
40
+
41
+ ## Development mode
42
+ Add the custom_tab config to <foreman_repo>/config/settings.yaml
43
+
44
+ Note: foreman running locally (i.e not installed via rpm/debian package) does not use settings from /etc/foreman/plugins/
45
+
46
+ ## TODO
47
+
48
+ * add plugin settings file
32
49
 
33
50
  ## Notes
34
51
 
35
- This project is still incomplete and in development. If the controller still cannot add the ':summary' filter
36
- to the list in foreman then this plugin will probably not work with any other plugins. As of now the only fields
37
- that work are ones in the form "host.'field'"
52
+ This project is still incomplete and in development.
38
53
 
39
54
  Copyright (c) 2017 Joe Lyons Stannard III
40
55
 
data/Rakefile CHANGED
@@ -30,7 +30,7 @@ Rake::TestTask.new(:test) do |t|
30
30
  t.libs << 'lib'
31
31
  t.libs << 'test'
32
32
  t.pattern = 'test/**/*_test.rb'
33
- t.verbose = false
33
+ t.verbose = true
34
34
  end
35
35
 
36
36
  task default: :test
@@ -38,7 +38,7 @@ task default: :test
38
38
  begin
39
39
  require 'rubocop/rake_task'
40
40
  RuboCop::RakeTask.new
41
- rescue => _
41
+ rescue StandardError => _
42
42
  puts 'Rubocop not loaded.'
43
43
  end
44
44
 
@@ -3,20 +3,20 @@ module ForemanCustomTab
3
3
  module HostsControllerExtensions
4
4
  extend ActiveSupport::Concern
5
5
 
6
- def summary
6
+ def custom_tab
7
7
  # We can't add a before_filter :find_resource for Cockpit actions as
8
8
  # it'll override the default find_resource filter.
9
9
  find_resource
10
- render :partial => 'foreman_custom_tab/hosts/summary', :locals => { :host => @host }
10
+ render :partial => 'foreman_custom_tab/hosts/custom_tab', :locals => { :host => @host }
11
11
  rescue ActionView::Template::Error => exception
12
- process_ajax_error exception, 'fetch summary information'
12
+ process_ajax_error exception, 'fetch custom tab information'
13
13
  end
14
-
14
+
15
15
  private
16
-
16
+
17
17
  def action_permission
18
18
  case params[:action]
19
- when 'summary'
19
+ when 'custom_tab'
20
20
  :view
21
21
  else
22
22
  super
@@ -1,20 +1,23 @@
1
1
  module ForemanCustomTab
2
2
  module HostsHelperExtensions
3
3
  extend ActiveSupport::Concern
4
-
5
-
6
- def summary_fields(host)
4
+
5
+ def custom_tab_fields(host)
7
6
  fields = []
8
- rows = SETTINGS[:custom_tab][:fields] || []
9
- rows.each do |name, value|
10
- result = nil
7
+ config_fields = SETTINGS[:custom_tab][:fields] || []
8
+ config_fields.each do |key, value|
9
+ host_attr_val = nil
10
+ # chain the method calls for attibutes like operatingsystem.title
11
11
  value.split('.').each_with_index do |method, index|
12
- result = index.eql?(0) ? host.try(method) : result.try(method)
12
+ host_attr_val = index.eql?(0) ? host.try(method) : host_attr_val.try(method)
13
13
  end
14
- fields += [[_(name.to_s), result]] if result.present?
14
+ fields += [[_(key.to_s), host_attr_val]] if host_attr_val.present?
15
15
  end
16
16
  fields
17
17
  end
18
-
18
+
19
+ def custom_tab_title
20
+ SETTINGS[:custom_tab][:title] || 'Custom Tab'
21
+ end
19
22
  end
20
23
  end
@@ -1,8 +1,7 @@
1
1
  if SETTINGS[:custom_tab]
2
- Deface::Override.new(
3
- :virtual_path => "hosts/show",
4
- :name => "add_tab_link",
5
- :insert_bottom => "ul#myTab",
6
- :text => " <li><a href=\"#summary\" data-toggle=\"tab\"><%= _('Summary') %></a></li>"
7
- )
8
- end
2
+ Deface::Override.new(:virtual_path => 'hosts/show',
3
+ :name => 'add_tab_link',
4
+ :insert_bottom => 'ul#myTab',
5
+ :text =>
6
+ "<li><a href='#custom_tab' data-toggle='tab'><%= _(custom_tab_title) %></a></li>")
7
+ end
@@ -1,10 +1,10 @@
1
1
  if SETTINGS[:custom_tab]
2
- Deface::Override.new(
3
- :virtual_path => 'hosts/show',
4
- :name => 'create_link',
5
- :insert_bottom => 'div#myTabContent',
6
- :text => "\n <div id='summary' class='tab-pane' data-ajax-url='<%= summary_host_path(@host)%>' data-on-complete='onContentLoad'>
7
- <%= spinner(_('Loading Summary information ...')) %>
8
- </div>"
9
- )
2
+ Deface::Override.new(:virtual_path => 'hosts/show',
3
+ :name => 'create_link',
4
+ :insert_bottom => 'div#myTabContent',
5
+ :text =>
6
+ "\n <div id='custom_tab' class='tab-pane'
7
+ data-ajax-url='<%= custom_tab_host_path(@host)%>' data-on-complete='onContentLoad'>
8
+ <%= spinner(_('Loading Custom Tab information ...')) %>
9
+ </div>")
10
10
  end
@@ -1,11 +1,11 @@
1
1
  <table id="custom_table" class="<%= table_css_classes %>">
2
2
  <thead>
3
3
  <tr>
4
- <th colspan="2"><%= _('Summary') %></th>
4
+ <th colspan="2"><%= _(custom_tab_title) %></th>
5
5
  </tr>
6
6
  </thead>
7
7
  <tbody>
8
- <% summary_fields(host).each do |name, value| %>
8
+ <% custom_tab_fields(host).each do |name, value| %>
9
9
  <tr>
10
10
  <td><%= name %></td>
11
11
  <td><%= value %></td>
@@ -0,0 +1,11 @@
1
+ :custom_tab:
2
+ :fields:
3
+ 'Host Name': name
4
+ 'MAC Address': mac
5
+ 'IP Address': ip
6
+ 'Architecture': arch
7
+ 'Certificate Name': certname
8
+ 'OS Title': operatingsystem.title
9
+ 'OS Type': operatingsystem.type
10
+ :title: foo
11
+
data/config/routes.rb CHANGED
@@ -1,11 +1,9 @@
1
1
  Rails.application.routes.draw do
2
- #scope :foreman_custom_tab, :path => '/custom_tab' do
3
- constraints(:id => /[^\/]+/) do
4
- resources :hosts do
5
- member do
6
- get 'summary'
7
- end
2
+ constraints(:id => %r{[^\/]+}) do
3
+ resources :hosts do
4
+ member do
5
+ get 'custom_tab'
8
6
  end
9
7
  end
10
- #end
8
+ end
11
9
  end
@@ -9,35 +9,33 @@ module ForemanCustomTab
9
9
  config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
10
10
  config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
11
11
  config.autoload_paths += Dir["#{config.root}/app/overrides"]
12
-
13
-
14
- initializer 'foreman_custom_tab.configure_assets', :group => :assets do
15
- SETTINGS[:foreman_custom_tab] = { assets: { precompile: assets_to_precompile } }
16
- end
17
-
12
+
13
+ # requires_foreman version as per
14
+ # http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Requiring-Foreman-version
15
+
16
+ # Adding permission to controller action
17
+ # http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Adding-permission
18
18
  initializer('foreman_custom_tab.register_plugin', :before => :finisher_hook) do
19
19
  Foreman::Plugin.register :foreman_custom_tab do
20
20
  requires_foreman '>= 1.7'
21
-
21
+
22
22
  security_block :foreman_custom_tab do
23
23
  permission :view_hosts,
24
- { :hosts => [:summary] },
25
- :resource_type => 'Host'
24
+ { :hosts => [:custom_tab] },
25
+ :resource_type => 'Host'
26
26
  end
27
-
28
-
29
-
30
27
  end
31
28
  end
32
-
33
-
29
+
30
+ # Extending a controller
34
31
  # Include concerns in this config.to_prepare block
32
+ # http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Extending-a-Controller
35
33
  config.to_prepare do
36
34
  begin
37
35
  HostsHelper.send(:include, ForemanCustomTab::HostsHelperExtensions)
38
36
  ::HostsController.send(:include,
39
37
  ForemanCustomTab::HostsControllerExtensions)
40
- rescue => e
38
+ rescue StandardError => e
41
39
  Rails.logger.warn "ForemanCustomTab: skipping engine hook (#{e})"
42
40
  end
43
41
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanCustomTab
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.1.0'.freeze
3
3
  end
@@ -0,0 +1,40 @@
1
+ # Tests
2
+ namespace :test do
3
+ desc 'Test Foreman Custom Tab'
4
+ Rake::TestTask.new(:foreman_custom_tab) do |t|
5
+ test_dir = File.join(File.dirname(__FILE__), '../..', 'test')
6
+ t.libs << ['test', test_dir]
7
+ t.pattern = "#{test_dir}/**/*_test.rb"
8
+ t.verbose = true
9
+ t.warning = false
10
+ end
11
+ end
12
+
13
+ namespace :foreman_custom_tab do
14
+ task :rubocop do
15
+ begin
16
+ require 'rubocop/rake_task'
17
+ RuboCop::RakeTask.new(:rubocop_foreman_custom_tab) do |task|
18
+ task.patterns = ["#{ForemanCustomTab::Engine.root}/app/**/*.rb",
19
+ "#{ForemanCustomTab::Engine.root}/lib/**/*.rb",
20
+ "#{ForemanCustomTab::Engine.root}/test/**/*.rb"]
21
+ end
22
+ rescue StandardError => e
23
+ puts "Rubocop not loaded #{e.message}"
24
+ end
25
+
26
+ Rake::Task['rubocop_foreman_custom_tab'].invoke
27
+ end
28
+ end
29
+
30
+ Rake::Task[:test].enhance do
31
+ Rake::Task['test:foreman_custom_tab'].invoke
32
+ end
33
+
34
+ load 'tasks/jenkins.rake'
35
+ if Rake::Task.task_defined?(:'jenkins:unit')
36
+ Rake::Task['jenkins:unit'].enhance do
37
+ Rake::Task['test:foreman_custom_tab'].invoke
38
+ Rake::Task['foreman_custom_tab:rubocop'].invoke
39
+ end
40
+ end
data/locale/gemspec.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  # Matches foreman_custom_tab.gemspec
2
- _('TODO: Description of ForemanCustomTab.')
2
+ _('Foreman Plugin that makes a new tab with different fields depending on the settings file')
@@ -0,0 +1,74 @@
1
+ require 'test_plugin_helper'
2
+
3
+ class HostsControllerTest < ActionController::TestCase
4
+ let(:os) { FactoryBot.create(:operatingsystem, name: 'CentOS', major: '7', type: 'Redhat') }
5
+ let(:arch) { FactoryBot.create(:architecture) }
6
+ let(:host_id) { 'foreman.example.com' }
7
+ # rubocop:disable Metrics/LineLength
8
+ let(:host) { FactoryBot.create(:host, id: host_id, mac: '00:00:00:00:00:00', ip: '127.0.0.1', operatingsystem: os, arch: arch) }
9
+ # rubocop:enable Metrics/LineLength
10
+ let(:custom_tab_title) { SETTINGS[:custom_tab][:title] }
11
+
12
+ # rubocop:disable Metrics/LineLength, Style/StringLiterals, HttpPositionalArguments
13
+ test 'GET hosts/:id displays tabs' do
14
+ get :show, { :id => host.id }, set_session_user
15
+ assert_includes response.headers['Content-Type'], 'text/html'
16
+ assert_equal response.status, 200
17
+ assert_includes response.body, "ul id=\"myTab\""
18
+ end
19
+
20
+ test "host overview displays tabs 'Properties', 'Metrics', 'NICs'" do
21
+ get :show, { :id => host.id }, set_session_user
22
+ assert_includes response.headers['Content-Type'], 'text/html'
23
+ assert_equal response.status, 200
24
+ assert_includes response.body, "<ul id=\"myTab\""
25
+ assert_includes response.body, "<li class=\"active\"><a href=\"#properties\" data-toggle=\"tab\">Properties</a></li>"
26
+ assert_includes response.body, "<li><a href=\"#metrics\" data-toggle=\"tab\">Metrics</a></li>"
27
+ assert_includes response.body, "<li><a href=\"#nics\" data-toggle=\"tab\">NICs</a></li>"
28
+ end
29
+
30
+ test "host overview displays the Custom Tab" do
31
+ get :show, { :id => host.id }, set_session_user
32
+ assert_includes response.headers['Content-Type'], 'text/html'
33
+ assert_includes response.body, "<ul id=\"myTab\""
34
+ assert_equal response.status, 200
35
+ assert_includes response.body, "<li><a href=\"#custom_tab\" data-toggle=\"tab\">#{custom_tab_title}</a></li>"
36
+ end
37
+
38
+ test "host/:id contains custom_tab ajax link" do
39
+ get :show, { :id => host.id }, set_session_user
40
+
41
+ assert_equal response.status, 200
42
+ assert_includes response.headers['Content-Type'], 'text/html'
43
+ assert_includes response.body, "<ul id=\"myTab\""
44
+ assert_includes response.body, "<li><a href=\"#custom_tab\" data-toggle=\"tab\">#{custom_tab_title}</a></li>"
45
+ assert_includes response.body, "<div id=\"custom_tab\" class=\"tab-pane\" data-ajax-url=\"/hosts/#{host.name}/custom_tab\" data-on-complete=\"onContentLoad\">"
46
+ end
47
+
48
+ describe 'When hosts#show' do
49
+ before do
50
+ host_id = 'foreman.example.com'
51
+ Rails.application.routes.draw do
52
+ get "/hosts/#{host_id}/custom_tab" => 'hosts_controller#custom_tab'
53
+ end
54
+ end
55
+ after do
56
+ Rails.application.reload_routes!
57
+ end
58
+
59
+ test 'AJAX request hosts/:id/custom_tab displays custom host data' do
60
+ skip("xhr route missing: ActionController::UrlGenerationError:
61
+ No route matches {:action=>'/hosts/host6/custom_tab', :controller=>'hosts'}")
62
+ # get "/hosts/#{host.name}/custom_tab", xhr: true
63
+ # xhr :get, custom_tab_host_path(host), delivery_method: :deliver, status: :pending, format: 'js'
64
+ get custom_tab_host_path(host), params: { xhr: true }
65
+ # get "/hosts/#{host_id}/custom_tab"
66
+
67
+ SETTINGS[:custom_tab][:fields].each do |title, attr|
68
+ assert_includes response.body, "<td>#{title}</td>"
69
+ assert_includes response.body, "<td>#{host.get_chained_attr_val(attr)}</td>"
70
+ end
71
+ end
72
+ end
73
+ # rubocop:enable Metrics/LineLength, Style/StringLiterals, HttpPositionalArguments
74
+ end
@@ -0,0 +1,37 @@
1
+ require 'test_plugin_helper'
2
+
3
+ class HostsHelperExtensionsTest < ActiveSupport::TestCase
4
+ include ForemanCustomTab::HostsHelperExtensions
5
+
6
+ let(:os) { FactoryBot.create(:operatingsystem, name: 'CentOS', major: '7', type: 'Redhat') }
7
+ let(:arch) { FactoryBot.create(:architecture) }
8
+ # rubocop:disable Metrics/LineLength
9
+ let(:host) { FactoryBot.create(:host, id: 'foreman.example.com', mac: '00:00:00:00:00:00', ip: '127.0.0.1', operatingsystem: os, arch: arch) }
10
+ # rubocop:enable Metrics/LineLength
11
+ let(:expected_fields) do
12
+ fields = []
13
+ SETTINGS[:custom_tab][:fields].each do |title, host_attr|
14
+ fields << [title, host.get_chained_attr_val(host_attr)]
15
+ end
16
+ fields
17
+ end
18
+
19
+ describe '#custom_tab_fields(host)' do
20
+ test 'returns fields as expected' do
21
+ assert_equal custom_tab_fields(host), expected_fields
22
+ end
23
+ end
24
+
25
+ describe '#custom_tab_title' do
26
+ title_orig = SETTINGS[:custom_tab][:title]
27
+ test 'returns correct title' do
28
+ assert_equal custom_tab_title, title_orig
29
+ end
30
+
31
+ test 'settings title is not present' do
32
+ SETTINGS[:custom_tab][:title] = nil
33
+ assert_equal custom_tab_title, 'Custom Tab'
34
+ SETTINGS[:custom_tab][:title] = title_orig
35
+ end
36
+ end
37
+ end
@@ -1,6 +1,23 @@
1
+ # populate custom tab settings for test env
2
+ # NOTE: this needs to be updated before calling foreman test_helper
3
+ SETTINGS[:custom_tab] = { fields: { 'Host Name' => 'name',
4
+ 'MAC Address' => 'mac',
5
+ 'IP Address' => 'ip',
6
+ 'Architecture' => 'arch',
7
+ 'Certificate Name' => 'certname',
8
+ 'OS Title' => 'operatingsystem.title',
9
+ 'OS Type' => 'operatingsystem.type' },
10
+ title: 'foo' }
11
+
1
12
  # This calls the main test_helper in Foreman-core
2
13
  require 'test_helper'
3
14
 
4
- # Add plugin to FactoryGirl's paths
5
- FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
6
- FactoryGirl.reload
15
+ class Object
16
+ def get_chained_attr_val(attrs)
17
+ attr_val = nil
18
+ attrs.split('.').each_with_index do |method, index|
19
+ attr_val = index.eql?(0) ? try(method) : attr_val.try(method)
20
+ end
21
+ attr_val
22
+ end
23
+ end
@@ -2,7 +2,7 @@ require 'test_plugin_helper'
2
2
 
3
3
  class ForemanCustomTabTest < ActiveSupport::TestCase
4
4
  setup do
5
- User.current = User.find_by_login 'admin'
5
+ User.current = User.find_by(login: 'admin')
6
6
  end
7
7
 
8
8
  test 'the truth' do
@@ -0,0 +1,30 @@
1
+ require 'test_plugin_helper'
2
+
3
+ class CustomTabTest < ActionView::TestCase
4
+ let(:os) { FactoryBot.create(:operatingsystem, name: 'CentOS', major: '7', type: 'Redhat') }
5
+ let(:arch) { FactoryBot.create(:architecture) }
6
+ # rubocop:disable Metrics/LineLength
7
+ let(:host) { FactoryBot.create(:host, id: 'foreman.example.com', mac: '00:00:00:00:00:00', ip: '127.0.0.1', operatingsystem: os, arch: arch) }
8
+ # rubocop:enable Metrics/LineLength
9
+ let(:custom_tab_title) { SETTINGS[:custom_tab][:title] }
10
+
11
+ class FakeHostsController < ActionController::Base
12
+ include ForemanCustomTab::HostsHelperExtensions
13
+ include LayoutHelper
14
+
15
+ def index
16
+ os = FactoryBot.create(:operatingsystem, name: 'CentOS', major: '7', type: 'Redhat')
17
+ # rubocop:disable Metrics/LineLength
18
+ @host = FactoryBot.create(:host, id: 'foreman.example.com', mac: '00:00:00:00:00:00', ip: '127.0.0.1', operatingsystem: os, arch: FactoryBot.create(:architecture))
19
+ # rubocop:enable Metrics/LineLength
20
+ render :partial => 'foreman_custom_tab/hosts/custom_tab', :locals => { :host => @host }
21
+ end
22
+ end
23
+
24
+ test 'successfully render custom_tab partial' do
25
+ skip("NoMethodError: undefined method 'content_type' for nil:NilClass")
26
+ get FakeHostsController.new.index
27
+
28
+ assert_select 'custom_table'
29
+ end
30
+ end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_custom_tab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.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: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rubocop
14
+ name: rdoc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rdoc
28
+ name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -38,7 +38,28 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Makes a new tab that has different fields depending on the settings file
41
+ - !ruby/object:Gem::Dependency
42
+ name: deface
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.2.0
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.0'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.2.0
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
61
+ description: Foreman Plugin that makes a new tab with different fields depending on
62
+ the settings file
42
63
  email:
43
64
  - stannajl@miamioh.edu
44
65
  executables: []
@@ -52,20 +73,23 @@ files:
52
73
  - app/helpers/concerns/foreman_custom_tab/hosts_helper_extensions.rb
53
74
  - app/overrides/add_tab.rb
54
75
  - app/overrides/add_tab_link.rb
55
- - app/views/foreman_custom_tab/hosts/_summary.html.erb
76
+ - app/views/foreman_custom_tab/hosts/_custom_tab.html.erb
77
+ - config/foreman_custom_tab.yaml.example
56
78
  - config/routes.rb
57
- - config/tab.yaml
58
79
  - lib/foreman_custom_tab.rb
59
80
  - lib/foreman_custom_tab/engine.rb
60
81
  - lib/foreman_custom_tab/version.rb
82
+ - lib/tasks/foreman_custom_tab_tasks.rake
61
83
  - locale/Makefile
62
84
  - locale/en/foreman_custom_tab.po
63
85
  - locale/foreman_custom_tab.pot
64
86
  - locale/gemspec.rb
65
- - test/factories/foreman_custom_tab_factories.rb
87
+ - test/functional/concerns/hosts_controller_extensions_test.rb
88
+ - test/helpers/concerns/foreman_custom_tab/hosts_helper_extensions_test.rb
66
89
  - test/test_plugin_helper.rb
67
90
  - test/unit/foreman_custom_tab_test.rb
68
- homepage: https://github.com/rougehero/foreman_custom_tab
91
+ - test/views/foreman_custom_tab/hosts/_custom_tab_test.rb
92
+ homepage: https://github.com/MiamiOH/foreman_custom_tab
69
93
  licenses:
70
94
  - GPL-3.0
71
95
  metadata: {}
@@ -85,11 +109,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
109
  version: '0'
86
110
  requirements: []
87
111
  rubyforge_project:
88
- rubygems_version: 2.4.8
112
+ rubygems_version: 2.6.11
89
113
  signing_key:
90
114
  specification_version: 4
91
- summary: creates custom tab for hosts
115
+ summary: Creates custom tab for hosts in Foreman
92
116
  test_files:
93
- - test/factories/foreman_custom_tab_factories.rb
94
117
  - test/test_plugin_helper.rb
118
+ - test/functional/concerns/hosts_controller_extensions_test.rb
95
119
  - test/unit/foreman_custom_tab_test.rb
120
+ - test/views/foreman_custom_tab/hosts/_custom_tab_test.rb
121
+ - test/helpers/concerns/foreman_custom_tab/hosts_helper_extensions_test.rb
data/config/tab.yaml DELETED
@@ -1 +0,0 @@
1
- IP Address, ip
@@ -1,5 +0,0 @@
1
- FactoryGirl.define do
2
- factory :host do
3
- name 'foreman_custom_tab'
4
- end
5
- end