This file contains hidden or 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
class RedmineRestrictedStatus::Patches::IssuePatchTest < ActiveSupport::TestCase | |
context "#new_statuses_allowed_to" do | |
setup do | |
@user = User.generate_with_protected!(:password => 'test', :password_confirmation => 'test') | |
@tracker = Tracker.generate! | |
@non_restricted_project = Project.generate!(:trackers => [@tracker]) | |
@restricted_project = Project.generate!(:trackers => [@tracker]) | |
@allowed_status1 = IssueStatus.generate!(:is_default => true) | |
@allowed_status2 = IssueStatus.generate! |
This file contains hidden or 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
module MaintenanceMode | |
def self.included(base) | |
base.class_eval do | |
unloadable | |
prepend_before_filter(:show_maintenance_mode_page) | |
def show_maintenance_mode_page | |
unless User.current.admin? | |
render :text => "This site is currently under maintenance. Please check back later" | |
return false |
This file contains hidden or 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
$ reek -v | |
reek 1.2.7.1 | |
$ reek app/helpers/application_helper.rb | |
^C^C^C^C^CError: (700MB and growing) |
This file contains hidden or 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
module RubyPuppet | |
# This "should" be installed by hand in order to even run this, but | |
# we'd like to keep it up to date | |
def ruby | |
package "ruby1.8", :ensure => :latest | |
package "ruby1.8-dev", :ensure => :latest | |
package "rdoc", :ensure => :latest | |
package "ri", :ensure => :latest | |
package "libopenssl-ruby", :ensure => :latest |
This file contains hidden or 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
# app/models/auth_source_ldap.rb | |
class AuthSourceLdap < AuthSource | |
# ... | |
def authenticate(login, password) | |
return nil if login.blank? || password.blank? | |
attrs = [] | |
# get user's DN | |
ldap_con = initialize_ldap_con(self.account, self.account_password) | |
login_filter = Net::LDAP::Filter.eq( self.attr_login, login ) | |
object_filter = Net::LDAP::Filter.eq( "objectClass", "*" ) |
This file contains hidden or 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
ZIP_FILE = "#{PROJECT}.zip" | |
desc "Zip of the folder for release" | |
task :zip => [:clean] do | |
require 'zip/zip' | |
require 'zip/zipfilesystem' | |
# check to see if the file exists already, and if it does, delete it. | |
if File.file?(ZIP_FILE) |
This file contains hidden or 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
RewriteEngine On | |
# Redirect any non HTTPS requests to the HTTPS server | |
RewriteCond %{HTTP_HOST} ^projects.littlestreamsoftware.com$ [NC] | |
RewriteRule ^(.*)$ https://projects.littlestreamsoftware.com$1 [R=301,L] |
This file contains hidden or 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
## Put inside the Rails apache virtual host | |
# | |
# Check for maintenance file and redirect all requests | |
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ /system/maintenance.html [L] |
This file contains hidden or 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
$ r -D redmine:send_reminders | |
(in /home/edavis/dev/redmine/redmine-core) | |
rake redmine:send_reminders | |
Send reminders about issues due in the next days. | |
Available options: | |
* days => number of days to remind about (defaults to 7) | |
* tracker => id of tracker (defaults to all trackers) | |
* project => id or identifier of project (defaults to all projects) | |
This file contains hidden or 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
module EventNotificationOverride | |
module Patches | |
module UserPreferencePatch | |
def self.included(base) | |
base.class_eval do | |
define_method '[]_with_override' do |attr_name| | |
if attr_name.to_sym == :no_self_notified && | |
Setting.plugin_redmine_event_notification_override['enabled'].to_s == '1' |