This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
107 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...reman_plugin_template/hosts_controller.rb → ...trollers/foreman_abrt/hosts_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lugin_template/hosts_helper_extensions.rb → ...s/foreman_abrt/hosts_helper_extensions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module ForemanPluginTemplate | ||
module ForemanAbrt | ||
module HostsHelperExtensions | ||
extend ActiveSupport::Concern | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...oreman_plugin_template/host_extensions.rb → .../concerns/foreman_abrt/host_extensions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module ForemanPluginTemplate | ||
module ForemanAbrt | ||
module HostExtensions | ||
extend ActiveSupport::Concern | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- insert_before 'div:contains("title_action")' --> | ||
<%= title_actions "<h2>ForemanPluginTemplate</h2>" %> | ||
<%= title_actions "<h2>ForemanAbrt</h2>" %> | ||
|
||
<!-- vim: set ft=eruby : --> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Welcome to <b>ForemanPluginTemplate</b> |
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Rails.application.routes.draw do | ||
|
||
match 'new_action', :to => 'foreman_plugin_template/hosts#new_action' | ||
match 'new_action', :to => 'foreman_abrt/hosts#new_action' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require File.expand_path('../lib/foreman_abrt/version', __FILE__) | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "foreman_abrt" | ||
s.version = ForemanAbrt::VERSION | ||
s.date = Date.today.to_s | ||
s.authors = ["Martin Milata"] | ||
s.email = ["mmilata@redhat.com"] | ||
s.homepage = "TODO" | ||
s.summary = "TODO: Summary of ForemanAbrt." | ||
s.description = "TODO: Description of ForemanAbrt." | ||
|
||
s.files = Dir["{app,config,db,lib}/**/*"] + ["LICENSE", "Rakefile", "README.md"] | ||
s.test_files = Dir["test/**/*"] | ||
|
||
s.add_dependency "deface" | ||
#s.add_development_dependency "sqlite3" | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "foreman_abrt/engine" | ||
|
||
module ForemanAbrt | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require 'deface' | ||
|
||
module ForemanAbrt | ||
class Engine < ::Rails::Engine | ||
|
||
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"] | ||
config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"] | ||
config.autoload_paths += Dir["#{config.root}/app/models/concerns"] | ||
config.autoload_paths += Dir["#{config.root}/app/overrides"] | ||
|
||
# Add any db migrations | ||
initializer "foreman_abrt.load_app_instance_data" do |app| | ||
app.config.paths['db/migrate'] += ForemanAbrt::Engine.paths['db/migrate'].existent | ||
end | ||
|
||
initializer 'foreman_abrt.register_plugin', :after=> :finisher_hook do |app| | ||
Foreman::Plugin.register :foreman_abrt do | ||
requires_foreman '>= 1.4' | ||
|
||
# Add permissions | ||
security_block :foreman_abrt do | ||
permission :view_foreman_abrt, {:'foreman_abrt/hosts' => [:new_action] } | ||
end | ||
|
||
# Add a new role called 'Discovery' if it doesn't exist | ||
role "ForemanAbrt", [:view_foreman_abrt] | ||
|
||
#add menu entry | ||
menu :top_menu, :template, | ||
:url_hash => {:controller => :'foreman_abrt/hosts', :action => :new_action }, | ||
:caption => 'ForemanAbrt', | ||
:parent => :hosts_menu, | ||
:after => :hosts | ||
end | ||
end | ||
|
||
#Include concerns in this config.to_prepare block | ||
config.to_prepare do | ||
begin | ||
Host::Managed.send(:include, ForemanAbrt::HostExtensions) | ||
HostsHelper.send(:include, ForemanAbrt::HostsHelperExtensions) | ||
rescue => e | ||
puts "ForemanAbrt: skipping engine hook (#{e.to_s})" | ||
end | ||
end | ||
|
||
rake_tasks do | ||
Rake::Task['db:seed'].enhance do | ||
ForemanAbrt::Engine.load_seed | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module ForemanAbrt | ||
VERSION = "0.0.1" | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ries/foreman_plugin_template_factories.rb → test/factories/foreman_abrt_factories.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FactoryGirl.define do | ||
factory :host do | ||
name 'foreman_plugin_template' | ||
name 'foreman_abrt' | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
test/unit/foreman_plugin_template_test.rb → test/unit/foreman_abrt_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters