Fixed gemspec and engine

pull/6827/head
Sebastian Schuster 11 years ago committed by Christian Ratz
parent 944dbab297
commit 4ab4b4a92c
  1. 97
      lib/open_project/meeting/engine.rb
  2. 2
      lib/open_project/meeting/patches/project_patch.rb
  3. 7
      openproject-meeting.gemspec

@ -13,12 +13,53 @@ require 'rails/engine'
module OpenProject::Meeting
class Engine < ::Rails::Engine
initializer 'openproject_meeting.precompile_assets' do |app|
app.config.assets.precompile += ["openproject_meeting.css"]
engine_name :openproject_meeting
config.autoload_paths += Dir["#{config.root}/lib/"]
spec = Bundler.environment.specs['openproject-meeting'][0]
initializer 'meeting.register_plugin' do
Redmine::Plugin.register :openproject_meeting do
name 'OpenProject Meeting'
author ((spec.authors.kind_of? Array) ? spec.authors[0] : spec.authors)
author_url spec.homepage
description spec.description
version spec.version
url 'https://www.openproject.org/projects/plugin-meetings'
requires_openproject ">= 3.0.0pre9"
project_module :meetings do
permission :create_meetings, {:meetings => [:new, :create, :copy]}, :require => :member
permission :edit_meetings, {:meetings => [:edit, :update]}, :require => :member
permission :delete_meetings, {:meetings => [:destroy]}, :require => :member
permission :view_meetings, {:meetings => [:index, :show], :meeting_agendas => [:history, :show, :diff], :meeting_minutes => [:history, :show, :diff]}
permission :create_meeting_agendas, {:meeting_agendas => [:update, :preview]}, :require => :member
permission :close_meeting_agendas, {:meeting_agendas => [:close, :open]}, :require => :member
permission :send_meeting_agendas_notification, {:meeting_agendas => [:notify]}, :require => :member
permission :create_meeting_minutes, {:meeting_minutes => [:update, :preview]}, :require => :member
permission :send_meeting_minutes_notification, {:meeting_minutes => [:notify]}, :require => :member
end
Redmine::Search.map do |search|
search.register :meetings
end
menu :project_menu, :meetings, {:controller => 'meetings', :action => 'index'}, :caption => :project_module_meetings, :param => :project_id, :after => :wiki
menu :project_menu, :new_meeting, {:controller => 'meetings', :action => 'new'}, :param => :project_id, :caption => :label_meeting_new, :parent => :meetings
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable "meeting_minutes"
end
end
end
initializer 'meeting.precompile_assets' do |app|
app.config.assets.precompile += ["meeting.css"]
end
initializer 'openproject_meeting.register_path_to_rspec' do |app|
initializer 'meeting.register_path_to_rspec' do |app|
app.config.plugins_to_test_paths << self.root
end
@ -37,16 +78,17 @@ module OpenProject::Meeting
end
# adds our factories to factory girl's load path
initializer "meetings.register_factories", :after => "factory_girl.set_factory_paths" do |app|
initializer "meeting.register_factories", :after => "factory_girl.set_factory_paths" do |app|
FactoryGirl.definition_file_paths << File.expand_path(self.root.to_s + '/spec/factories') if defined?(FactoryGirl)
end
initializer "meeting.register_hooks" do
require 'open_project/meeting/hooks'
end
config.to_prepare do
require 'redmine/plugin'
require_dependency 'open_project/meeting/hooks'
require 'open_project/meeting/patches/project_patch'
Project.send(:include, Patches::ProjectPatch)
require_dependency 'open_project/meeting/patches/project_patch'
# load classes so that all User.before_destroy filters are loaded
require_dependency 'meeting'
@ -54,43 +96,6 @@ module OpenProject::Meeting
require_dependency 'meeting_minutes'
require_dependency 'meeting_participant'
spec = Bundler.environment.specs['openproject-meeting'][0]
unless Redmine::Plugin.registered_plugins.include?(:openproject_meeting)
Redmine::Plugin.register :openproject_meeting do
name 'OpenProject Meeting'
author ((spec.authors.kind_of? Array) ? spec.authors[0] : spec.authors)
author_url spec.homepage
description spec.description
version spec.version
url 'https://www.openproject.org/projects/plugin-meetings'
requires_openproject ">= 3.0.0pre9"
project_module :meetings do
permission :create_meetings, {:meetings => [:new, :create, :copy]}, :require => :member
permission :edit_meetings, {:meetings => [:edit, :update]}, :require => :member
permission :delete_meetings, {:meetings => [:destroy]}, :require => :member
permission :view_meetings, {:meetings => [:index, :show], :meeting_agendas => [:history, :show, :diff], :meeting_minutes => [:history, :show, :diff]}
permission :create_meeting_agendas, {:meeting_agendas => [:update, :preview]}, :require => :member
permission :close_meeting_agendas, {:meeting_agendas => [:close, :open]}, :require => :member
permission :send_meeting_agendas_notification, {:meeting_agendas => [:notify]}, :require => :member
permission :create_meeting_minutes, {:meeting_minutes => [:update, :preview]}, :require => :member
permission :send_meeting_minutes_notification, {:meeting_minutes => [:notify]}, :require => :member
end
Redmine::Search.map do |search|
search.register :meetings
end
menu :project_menu, :meetings, {:controller => 'meetings', :action => 'index'}, :caption => :project_module_meetings, :param => :project_id, :after => :wiki
menu :project_menu, :new_meeting, {:controller => 'meetings', :action => 'new'}, :param => :project_id, :caption => :label_meeting_new, :parent => :meetings
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable "meeting_minutes"
end
end
end
end
end
end

@ -20,3 +20,5 @@ module OpenProject::Meeting
end
end
end
Project.send(:include, OpenProject::Meeting::Patches::ProjectPatch)

@ -11,14 +11,13 @@ Gem::Specification.new do |s|
s.authors = "Finn GmbH"
s.email = "info@finn.de"
s.homepage = "http://www.finn.de"
s.summary = "This plugin adds a meeting module with functionality to plan an agenda and save the minutes of a meeting."
s.description = "This plugin adds a meeting module with functionality to plan an agenda and save the minutes of a meeting."
s.summary = "This OpenProject plugin adds a meeting module with functionality to plan an agenda and save the minutes of a meeting."
s.description = "This OpenProject plugin adds a meeting module with functionality to plan an agenda and save the minutes of a meeting."
s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"]
s.files = Dir["{app,config,db,lib}/**/*", "CHANGELOG.md", "README.rdoc"]
s.test_files = Dir["spec/**/*"]
s.add_dependency "rails", "~> 3.2.9"
s.add_development_dependency "sqlite3"
s.add_development_dependency "factory_girl_rails", "~> 4.0"
end

Loading…
Cancel
Save