Permalink
Browse files

Adding plugin skeleton and docs

  • Loading branch information...
1 parent e72cf5b commit 212127962ada110c654b160d8bea45d51a649003 @edavis10 committed Oct 27, 2010
Showing with 480 additions and 0 deletions.
  1. +18 −0 COPYRIGHT.txt
  2. +4 −0 CREDITS.txt
  3. +339 −0 GPL.txt
  4. +31 −0 README.rdoc
  5. +12 −0 Rakefile
  6. +3 −0 autotest/discover.rb
  7. +73 −0 test/test_helper.rb
View
@@ -0,0 +1,18 @@
+Redmine Bots Filter is a plugin that Prevent common bots and web spiders
+from accessing parts of Redmine
+
+Copyright (C) 2009 Jean-Philippe Lang
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
View
@@ -0,0 +1,4 @@
+Thanks go to the following people for patches and contributions:
+
+* Jean-Philippe Lang - Maintainer
+* Eric Davis - Developer
View
Oops, something went wrong.
View
@@ -0,0 +1,31 @@
+= Redmine Bots Filter
+
+Prevent common bots and web spiders from accessing parts of Redmine
+
+== Features
+
+TODO: fill in features
+
+== Getting the plugin
+
+A copy of the plugin can be downloaded from {Redmine}[http://www.redmine.org/wiki/redmine/PluginBotsFilter] or from {GitHub}[http://github.com/edavis10/redmine_bots_filter]
+
+
+== Installation and Setup
+
+1. Follow the Redmine plugin installation steps at: http://www.redmine.org/wiki/redmine/Plugins
+2. Run the plugin migrations +rake db:migrate_plugins+
+3. Restart your Redmine web servers (e.g. mongrel, thin, mod_rails)
+
+== Usage
+
+TODO: Add usage
+
+== License
+
+This plugin is licensed under the GNU GPL v2. See COPYRIGHT.txt and GPL.txt for details.
+
+== Project help
+
+If you need help you can contact the maintainer at the Bug Tracker. The bug tracker is located at http://www.redmine.org
+
View
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+require 'redmine_plugin_support'
+
+Dir[File.expand_path(File.dirname(__FILE__)) + "/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
+
+RedminePluginSupport::Base.setup do |plugin|
+ plugin.project_name = 'redmine_bots_filter'
+ plugin.default_task = [:test]
+ plugin.tasks = [:db, :doc, :release, :clean, :test, :stats, :metrics]
+ # TODO: gem not getting this automaticly
+ plugin.redmine_root = File.expand_path(File.dirname(__FILE__) + '/../../../')
+end
@@ -0,0 +1,3 @@
+Autotest.add_discovery do
+ "rails"
+end
View
@@ -0,0 +1,73 @@
+# Load the normal Rails helper
+require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
+
+# Ensure that we are using the temporary fixture path
+Engines::Testing.set_fixture_path
+
+require "webrat"
+
+Webrat.configure do |config|
+ config.mode = :rails
+end
+
+def User.add_to_project(user, project, role)
+ Member.generate!(:principal => user, :project => project, :roles => [role])
+end
+
+module RedmineWebratHelper
+ def login_as(user="existing", password="existing")
+ visit "/login"
+ fill_in 'Login', :with => user
+ fill_in 'Password', :with => password
+ click_button 'login'
+ assert_response :success
+ assert User.current.logged?
+ end
+
+ def visit_project(project)
+ visit '/'
+ assert_response :success
+
+ click_link 'Projects'
+ assert_response :success
+
+ click_link project.name
+ assert_response :success
+ end
+
+ def visit_issue_page(issue)
+ visit '/issues/' + issue.id.to_s
+ end
+
+ def visit_issue_bulk_edit_page(issues)
+ visit url_for(:controller => 'issues', :action => 'bulk_edit', :ids => issues.collect(&:id))
+ end
+
+ # Cleanup current_url to remove the host; sometimes it's present, sometimes it's not
+ def current_path
+ return nil if current_url.nil?
+ return current_url.gsub("http://www.example.com","")
+ end
+
+end
+
+class ActionController::IntegrationTest
+ include RedmineWebratHelper
+end
+
+class ActiveSupport::TestCase
+ def assert_forbidden
+ assert_response :forbidden
+ assert_template 'common/403'
+ end
+
+ def configure_plugin(configuration_change={})
+ Setting.plugin_TODO = {
+
+ }.merge(configuration_change)
+ end
+
+ def reconfigure_plugin(configuration_change)
+ Settings['plugin_TODO'] = Setting['plugin_TODO'].merge(configuration_change)
+ end
+end

0 comments on commit 2121279

Please sign in to comment.