Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing redmine from all names

  • Loading branch information...
commit a2e509a9799617a23253cf36b2139b58083ac993 1 parent e875228
@schmidt schmidt authored
View
17 README.rdoc
@@ -1,4 +1,4 @@
-= Redmine/ChiliProject Activity Module Plugin
+= ChiliProject Activity Module Plugin
This Plugin makes activity a module, such that it can be activated and
deactivated on a per-project setting.
@@ -8,9 +8,9 @@ It also includes a migration which
* activates the newly introduced activity module in all existing projects
* adds the activity module to the set of default modules for new projects
-It therefore simply restores the default Redmine/ChiliProject behaviour for all
-existing projects. You may then selectively deactivate the activity module in
-single projects selectively.
+It therefore simply restores the default ChiliProject behaviour for all existing
+projects. You may then selectively deactivate the activity module in single
+projects selectively.
== Requirements
@@ -26,13 +26,12 @@ project's issue tracker.
== Screenshots
-https://github.com/finnlabs/redmine_activity_module/raw/master/doc/screen-capture.png
+https://github.com/finnlabs/chiliproject_activity_module/raw/master/doc/screen-capture.png
== Installation
-Please follow the default plugin installation instructions for
-Redmine/ChiliProject.
+Please follow the default plugin installation instructions for ChiliProject.
Run the above mentioned migration at will.
@@ -49,8 +48,8 @@ directory.
== Development
-To run the tests, you will need a current version of our {Redmine/ChiliProject
-Dev Tools}[https://github.com/finnlabs/redmine-dev-tools]. After running
+To run the tests, you will need a current version of our {ChiliProject Dev
+Tools}[https://github.com/finnlabs/redmine-dev-tools]. After running
bundle install
View
8 db/migrate/20110214150630_activate_activity_module_by_default.rb
@@ -1,11 +1,11 @@
class ActivateActivityModuleByDefault < ActiveRecord::Migration
def self.up
- RedmineActivityModule.activate_activity_module_for_all_projects
- RedmineActivityModule.add_activity_module_from_default_settings
+ ActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.add_activity_module_from_default_settings
end
def self.down
- RedmineActivityModule.deactivate_activity_module_for_all_projects
- RedmineActivityModule.remove_activity_module_from_default_settings
+ ActivityModule.deactivate_activity_module_for_all_projects
+ ActivityModule.remove_activity_module_from_default_settings
end
end
View
18 init.rb
@@ -1,19 +1,19 @@
require 'redmine'
-require 'redmine_activity_module'
-require 'redmine_activity_module/version'
+require 'activity_module'
+require 'activity_module/version'
-Redmine::Plugin.register :redmine_activity_module do
- name 'Redmine Activity Module Plugin'
+Redmine::Plugin.register :activity_module do
+ name 'ChiliProject Activity Module Plugin'
author 'Gregor Schmidt'
description 'This Plugin makes activity a module, such that it can be activated and deactivated on a per-project setting.'
- version RedmineActivityModule::Version.full
- url 'http://github.com/finnlabs/redmine_activity_module'
+ version ActivityModule::Version.full
+ url 'http://github.com/finnlabs/chiliproject_activity_module'
author_url 'http://www.finn.de/'
end
require 'dispatcher'
-Dispatcher.to_prepare :redmine_activity_module do
+Dispatcher.to_prepare :activity_module do
require_dependency 'application_controller'
require_dependency 'redmine/access_control'
@@ -52,7 +52,7 @@ def available_project_modules_with_activity
def (ActionController::IntegrationTest).inherited(sub)
if sub.name == 'MenuManagerTest'
sub.send(:define_method, :setup) do
- RedmineActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.activate_activity_module_for_all_projects
end
end
super
@@ -60,7 +60,7 @@ def (ActionController::IntegrationTest).inherited(sub)
def (ActionController::TestCase).inherited(sub)
if sub.name == 'ActivitiesControllerTest'
sub.send(:define_method, :setup) do
- RedmineActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.activate_activity_module_for_all_projects
end
end
super
View
4 lib/redmine_activity_module.rb → lib/activity_module.rb
@@ -1,4 +1,4 @@
-module RedmineActivityModule
+module ActivityModule
def self.activate_activity_module_for_all_projects
Project.find(:all).each do |p|
p.enabled_module_names = ["activity"] | p.enabled_module_names
@@ -14,7 +14,7 @@ def self.deactivate_activity_module_for_all_projects
def self.add_activity_module_from_default_settings
Setting["default_projects_modules"] = ["activity"] | Setting.default_projects_modules
end
-
+
def self.remove_activity_module_from_default_settings
Setting["default_projects_modules"] = Setting.default_projects_modules - ["activity"]
end
View
6 lib/redmine_activity_module/version.rb → lib/activity_module/version.rb
@@ -1,4 +1,4 @@
-module RedmineActivityModule
+module ActivityModule
module Version
def to_s
[major, minor, patch].join('.')
@@ -11,11 +11,11 @@ def full
def major
2
end
-
+
def minor
0
end
-
+
def patch
0
end
View
30 spec/models/redmine_activity_module_spec.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe RedmineActivityModule do
+describe ActivityModule do
describe '.activate_activity_module_for_all_projects' do
describe 'when activity module was active' do
before do
@@ -11,7 +11,7 @@
end
it 'keeps all previously activated modules' do
- RedmineActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.activate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
@enabled_module_names.each do |name|
@@ -29,13 +29,13 @@
end
it 'activates the activity module' do
- RedmineActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.activate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
Project.find(:all).should be_all { |p| p.enabled_module_names.include?("activity") }
end
it 'keeps all previously activated modules' do
- RedmineActivityModule.activate_activity_module_for_all_projects
+ ActivityModule.activate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
@enabled_module_names.each do |name|
@@ -55,14 +55,14 @@
end
it 'removes activity from list of activated modules' do
- RedmineActivityModule.deactivate_activity_module_for_all_projects
+ ActivityModule.deactivate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
Project.find(:all).should be_none { |p| p.enabled_module_names.include? 'activity' }
end
it 'keeps all other activated modules' do
- RedmineActivityModule.deactivate_activity_module_for_all_projects
+ ActivityModule.deactivate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
(@enabled_module_names - ['activity']).each do |name|
@@ -80,14 +80,14 @@
end
it 'does not activates the activity module' do
- RedmineActivityModule.deactivate_activity_module_for_all_projects
+ ActivityModule.deactivate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
Project.find(:all).should be_none { |p| p.enabled_module_names.include?("activity") }
end
it 'keeps all previously activated modules' do
- RedmineActivityModule.deactivate_activity_module_for_all_projects
+ ActivityModule.deactivate_activity_module_for_all_projects
Project.find(:all).should_not be_empty
@enabled_module_names.each do |name|
@@ -114,12 +114,12 @@
end
it 'adds activity to the list of the default_projects_modules' do
- RedmineActivityModule.add_activity_module_from_default_settings
+ ActivityModule.add_activity_module_from_default_settings
Setting["default_projects_modules"].should include('activity')
end
it 'does not change the other default_projects_modules' do
- RedmineActivityModule.add_activity_module_from_default_settings
+ ActivityModule.add_activity_module_from_default_settings
@default_projects_modules.should be_all { |n| Setting['default_projects_modules'].include?(n) }
end
end
@@ -131,7 +131,7 @@
end
it 'keeps all previous members of the default_projects_modules' do
- RedmineActivityModule.add_activity_module_from_default_settings
+ ActivityModule.add_activity_module_from_default_settings
@default_projects_modules.should be_all { |n| Setting['default_projects_modules'].include?(n) }
end
end
@@ -145,12 +145,12 @@
end
it 'does not add activity to the list of default_projects_modules' do
- RedmineActivityModule.remove_activity_module_from_default_settings
+ ActivityModule.remove_activity_module_from_default_settings
Setting['default_projects_modules'].should_not include('activity')
end
it 'keeps all previous members of the default_projects_modules' do
- RedmineActivityModule.remove_activity_module_from_default_settings
+ ActivityModule.remove_activity_module_from_default_settings
@default_projects_modules.should be_all { |n| Setting['default_projects_modules'].include?(n) }
end
end
@@ -162,12 +162,12 @@
end
it 'removes activity from the list of default_projects_modules' do
- RedmineActivityModule.remove_activity_module_from_default_settings
+ ActivityModule.remove_activity_module_from_default_settings
Setting['default_projects_modules'].should_not include('activity')
end
it 'keeps all previous members of the default_projects_modules' do
- RedmineActivityModule.remove_activity_module_from_default_settings
+ ActivityModule.remove_activity_module_from_default_settings
(@default_projects_modules - ['activity']).should be_all { |n| Setting['default_projects_modules'].include?(n) }
end
end
View
2  spec/plugin_spec_helper.rb
@@ -1,2 +0,0 @@
-module RedmineActivityModule::SpecHelper
-end
View
26 spec/spec_helper.rb
@@ -1,28 +1,4 @@
RAILS_ENV = "test" unless defined? RAILS_ENV
-# prevent case where we are using rubygems and test-unit 2.x is installed
-begin
- require 'rubygems'
- gem "test-unit", "~> 1.2.3"
-rescue LoadError
-end
-
-begin
- #require "config/environment" unless defined? RAILS_ROOT
- require 'spec/spec_helper'
-rescue LoadError => error
- puts <<-EOS
-
- You need to install rspec in your Redmine project.
- Please execute the following code:
-
- gem install rspec-rails
- script/generate rspec
-
- EOS
- raise error
-end
-
+require 'spec/spec_helper'
require 'redmine_factory_girl'
-require File.expand_path(File.dirname(__FILE__) + "/plugin_spec_helper")
-include RedmineActivityModule::SpecHelper
Please sign in to comment.
Something went wrong with that request. Please try again.