Commit 44938026 authored by Sebastian Ziebell's avatar Sebastian Ziebell

Merge branch 'master' into fixes/api

parents 56b32239 644f8819
......@@ -26,3 +26,4 @@ db/data.yml
.chef
vendor/bundle/*
rails_best_practices_output.html
doc/code/*
v 5.0.0
- replaced gitolite with gitlab-shell
- Replaced gitolite with gitlab-shell
v 4.2.0
- Teams
- User show page. Via /u/username
- Show help contents on pages for better navigation
......
......@@ -8,7 +8,7 @@ def linux_only(require_as)
RUBY_PLATFORM.include?('linux') && require_as
end
gem "rails", "3.2.11"
gem "rails", "3.2.12"
# Supported DBs
gem "mysql2", group: :mysql
......
......@@ -69,31 +69,31 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.11)
actionpack (= 3.2.11)
actionmailer (3.2.12)
actionpack (= 3.2.12)
mail (~> 2.4.4)
actionpack (3.2.11)
activemodel (= 3.2.11)
activesupport (= 3.2.11)
actionpack (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.0)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.11)
activesupport (= 3.2.11)
activemodel (3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
activerecord (3.2.11)
activemodel (= 3.2.11)
activesupport (= 3.2.11)
activerecord (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.11)
activemodel (= 3.2.11)
activesupport (= 3.2.11)
activesupport (3.2.11)
activeresource (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
acts-as-taggable-on (2.3.3)
......@@ -237,7 +237,7 @@ GEM
jquery-ui-rails (2.0.2)
jquery-rails
railties (>= 3.1.0)
json (1.7.6)
json (1.7.7)
jwt (0.1.5)
multi_json (>= 1.0)
kaminari (0.14.1)
......@@ -258,10 +258,10 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.1)
mime-types (1.19)
mime-types (1.21)
modernizr (2.6.2)
sprockets (~> 2.0)
multi_json (1.5.0)
multi_json (1.5.1)
multi_xml (0.5.1)
multipart-post (1.1.5)
mysql2 (0.3.11)
......@@ -304,7 +304,7 @@ GEM
pyu-ruby-sasl (0.0.3.3)
quiet_assets (1.0.1)
railties (~> 3.1)
rack (1.4.3)
rack (1.4.5)
rack-accept (0.4.5)
rack (>= 0.4)
rack-cache (1.2)
......@@ -315,18 +315,18 @@ GEM
rack (>= 1.0.0)
rack-protection (1.3.2)
rack
rack-ssl (1.3.2)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.11)
actionmailer (= 3.2.11)
actionpack (= 3.2.11)
activerecord (= 3.2.11)
activeresource (= 3.2.11)
activesupport (= 3.2.11)
rails (3.2.12)
actionmailer (= 3.2.12)
actionpack (= 3.2.12)
activerecord (= 3.2.12)
activeresource (= 3.2.12)
activesupport (= 3.2.12)
bundler (~> 1.0)
railties (= 3.2.11)
railties (= 3.2.12)
rails-dev-tweaks (0.6.1)
actionpack (~> 3.1)
railties (~> 3.1)
......@@ -338,9 +338,9 @@ GEM
erubis
i18n
progressbar
railties (3.2.11)
actionpack (= 3.2.11)
activesupport (= 3.2.11)
railties (3.2.12)
actionpack (= 3.2.12)
activesupport (= 3.2.12)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
......@@ -350,7 +350,7 @@ GEM
rb-fsevent (0.9.2)
rb-inotify (0.8.8)
ffi (>= 0.5.0)
rdoc (3.12)
rdoc (3.12.1)
json (~> 1.4)
redcarpet (2.2.2)
redis (3.0.2)
......@@ -433,7 +433,7 @@ GEM
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.16.0)
thor (0.17.0)
tilt (1.3.3)
timers (1.0.2)
treetop (1.4.12)
......@@ -516,7 +516,7 @@ DEPENDENCIES
pygments.rb!
quiet_assets (~> 1.0.1)
rack-mini-profiler
rails (= 3.2.11)
rails (= 3.2.12)
rails-dev-tweaks
rails_best_practices
raphael-rails!
......
web: bundle exec unicorn_rails -p $PORT
worker: bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,common,default,gitolite
worker: bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,common,default,gitlab_shell
......@@ -36,6 +36,10 @@ $ ->
# Click a .one_click_select field, select the contents
$(".one_click_select").on 'click', -> $(@).select()
# Click a .appear-link, appear-data fadeout
$(".appear-link").on 'click', ->
$('.appear-data').fadeIn()
# Initialize chosen selects
$('select.chosen').chosen()
......
......@@ -564,3 +564,7 @@ img.emoji {
vertical-align: middle;
width: 20px;
}
.appear-data {
display: none;
}
......@@ -52,6 +52,15 @@
padding-left: 5px;
display: inline-block;
color: #555;
.note-file-attach {
margin-left: -25px;
float: left;
.note-image-attach {
margin-left: 0px;
max-width: 200px;
}
}
}
.event-note-icon {
color: #777;
......
......@@ -273,6 +273,7 @@ ul.notes {
}
.note-form-actions {
background: #F9F9F9;
height: 45px;
......
......@@ -34,6 +34,16 @@ module Projects
@project.creator = current_user
# Import project from cloneable resource
if @project.valid? && @project.import_url.present?
shell = Gitlab::Shell.new
if shell.import_repository(@project.path_with_namespace, @project.import_url)
true
else
@project.errors.add(:import_url, 'cannot clone repo')
end
end
if @project.save
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
end
......
......@@ -41,9 +41,7 @@ class Admin::ProjectsController < Admin::ApplicationController
end
def destroy
# Delete team first in order to prevent multiple gitolite calls
@project.team.truncate
@project.destroy
redirect_to admin_projects_path, notice: 'Project was successfully deleted.'
......
class ErrorsController < ApplicationController
def githost
render "errors/gitolite"
end
end
......@@ -93,9 +93,7 @@ class ProjectsController < ProjectResourceController
def destroy
return access_denied! unless can?(current_user, :remove_project, project)
# Delete team first in order to prevent multiple gitolite calls
project.team.truncate
project.destroy
respond_to do |format|
......
......@@ -31,8 +31,6 @@ class Namespace < ActiveRecord::Base
scope :root, where('type IS NULL')
attr_accessor :require_update_gitolite
def self.search query
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
end
......@@ -60,13 +58,13 @@ class Namespace < ActiveRecord::Base
end
def namespace_full_path
@namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
@namespace_full_path ||= File.join(Gitlab.config.gitlab_shell.repos_path, path)
end
def move_dir
if path_changed?
old_path = File.join(Gitlab.config.gitolite.repos_path, path_was)
new_path = File.join(Gitlab.config.gitolite.repos_path, path)
old_path = File.join(Gitlab.config.gitlab_shell.repos_path, path_was)
new_path = File.join(Gitlab.config.gitlab_shell.repos_path, path)
if File.exists?(new_path)
raise "Already exists"
end
......@@ -81,7 +79,6 @@ class Namespace < ActiveRecord::Base
FileUtils.mv( old_path, new_path )
send_update_instructions
@require_update_gitolite = true
rescue Exception => e
raise "Namespace move error #{old_path} #{new_path}"
end
......@@ -89,7 +86,7 @@ class Namespace < ActiveRecord::Base
end
def rm_dir
dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
dir_path = File.join(Gitlab.config.gitlab_shell.repos_path, path)
FileUtils.rm_r( dir_path, force: true )
end
......
......@@ -25,12 +25,13 @@ class Project < ActiveRecord::Base
class TransferError < StandardError; end
attr_accessible :name, :path, :description, :default_branch, :issues_enabled,
:wall_enabled, :merge_requests_enabled, :wiki_enabled, :public, as: [:default, :admin]
attr_accessible :name, :path, :description, :default_branch,
:issues_enabled, :wall_enabled, :merge_requests_enabled,
:wiki_enabled, :public, :import_url, as: [:default, :admin]
attr_accessible :namespace_id, :creator_id, as: :admin
attr_accessor :error_code
attr_accessor :import_url
# Relations
belongs_to :creator, foreign_key: "creator_id", class_name: "User"
......@@ -75,6 +76,10 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :name, scope: :namespace_id
validates_uniqueness_of :path, scope: :namespace_id
validates :import_url,
format: { with: URI::regexp(%w(http https)), message: "should be a valid url" },
if: :import?
validate :check_limit, :repo_name
# Scopes
......@@ -140,14 +145,14 @@ class Project < ActiveRecord::Base
nil
end
def git_error?
error_code == :gitolite
end
def saved?
id && valid?
end
def import?
import_url.present?
end
def check_limit
unless creator.can_create_project?
errors[:base] << ("Your own projects limit is #{creator.projects_limit}! Please contact administrator to increase it")
......@@ -157,7 +162,7 @@ class Project < ActiveRecord::Base
end
def repo_name
denied_paths = %w(gitolite-admin admin dashboard groups help profile projects search)
denied_paths = %w(admin dashboard groups help profile projects search)
if denied_paths.include?(path)
errors.add(:path, "like #{path} is not allowed")
......@@ -450,7 +455,7 @@ class Project < ActiveRecord::Base
end
def url_to_repo
gitolite.url_to_repo(path_with_namespace)
gitlab_shell.url_to_repo(path_with_namespace)
end
def namespace_dir
......
......@@ -25,7 +25,7 @@ class Repository
end
def path_to_repo
@path_to_repo ||= File.join(Gitlab.config.gitolite.repos_path, "#{path_with_namespace}.git")
@path_to_repo ||= File.join(Gitlab.config.gitlab_shell.repos_path, "#{path_with_namespace}.git")
end
def repo
......@@ -60,25 +60,6 @@ class Repository
Commit.commits_between(repo, from, to)
end
def has_post_receive_file?
!!hook_file
end
def valid_post_receive_file?
valid_hook_file == hook_file
end
def valid_hook_file
@valid_hook_file ||= File.read(Rails.root.join('lib', 'hooks', 'post-receive'))
end
def hook_file
@hook_file ||= begin
hook_path = File.join(path_to_repo, 'hooks', 'post-receive')
File.read(hook_path) if File.exists?(hook_path)
end
end
# Returns an Array of branch names
def branch_names
repo.branches.collect(&:name).sort
......
......@@ -2,7 +2,7 @@ class KeyObserver < ActiveRecord::Observer
include Gitolited
def after_save(key)
GitoliteWorker.perform_async(
GitlabShellWorker.perform_async(
:add_key,
key.shell_id,
key.key
......@@ -10,7 +10,7 @@ class KeyObserver < ActiveRecord::Observer
end
def after_destroy(key)
GitoliteWorker.perform_async(
GitlabShellWorker.perform_async(
:remove_key,
key.shell_id,
key.key,
......
class ProjectObserver < ActiveRecord::Observer
def after_create(project)
GitoliteWorker.perform_async(
GitlabShellWorker.perform_async(
:add_repository,
project.path_with_namespace
)
......@@ -13,7 +13,7 @@ class ProjectObserver < ActiveRecord::Observer
end
def after_destroy(project)
GitoliteWorker.perform_async(
GitlabShellWorker.perform_async(
:remove_repository,
project.path_with_namespace
)
......
......@@ -8,6 +8,15 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
def image?
%w(png jpg jpeg).include?(file.extension)
img_ext = %w(png jpg jpeg)
if file.respond_to?(:extension)
img_ext.include?(file.extension)
else
# Not all CarrierWave storages respond to :extension
ext = file.path.split('.').last
img_ext.include?(ext)
end
rescue
false
end
end
......@@ -22,7 +22,7 @@
%b
Path:
%td
%span.monospace= File.join(Gitlab.config.gitolite.repos_path, @group.path)
%span.monospace= File.join(Gitlab.config.gitlab_shell.repos_path, @group.path)
%tr
%td
%b
......
......@@ -4,24 +4,6 @@
%i.icon-edit
Edit
- if @repository && @repository.has_commits?
- if !@repository.has_post_receive_file?
%br
.alert.alert-error
%span
%strong Project has commits but missing post-receive file.
%br
If you exported project manually - make a link of post-receive hook file from gitolite to project repository
- elsif !@repository.valid_post_receive_file?
%br
.alert.alert-error
%span
%strong Project has invalid post-receive file.
%br
1. Make sure your gitolite instace has latest post-receive file.
%br
2. Make a link of post-receive hook file from gitolite to project repository
%br
%table.zebra-striped
......@@ -103,12 +85,6 @@
Last commit at:
%td
= last_commit(@project)
%tr
%td
%b
Post Receive File:
%td
= check_box_tag :post_receive_file, 1, @repository.has_post_receive_file?, disabled: true
%br
%h5
......
%h1.http_status_code 500
%h3.page_title GitLab was unable to access your Gitolite system.
%hr
.git_error_tips
%h4 Tips for Administrator:
%ol
%li
%p
Check git logs in admin area
%li
%p
Check config/gitlab.yml for correct settings.
%li
%p
Diagnostic tool:
%pre
bundle exec rake gitlab:check RAILS_ENV=production
%li
%p
Permissions:
%pre
= preserve do
sudo chown -R git:git #{Gitlab.config.gitolite.repos_path}
sudo chmod -R ug+rwXs #{Gitlab.config.gitolite.repos_path}
......@@ -24,3 +24,11 @@
%i.icon-comment-alt.event-note-icon
%span.event-note
= markdown truncate(event.target.note, length: 70)
- note = event.target
- if note.attachment.url
= link_to note.attachment.url, target: "_blank", class: 'note-file-attach' do
- if note.attachment.image?
= image_tag note.attachment.url, class: 'note-image-attach'
- else
%i.icon-paper-clip
= note.attachment_identifier
......@@ -7,8 +7,6 @@
- if can?(current_user, :download_code, @project)
= render 'shared/no_ssh'
- unless @project.users.include?(current_user)
= render 'shared/not_in_team'
.container
%ul.main_menu
= nav_link(html_options: {class: "home #{project_tab_class}"}) do
......
......@@ -16,6 +16,20 @@
.input
= f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen'}
.clearfix
.input
= link_to "#", class: 'appear-link' do
%i.icon-upload-alt
%span Import existing repository?
.clearfix.appear-data
= f.label :import_url do
%span Import existing repo
.input
= f.text_field :import_url, class: 'xlarge'
.light
URL should be clonable
%p.padded
New projects are private by default. You choose who can see the project and commit to repository.
%hr
......
= render "project_head"
= render 'clone_panel'
%div.git-empty
......
%p.error_message.centered
You won't be able to use git over ssh until you join project on #{link_to 'team page', project_team_index_path(@project)}
:plain
Pager.append(#{@events.count}, "#{escape_javascript(render(@events))}");
class GitoliteWorker
class GitlabShellWorker
include Sidekiq::Worker
include Gitolited
sidekiq_options queue: :gitolite
sidekiq_options queue: :gitlab_shell
def perform(action, *arg)
gitolite.send(action, *arg)
gitlab_shell.send(action, *arg)
end
end
......@@ -5,10 +5,10 @@ class PostReceive
def perform(repo_path, oldrev, newrev, ref, identifier)
if repo_path.start_with?(Gitlab.config.gitolite.repos_path.to_s)
repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "")
if repo_path.start_with?(Gitlab.config.gitlab_shell.repos_path.to_s)
repo_path.gsub!(Gitlab.config.gitlab_shell.repos_path.to_s, "")
else
Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitolite.repos_path variable. \"#{Gitlab.config.gitolite.repos_path}\" does not match \"#{repo_path}\"")
Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitlab_shell.repos_path variable. \"#{Gitlab.config.gitlab_shell.repos_path}\" does not match \"#{repo_path}\"")
end
repo_path.gsub!(/.git$/, "")
......@@ -22,7 +22,8 @@ class PostReceive
end
# Ignore push from non-gitlab users
user = if identifier.eql? Gitlab.config.gitolite.admin_key
user = if identifier.nil?
raise identifier.inspect
email = project.repository.commit(newrev).author.email rescue nil
User.find_by_email(email) if email
elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
......
......@@ -5,8 +5,7 @@
# How to use:
# 1. copy file as gitlab.yml
# 2. Replace gitlab -> host with your domain
# 3. Replace gitolite -> ssh_host with your domain
# 4. Replace gitlab -> email_from
# 3. Replace gitlab -> email_from
#
# 1. GitLab app settings
......@@ -22,8 +21,8 @@ gitlab:
# Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/unicorn.rb may need to be changed
# relative_url_root: /gitlab
# Uncomment and customize if you can't use the default user to run GitLab (default: 'gitlab')
# user: user123
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
# user: git
## Email settings
# Email address used in the "From" field in mails sent by GitLab
......@@ -103,21 +102,18 @@ backup:
path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
# keep_time: 604800 # default: 0 (forever) (in seconds)
## Gitolite settings
gitolite:
## GitLab Shell settings
gitlab_shell:
# REPOS_PATH MUST NOT BE A SYMLINK!!!
repos_path: /home/git/repositories/
hooks_path: /home/git/.gitolite/hooks/
admin_key: gitlab
hooks_path: /home/git/gitlab-shell/hooks/
# Git over HTTP
upload_pack: true
receive_pack: true
ssh_user: git
ssh_host: localhost
# ssh_port: 22
# config_file: gitolite.conf
# Uncomment and customize if you can't use the default group to own the repositories and run Gitolite (default: same as the 'ssh_user' above)
# owner_group: group123
# If you use non-standart ssh port you need to specify it
# ssh_port: 22
## Git settings
# CAUTION!
......
......@@ -8,11 +8,11 @@ class Settings < Settingslogic
private
def build_gitolite_ssh_path_prefix
if gitolite.ssh_port != 22
"ssh://#{gitolite.ssh_user}@#{gitolite.ssh_host}:#{gitolite.ssh_port}/"
def build_gitlab_shell_ssh_path_prefix
if gitlab_shell.ssh_port != 22
"ssh://#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:#{gitlab_shell.ssh_port}/"
else
"#{gitolite.ssh_user}@#{gitolite.ssh_host}:"
"#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:"
end
end
......@@ -41,6 +41,9 @@ Settings['omniauth'] ||= Settingslogic.new({})
Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil?
Settings.omniauth['providers'] ||= []
#
# GitLab
#
Settings['gitlab'] ||= Settingslogic.new({})
Settings.gitlab['default_projects_limit'] ||= 10
Settings.gitlab['host'] ||= 'localhost'
......@@ -54,29 +57,38 @@ Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['signup_enabled'] ||= false
#
# Gravatar
#
Settings['gravatar'] ||= Settingslogic.new({})
Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
Settings.gravatar['plain_url'] ||= 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
Settings['gitolite'] ||= Settingslogic.new({})
Settings.gitolite['admin_key'] ||= 'gitlab'
Settings.gitolite['admin_uri'] ||= 'git@localhost:gitolite-admin'
Settings.gitolite['config_file'] ||= 'gitolite.conf'
Settings.gitolite['hooks_path'] ||= '/home/git/share/gitolite/hooks/'
Settings.gitolite['receive_pack'] = true if Settings.gitolite['receive_pack'].nil?
Settings.gitolite['upload_pack'] = true if Settings.gitolite['upload_pack'].nil?
Settings.gitolite['repos_path'] ||= '/home/git/repositories/'
Settings.gitolite['ssh_host'] ||= (Settings.gitlab.host || 'localhost')
Settings.gitolite['ssh_port'] ||= 22
Settings.gitolite['ssh_user'] ||= 'git'
Settings.gitolite['owner_group'] ||= Settings.gitolite.ssh_user
Settings.gitolite['ssh_path_prefix'] ||= Settings.send(:build_gitolite_ssh_path_prefix)
#
# GitLab Shell
#
Settings['gitlab_shell'] ||= Settingslogic.new({})
Settings.gitlab_shell['hooks_path'] ||= '/home/git/gitlab-shell/hooks/'
Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil?
Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil?
Settings.gitlab_shell['repos_path'] ||= '/home/git/repositories/'
Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.host || 'localhost')
Settings.gitlab_shell['ssh_port'] ||= 22
Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user
Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_ssh_path_prefix)
#
# Backup
#
Settings['backup'] ||= Settingslogic.new({})
Settings.backup['keep_time'] ||= 0
Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root)
#
# Git
#
Settings['git'] ||= Settingslogic.new({})
Settings.git['max_size'] ||= 5242880 # 5.megabytes
Settings.git['bin_path'] ||= '/usr/bin/git'
......
......@@ -19,9 +19,9 @@ Gitlab::Application.routes.draw do
# Enable Grack support
mount Grack::Bundle.new({
git_path: Gitlab.config.git.bin_path,
project_root: Gitlab.config.gitolite.repos_path,
upload_pack: Gitlab.config.gitolite.upload_pack,
receive_pack: Gitlab.config.gitolite.receive_pack
project_root: Gitlab.config.gitlab_shell.repos_path,
upload_pack: Gitlab.config.gitlab_shell.upload_pack,
receive_pack: Gitlab.config.gitlab_shell.receive_pack
}), at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }
#
......
......@@ -13,19 +13,17 @@ projects = [
projects.each do |project|
project_path = File.join(root, project[:path])
next if File.exists?(project_path)
cmds = [
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
"sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
"sudo chown git:git -R #{project_path}",
"sudo chmod 770 -R #{project_path}",
]
if File.exists?(project_path)
print '-'
next
end
cmds.each do |cmd|
puts cmd.yellow
`#{cmd}`
if system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{project[:path]} #{project[:git]}")
print '.'
else
print 'F'
end
end
puts "OK".green
Group.seed(:id, [
{ id: 99, name: "GitLab", path: 'gitlab', owner_id: 1 },
{ id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
{ id: 101, name: "KDE", path: 'kde', owner_id: 1 },
])
Group.seed(:id, [
{ id: 99, name: "GitLab", path: 'gitlab', owner_id: 1 },
{ id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
{ id: 101, name: "KDE", path: 'kde', owner_id: 1 },
])
Project.seed(:id, [
# Global
......
UsersProject.skip_callback(:save, :after, :update_repository)
Gitlab::Seeder.quiet do
(1..300).each do |i|
......@@ -21,9 +19,4 @@ Gitlab::Seeder.quiet do
print('.')
end
end
UsersProject.set_callback(:save, :after, :update_repository)
puts "\nRebuild gitolite\n".yellow
Project.all.each(&:update_repository)
puts "OK".green
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActiveRecord</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Module</span>
ActiveRecord
</h1>
<ul class="files">
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">MODULE</span>
<a href="ActiveRecord/ConnectionAdapters.html">ActiveRecord::ConnectionAdapters</a>
</li>
</ul>
<!-- Methods -->
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActiveRecord::ConnectionAdapters</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Module</span>
ActiveRecord::ConnectionAdapters
</h1>
<ul class="files">
<li><a href="../../files/config/initializers/connection_fix_rb.html">config/initializers/connection_fix.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">CLASS</span>
<a href="ConnectionAdapters/Mysql2Adapter.html">ActiveRecord::ConnectionAdapters::Mysql2Adapter</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="ConnectionAdapters/PostgreSQLAdapter.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</a>
</li>
</ul>
<!-- Methods -->
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActiveRecord::ConnectionAdapters::Mysql2Adapter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
ActiveRecord::ConnectionAdapters::Mysql2Adapter
<span class="parent">&lt;
<a href="../../Object.html">Object</a>
</span>
</h1>
<ul class="files">
<li><a href="../../../files/config/initializers/connection_fix_rb.html">config/initializers/connection_fix.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>E</dt>
<dd>
<ul>
<li>
<a href="#method-i-execute">execute</a>,
</li>
<li>
<a href="#method-i-execute_without_retry">execute_without_retry</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-execute">
<b>execute</b>(*args)
<a href="../../../classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html#method-i-execute" name="method-i-execute" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="aka">
Also aliased as: <a href="Mysql2Adapter.html#method-i-execute_without_retry">execute_without_retry</a>
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-execute_source')" id="l_method-i-execute_source">show</a>
</p>
<div id="method-i-execute_source" class="dyn-source">
<pre><span class="ruby-comment"># File config/initializers/connection_fix.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">execute</span>(*<span class="ruby-identifier">args</span>)
<span class="ruby-identifier">execute_without_retry</span>(*<span class="ruby-identifier">args</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">StatementInvalid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rserver has gone away/</span>
<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;Server timed out, retrying&quot;</span>
<span class="ruby-identifier">reconnect!</span>
<span class="ruby-keyword">retry</span>
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-execute_without_retry">
<b>execute_without_retry</b>(*args)
<a href="../../../classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html#method-i-execute_without_retry" name="method-i-execute_without_retry" class="permalink">Link</a>
</div>
<div class="description">
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
<span class="parent">&lt;
<a href="../../Object.html">Object</a>
</span>
</h1>
<ul class="files">
<li><a href="../../../files/config/initializers/postgresql_limit_fix_rb.html">config/initializers/postgresql_limit_fix.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">CLASS</span>
<a href="PostgreSQLAdapter/TableDefinition.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition</a>
</li>
</ul>
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>A</dt>
<dd>
<ul>
<li>
<a href="#method-i-add_column_with_limit_filter">add_column_with_limit_filter</a>
</li>
</ul>
</dd>
<dt>C</dt>
<dd>
<ul>
<li>
<a href="#method-i-change_column_with_limit_filter">change_column_with_limit_filter</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-add_column_with_limit_filter">
<b>add_column_with_limit_filter</b>(table_name, column_name, type, options = {})
<a href="../../../classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-add_column_with_limit_filter" name="method-i-add_column_with_limit_filter" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-add_column_with_limit_filter_source')" id="l_method-i-add_column_with_limit_filter_source">show</a>
</p>
<div id="method-i-add_column_with_limit_filter_source" class="dyn-source">
<pre><span class="ruby-comment"># File config/initializers/postgresql_limit_fix.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">add_column_with_limit_filter</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:limit</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:text</span>
<span class="ruby-identifier">add_column_without_limit_filter</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-change_column_with_limit_filter">
<b>change_column_with_limit_filter</b>(table_name, column_name, type, options = {})
<a href="../../../classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-change_column_with_limit_filter" name="method-i-change_column_with_limit_filter" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-change_column_with_limit_filter_source')" id="l_method-i-change_column_with_limit_filter_source">show</a>
</p>
<div id="method-i-change_column_with_limit_filter_source" class="dyn-source">
<pre><span class="ruby-comment"># File config/initializers/postgresql_limit_fix.rb, line 18</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">change_column_with_limit_filter</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:limit</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:text</span>
<span class="ruby-identifier">change_column_without_limit_filter</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition
<span class="parent">&lt;
<a href="../../../Object.html">Object</a>
</span>
</h1>
<ul class="files">
<li><a href="../../../../files/config/initializers/postgresql_limit_fix_rb.html">config/initializers/postgresql_limit_fix.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>T</dt>
<dd>
<ul>
<li>
<a href="#method-i-text">text</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-text">
<b>text</b>(*args)
<a href="../../../../classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html#method-i-text" name="method-i-text" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-text_source')" id="l_method-i-text_source">show</a>
</p>
<div id="method-i-text_source" class="dyn-source">
<pre><span class="ruby-comment"># File config/initializers/postgresql_limit_fix.rb, line 4</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">text</span>(*<span class="ruby-identifier">args</span>)
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">extract_options!</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:limit</span>)
<span class="ruby-identifier">column_names</span> = <span class="ruby-identifier">args</span>
<span class="ruby-identifier">type</span> = <span class="ruby-value">:text</span>
<span class="ruby-identifier">column_names</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">column</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>) }
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ActivityObserver</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
ActivityObserver
<span class="parent">&lt;
ActiveRecord::Observer
</span>
</h1>
<ul class="files">
<li><a href="../files/app/observers/activity_observer_rb.html">app/observers/activity_observer.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>A</dt>
<dd>
<ul>
<li>
<a href="#method-i-after_create">after_create</a>,
</li>
<li>
<a href="#method-i-after_save">after_save</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-after_create">
<b>after_create</b>(record)
<a href="../classes/ActivityObserver.html#method-i-after_create" name="method-i-after_create" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-after_create_source')" id="l_method-i-after_create_source">show</a>
</p>
<div id="method-i-after_create_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/observers/activity_observer.rb, line 4</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">after_create</span>(<span class="ruby-identifier">record</span>)
<span class="ruby-identifier">event_author_id</span> = <span class="ruby-identifier">record</span>.<span class="ruby-identifier">author_id</span>
<span class="ruby-comment"># Skip status notes</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Note</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">note</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;_Status changed to &quot;</span>)
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">event_author_id</span>
<span class="ruby-constant">Event</span>.<span class="ruby-identifier">create</span>(
<span class="ruby-identifier">project</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">project</span>,
<span class="ruby-identifier">target_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">id</span>,
<span class="ruby-identifier">target_type</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>,
<span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-constant">Event</span>.<span class="ruby-identifier">determine_action</span>(<span class="ruby-identifier">record</span>),
<span class="ruby-identifier">author_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">event_author_id</span>
)
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-after_save">
<b>after_save</b>(record)
<a href="../classes/ActivityObserver.html#method-i-after_save" name="method-i-after_save" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-after_save_source')" id="l_method-i-after_save_source">show</a>
</p>
<div id="method-i-after_save_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/observers/activity_observer.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">after_save</span>(<span class="ruby-identifier">record</span>)
<span class="ruby-keyword">if</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">changed</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;closed&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">author_id_of_changes</span>
<span class="ruby-constant">Event</span>.<span class="ruby-identifier">create</span>(
<span class="ruby-identifier">project</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">project</span>,
<span class="ruby-identifier">target_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">id</span>,
<span class="ruby-identifier">target_type</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>,
<span class="ruby-identifier">action</span><span class="ruby-operator">:</span> (<span class="ruby-identifier">record</span>.<span class="ruby-identifier">closed</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Closed</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Reopened</span>),
<span class="ruby-identifier">author_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">author_id_of_changes</span>
)
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Module</span>
Admin
</h1>
<ul class="files">
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">CLASS</span>
<a href="Admin/DashboardController.html">Admin::DashboardController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/GroupsController.html">Admin::GroupsController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/HooksController.html">Admin::HooksController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/LogsController.html">Admin::LogsController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/ProjectsController.html">Admin::ProjectsController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/ResqueController.html">Admin::ResqueController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/TeamMembersController.html">Admin::TeamMembersController</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="Admin/UsersController.html">Admin::UsersController</a>
</li>
</ul>
<!-- Methods -->
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin::DashboardController</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
Admin::DashboardController
<span class="parent">&lt;
<a href="../AdminController.html">AdminController</a>
</span>
</h1>
<ul class="files">
<li><a href="../../files/app/controllers/admin/dashboard_controller_rb.html">app/controllers/admin/dashboard_controller.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>I</dt>
<dd>
<ul>
<li>
<a href="#method-i-index">index</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-index">
<b>index</b>()
<a href="../../classes/Admin/DashboardController.html#method-i-index" name="method-i-index" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-index_source')" id="l_method-i-index_source">show</a>
</p>
<div id="method-i-index_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/controllers/admin/dashboard_controller.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
<span class="ruby-ivar">@projects</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">order</span>(<span class="ruby-string">&quot;created_at DESC&quot;</span>).<span class="ruby-identifier">limit</span>(<span class="ruby-number">10</span>)
<span class="ruby-ivar">@users</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">order</span>(<span class="ruby-string">&quot;created_at DESC&quot;</span>).<span class="ruby-identifier">limit</span>(<span class="ruby-number">10</span>)
<span class="ruby-ivar">@resque_accessible</span> = <span class="ruby-keyword">true</span>
<span class="ruby-ivar">@workers</span> = <span class="ruby-constant">Resque</span>.<span class="ruby-identifier">workers</span>
<span class="ruby-ivar">@pending_jobs</span> = <span class="ruby-constant">Resque</span>.<span class="ruby-identifier">size</span>(<span class="ruby-value">:post_receive</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Redis</span><span class="ruby-operator">::</span><span class="ruby-constant">InheritedError</span>
<span class="ruby-ivar">@resque_accessible</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin::LogsController</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
Admin::LogsController
<span class="parent">&lt;
<a href="../AdminController.html">AdminController</a>
</span>
</h1>
<ul class="files">
<li><a href="../../files/app/controllers/admin/logs_controller_rb.html">app/controllers/admin/logs_controller.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Methods -->
</div>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin::ResqueController</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
Admin::ResqueController
<span class="parent">&lt;
<a href="../AdminController.html">AdminController</a>
</span>
</h1>
<ul class="files">
<li><a href="../../files/app/controllers/admin/resque_controller_rb.html">app/controllers/admin/resque_controller.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>S</dt>
<dd>
<ul>
<li>
<a href="#method-i-show">show</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-show">
<b>show</b>()
<a href="../../classes/Admin/ResqueController.html#method-i-show" name="method-i-show" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-show_source')" id="l_method-i-show_source">show</a>
</p>
<div id="method-i-show_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/controllers/admin/resque_controller.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment