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
require 'redmine' | |
Redmine::Plugin.register :my_plugin_name do | |
name 'My Plugin Name' | |
author 'Eric Davis' | |
url 'https://projects.littlestreamsoftware.com' | |
author_url 'http://www.littlestreamsoftware.com' | |
description "Does stuff" | |
version '0.1.0' | |
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
### init.rb | |
require 'dispatcher' | |
Dispatcher.to_prepare do | |
require 'my_moo_patch' | |
Journal.send(:include, ObserverJournalPatch) | |
end | |
### lib/observer_journal_patch.rb |
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
# | |
# vendor/plugins/redmine_gist/init.rb | |
# | |
require 'redmine' | |
require 'open-uri' | |
Redmine::Plugin.register :redmine_gist do | |
name 'Redmine Gist embed plugin' | |
author 'Yasushi Abe <[email protected]>' | |
description 'This is a plugin for Redmine' |
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
# | |
# vendor/plugins/redmine_youtube/init.rb | |
# | |
require 'redmine' | |
require 'open-uri' | |
Redmine::Plugin.register :redmine_gist do | |
name 'Redmine YouTube plugin' | |
author 'Maxime Rousseaux-Bridle <[email protected]>' | |
description 'Allows a you tube video to be embeded' |
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
desc 'Resets all user passwords to test' | |
namespace :lss do | |
task :reset_passwords => :environment do | |
User.find(:all).each do |user| | |
puts "User #{user.login}" | |
user.password = 'test' | |
user.password_confirmation = 'test' | |
user.save! | |
end |
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
edavis@theadmin:~/tmp$ git clone --bare git://github.com/bvds/andes.git | |
Initialized empty Git repository in /home/edavis/tmp/andes/ | |
remote: Counting objects: 21024, done. | |
remote: Compressing objects: 100% (6919/6919), done. | |
Indexing 21024 objects... | |
remote: Total 21024 (delta 14295), reused 20646 (delta 14002) | |
100% (21024/21024) done | |
Resolving 14295 deltas... | |
100% (14295/14295) done | |
edavis@theadmin:~/tmp$ cd andes/ |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = true | |
[remote "origin"] | |
mirror = true | |
url = git://github.com/edavis10/redmine-timesheet-plugin.git | |
fetch = +refs/*:refs/* |
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
def menu_item_class(selected=false) | |
if selected | |
'alt-selected' | |
else | |
'' | |
end | |
end | |
# Renders the global menu as an unordered list | |
# Returns a string containing the HTML for the global menu |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
ROOT = '/home/git/checkouts/*' | |
Dir[ROOT].each do |path| | |
FileUtils.cd(path, :verbose => true) | |
system("git fetch") | |
end |
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
# Changing the current user's Role | |
def change_role(role, project) | |
# User logged in? | |
if User.current.logged? | |
# Will get the existing Member object or a new one if the User isn't yet a Member of the project | |
member = Member.find_or_initialize_by_user_id_and_project_id(User.current, project.id) | |
member.role = role | |
member.project = project |