Merge branch 'master' into fixes/api
This commit is contained in:
commit
449380265a
461 changed files with 300 additions and 76690 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -26,3 +26,4 @@ db/data.yml
|
|||
.chef
|
||||
vendor/bundle/*
|
||||
rails_best_practices_output.html
|
||||
doc/code/*
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
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
|
||||
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -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
|
||||
|
|
66
Gemfile.lock
66
Gemfile.lock
|
@ -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!
|
||||
|
|
2
Procfile
2
Procfile
|
@ -1,2 +1,2 @@
|
|||
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.'
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
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,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
%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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
= render "project_head"
|
||||
= render 'clone_panel'
|
||||
|
||||
%div.git-empty
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
%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)}
|
2
app/views/teams/show.js.haml
Normal file
2
app/views/teams/show.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
:plain
|
||||
Pager.append(#{@events.count}, "#{escape_javascript(render(@events))}");
|
10
app/workers/gitlab_shell_worker.rb
Normal file
10
app/workers/gitlab_shell_worker.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class GitlabShellWorker
|
||||
include Sidekiq::Worker
|
||||
include Gitolited
|
||||
|
||||
sidekiq_options queue: :gitlab_shell
|
||||
|
||||
def perform(action, *arg)
|
||||
gitlab_shell.send(action, *arg)
|
||||
end
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
class GitoliteWorker
|
||||
include Sidekiq::Worker
|
||||
include Gitolited
|
||||
|
||||
sidekiq_options queue: :gitolite
|
||||
|
||||
def perform(action, *arg)
|
||||
gitolite.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)
|
||||
if File.exists?(project_path)
|
||||
print '-'
|
||||
next
|
||||
end
|
||||
|
||||
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}",
|
||||
]
|
||||
|
||||
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
|
||||
|
5
db/fixtures/development/03_group.rb
Normal file
5
db/fixtures/development/03_group.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
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 },
|
||||
])
|
|
@ -1,9 +1,3 @@
|
|||
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
|
|
@ -1,5 +1,3 @@
|
|||
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
|
Binary file not shown.
Before Width: | Height: | Size: 84 KiB |
|
@ -1,507 +0,0 @@
|
|||
<?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>Ability</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>
|
||||
Ability
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Object
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/models/ability_rb.html">app/models/ability.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-c-allowed">allowed</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-group_abilities">group_abilities</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_abilities">project_abilities</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_admin_rules">project_admin_rules</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_dev_rules">project_dev_rules</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_guest_rules">project_guest_rules</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_master_rules">project_master_rules</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-project_report_rules">project_report_rules</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Class Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-allowed">
|
||||
|
||||
<b>allowed</b>(object, subject)
|
||||
|
||||
<a href="../classes/Ability.html#method-c-allowed" name="method-c-allowed" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-allowed_source')" id="l_method-c-allowed_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-allowed_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 3</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">allowed</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">case</span> <span class="ruby-identifier">subject</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"Project"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">project_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"Issue"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">issue_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"Note"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">note_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"Snippet"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">snippet_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"MergeRequest"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">merge_request_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">"Group"</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">group_abilities</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">else</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-c-group_abilities">
|
||||
|
||||
<b>group_abilities</b>(user, group)
|
||||
|
||||
<a href="../classes/Ability.html#method-c-group_abilities" name="method-c-group_abilities" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-group_abilities_source')" id="l_method-c-group_abilities_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-group_abilities_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 107</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">group_abilities</span> <span class="ruby-identifier">user</span>, <span class="ruby-identifier">group</span>
|
||||
<span class="ruby-identifier">rules</span> = []
|
||||
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> [
|
||||
<span class="ruby-value">:manage_group</span>
|
||||
] <span class="ruby-keyword">if</span> <span class="ruby-identifier">group</span>.<span class="ruby-identifier">owner</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">user</span>
|
||||
|
||||
<span class="ruby-identifier">rules</span>.<span class="ruby-identifier">flatten</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_abilities">
|
||||
|
||||
<b>project_abilities</b>(user, project)
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_abilities" name="method-c-project_abilities" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_abilities_source')" id="l_method-c-project_abilities_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_abilities_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 15</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_abilities</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">project</span>)
|
||||
<span class="ruby-identifier">rules</span> = []
|
||||
|
||||
<span class="ruby-comment"># Rules based on role in project</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">master_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_master_rules</span>
|
||||
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">dev_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_dev_rules</span>
|
||||
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">report_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_report_rules</span>
|
||||
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">guest_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_guest_rules</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">namespace</span>
|
||||
<span class="ruby-comment"># If user own project namespace</span>
|
||||
<span class="ruby-comment"># (Ex. group owner or account owner)</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">owner</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">user</span>
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_admin_rules</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-comment"># For compatibility with global projects</span>
|
||||
<span class="ruby-comment"># use projects.owner_id</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">owner</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">user</span>
|
||||
<span class="ruby-identifier">rules</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">project_admin_rules</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
|
||||
<span class="ruby-identifier">rules</span>.<span class="ruby-identifier">flatten</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_admin_rules">
|
||||
|
||||
<b>project_admin_rules</b>()
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_admin_rules" name="method-c-project_admin_rules" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_admin_rules_source')" id="l_method-c-project_admin_rules_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_admin_rules_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 99</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_admin_rules</span>
|
||||
<span class="ruby-identifier">project_master_rules</span> <span class="ruby-operator">+</span> [
|
||||
<span class="ruby-value">:change_namespace</span>,
|
||||
<span class="ruby-value">:rename_project</span>,
|
||||
<span class="ruby-value">:remove_project</span>
|
||||
]
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_dev_rules">
|
||||
|
||||
<b>project_dev_rules</b>()
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_dev_rules" name="method-c-project_dev_rules" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_dev_rules_source')" id="l_method-c-project_dev_rules_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_dev_rules_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 74</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_dev_rules</span>
|
||||
<span class="ruby-identifier">project_report_rules</span> <span class="ruby-operator">+</span> [
|
||||
<span class="ruby-value">:write_wiki</span>,
|
||||
<span class="ruby-value">:push_code</span>
|
||||
]
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_guest_rules">
|
||||
|
||||
<b>project_guest_rules</b>()
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_guest_rules" name="method-c-project_guest_rules" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_guest_rules_source')" id="l_method-c-project_guest_rules_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_guest_rules_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 50</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_guest_rules</span>
|
||||
[
|
||||
<span class="ruby-value">:read_project</span>,
|
||||
<span class="ruby-value">:read_wiki</span>,
|
||||
<span class="ruby-value">:read_issue</span>,
|
||||
<span class="ruby-value">:read_milestone</span>,
|
||||
<span class="ruby-value">:read_snippet</span>,
|
||||
<span class="ruby-value">:read_team_member</span>,
|
||||
<span class="ruby-value">:read_merge_request</span>,
|
||||
<span class="ruby-value">:read_note</span>,
|
||||
<span class="ruby-value">:write_project</span>,
|
||||
<span class="ruby-value">:write_issue</span>,
|
||||
<span class="ruby-value">:write_note</span>
|
||||
]
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_master_rules">
|
||||
|
||||
<b>project_master_rules</b>()
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_master_rules" name="method-c-project_master_rules" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_master_rules_source')" id="l_method-c-project_master_rules_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_master_rules_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 81</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_master_rules</span>
|
||||
<span class="ruby-identifier">project_dev_rules</span> <span class="ruby-operator">+</span> [
|
||||
<span class="ruby-value">:push_code_to_protected_branches</span>,
|
||||
<span class="ruby-value">:modify_issue</span>,
|
||||
<span class="ruby-value">:modify_snippet</span>,
|
||||
<span class="ruby-value">:modify_merge_request</span>,
|
||||
<span class="ruby-value">:admin_issue</span>,
|
||||
<span class="ruby-value">:admin_milestone</span>,
|
||||
<span class="ruby-value">:admin_snippet</span>,
|
||||
<span class="ruby-value">:admin_team_member</span>,
|
||||
<span class="ruby-value">:admin_merge_request</span>,
|
||||
<span class="ruby-value">:admin_note</span>,
|
||||
<span class="ruby-value">:accept_mr</span>,
|
||||
<span class="ruby-value">:admin_wiki</span>,
|
||||
<span class="ruby-value">:admin_project</span>
|
||||
]
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-project_report_rules">
|
||||
|
||||
<b>project_report_rules</b>()
|
||||
|
||||
<a href="../classes/Ability.html#method-c-project_report_rules" name="method-c-project_report_rules" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-project_report_rules_source')" id="l_method-c-project_report_rules_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-project_report_rules_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/models/ability.rb, line 66</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_report_rules</span>
|
||||
<span class="ruby-identifier">project_guest_rules</span> <span class="ruby-operator">+</span> [
|
||||
<span class="ruby-value">:download_code</span>,
|
||||
<span class="ruby-value">:write_merge_request</span>,
|
||||
<span class="ruby-value">:write_snippet</span>
|
||||
]
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,79 +0,0 @@
|
|||
<?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>
|
|
@ -1,86 +0,0 @@
|
|||
<?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>
|
|
@ -1,167 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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">></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">"Server timed out, retrying"</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>
|
|
@ -1,191 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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>
|
|
@ -1,135 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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>
|
|
@ -1,194 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
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">&&</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">note</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">"_Status changed to "</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">"closed"</span>) <span class="ruby-operator">&&</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>
|
|
@ -1,114 +0,0 @@
|
|||
<?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>
|
|
@ -1,139 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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">"created_at DESC"</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">"created_at DESC"</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>
|
|
@ -1,586 +0,0 @@
|
|||
<?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::GroupsController</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::GroupsController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="../AdminController.html">AdminController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/app/controllers/admin/groups_controller_rb.html">app/controllers/admin/groups_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create">create</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-edit">edit</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-project_teams_update">project_teams_update</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-project_update">project_update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>R</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-remove_project">remove_project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>S</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-show">show</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-update">update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-create">
|
||||
|
||||
<b>create</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 26</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create</span>
|
||||
<span class="ruby-ivar">@group</span> = <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:group</span>])
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">path</span> = <span class="ruby-ivar">@group</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">parameterize</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@group</span>.<span class="ruby-identifier">name</span>
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">owner</span> = <span class="ruby-identifier">current_user</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@group</span>.<span class="ruby-identifier">save</span>
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@group</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Group was successfully created.'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"new"</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-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 75</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">truncate_teams</span>
|
||||
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_groups_path</span>, <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Group was successfully deleted.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-edit">
|
||||
|
||||
<b>edit</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-edit" name="method-i-edit" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-edit_source')" id="l_method-i-edit_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-edit_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 23</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">edit</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.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/groups_controller.rb, line 4</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-ivar">@groups</span> = <span class="ruby-constant">Group</span>.<span class="ruby-identifier">order</span>(<span class="ruby-string">'name ASC'</span>)
|
||||
<span class="ruby-ivar">@groups</span> = <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@groups</span> = <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-number">20</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-new">
|
||||
|
||||
<b>new</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-new" name="method-i-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-new_source')" id="l_method-i-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 19</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">new</span>
|
||||
<span class="ruby-ivar">@group</span> = <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-project_teams_update">
|
||||
|
||||
<b>project_teams_update</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-project_teams_update" name="method-i-project_teams_update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-project_teams_update_source')" id="l_method-i-project_teams_update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-project_teams_update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 70</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_teams_update</span>
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">add_users_to_project_teams</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:user_ids</span>], <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_access</span>])
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@group</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Users was successfully added.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-project_update">
|
||||
|
||||
<b>project_update</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-project_update" name="method-i-project_update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-project_update_source')" id="l_method-i-project_update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-project_update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 53</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_update</span>
|
||||
<span class="ruby-identifier">project_ids</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_ids</span>]
|
||||
|
||||
<span class="ruby-constant">Project</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_ids</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">project</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">transfer</span>(<span class="ruby-ivar">@group</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Group was successfully updated.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-remove_project">
|
||||
|
||||
<b>remove_project</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-remove_project" name="method-i-remove_project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-remove_project_source')" id="l_method-i-remove_project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-remove_project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 63</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remove_project</span>
|
||||
<span class="ruby-ivar">@project</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>])
|
||||
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">transfer</span>(<span class="ruby-keyword">nil</span>)
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Group was successfully updated.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show">
|
||||
|
||||
<b>show</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.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/groups_controller.rb, line 10</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">scoped</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">not_in_group</span>(<span class="ruby-ivar">@group</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@group</span>.<span class="ruby-identifier">projects</span>.<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">reject!</span>(&<span class="ruby-value">:empty_repo?</span>)
|
||||
|
||||
<span class="ruby-ivar">@users</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">active</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-update">
|
||||
|
||||
<b>update</b>()
|
||||
|
||||
<a href="../../classes/Admin/GroupsController.html#method-i-update" name="method-i-update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-update_source')" id="l_method-i-update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/groups_controller.rb, line 38</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">update</span>
|
||||
<span class="ruby-identifier">group_params</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:group</span>].<span class="ruby-identifier">dup</span>
|
||||
<span class="ruby-identifier">owner_id</span> =<span class="ruby-identifier">group_params</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:owner_id</span>)
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">owner_id</span>
|
||||
<span class="ruby-ivar">@group</span>.<span class="ruby-identifier">owner</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">owner_id</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@group</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-identifier">group_params</span>)
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@group</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Group was successfully updated.'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"edit"</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,294 +0,0 @@
|
|||
<?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::HooksController</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::HooksController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="../AdminController.html">AdminController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/app/controllers/admin/hooks_controller_rb.html">app/controllers/admin/hooks_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create">create</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>T</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-test">test</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-create">
|
||||
|
||||
<b>create</b>()
|
||||
|
||||
<a href="../../classes/Admin/HooksController.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/hooks_controller.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create</span>
|
||||
<span class="ruby-ivar">@hook</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:hook</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@hook</span>.<span class="ruby-identifier">save</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_hooks_path</span>, <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Hook was successfully created.'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-ivar">@hooks</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-value">:index</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-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../../classes/Admin/HooksController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/hooks_controller.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-ivar">@hook</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-ivar">@hook</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_hooks_path</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../../classes/Admin/HooksController.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/hooks_controller.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-ivar">@hooks</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-ivar">@hook</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">new</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-test">
|
||||
|
||||
<b>test</b>()
|
||||
|
||||
<a href="../../classes/Admin/HooksController.html#method-i-test" name="method-i-test" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-test_source')" id="l_method-i-test_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-test_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/hooks_controller.rb, line 26</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">test</span>
|
||||
<span class="ruby-ivar">@hook</span> = <span class="ruby-constant">SystemHook</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:hook_id</span>])
|
||||
<span class="ruby-identifier">data</span> = {
|
||||
<span class="ruby-identifier">event_name</span><span class="ruby-operator">:</span> <span class="ruby-string">"project_create"</span>,
|
||||
<span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-string">"Ruby"</span>,
|
||||
<span class="ruby-identifier">path</span><span class="ruby-operator">:</span> <span class="ruby-string">"ruby"</span>,
|
||||
<span class="ruby-identifier">project_id</span><span class="ruby-operator">:</span> <span class="ruby-number">1</span>,
|
||||
<span class="ruby-identifier">owner_name</span><span class="ruby-operator">:</span> <span class="ruby-string">"Someone"</span>,
|
||||
<span class="ruby-identifier">owner_email</span><span class="ruby-operator">:</span> <span class="ruby-string">"example@gitlabhq.com"</span>
|
||||
}
|
||||
<span class="ruby-ivar">@hook</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">data</span>)
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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>
|
|
@ -1,436 +0,0 @@
|
|||
<?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::ProjectsController</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::ProjectsController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="../AdminController.html">AdminController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/app/controllers/admin/projects_controller_rb.html">app/controllers/admin/projects_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-edit">edit</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-project">project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>S</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-show">show</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>T</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-team_update">team_update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-update">update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/projects_controller.rb, line 37</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-comment"># Delete team first in order to prevent multiple gitolite calls</span>
|
||||
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">truncate_team</span>
|
||||
|
||||
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_projects_path</span>, <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Project was successfully deleted.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-edit">
|
||||
|
||||
<b>edit</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.html#method-i-edit" name="method-i-edit" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-edit_source')" id="l_method-i-edit_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-edit_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/projects_controller.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">edit</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.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/projects_controller.rb, line 4</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">scoped</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">namespace_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:namespace_id</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:namespace_id</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">namespace_id</span><span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:namespace_id</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">global_id</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">includes</span>(<span class="ruby-value">:namespace</span>).<span class="ruby-identifier">order</span>(<span class="ruby-string">"namespaces.path, projects.name ASC"</span>).<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-number">20</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show">
|
||||
|
||||
<b>show</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.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/projects_controller.rb, line 12</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@users</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">active</span>
|
||||
<span class="ruby-ivar">@users</span> = <span class="ruby-ivar">@users</span>.<span class="ruby-identifier">not_in_project</span>(<span class="ruby-ivar">@project</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">users</span>.<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@users</span> = <span class="ruby-ivar">@users</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-team_update">
|
||||
|
||||
<b>team_update</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.html#method-i-team_update" name="method-i-team_update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-team_update_source')" id="l_method-i-team_update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-team_update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/projects_controller.rb, line 21</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">team_update</span>
|
||||
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">add_users_ids_to_team</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:user_ids</span>], <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_access</span>])
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@project</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Project was successfully updated.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-update">
|
||||
|
||||
<b>update</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.html#method-i-update" name="method-i-update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-update_source')" id="l_method-i-update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/projects_controller.rb, line 27</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">update</span>
|
||||
<span class="ruby-identifier">status</span> = <span class="ruby-constant">ProjectUpdateContext</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">project</span>, <span class="ruby-identifier">current_user</span>, <span class="ruby-identifier">params</span>).<span class="ruby-identifier">execute</span>(<span class="ruby-value">:admin</span>)
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">status</span>
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@project</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Project was successfully updated.'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"edit"</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Protected methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-project">
|
||||
|
||||
<b>project</b>()
|
||||
|
||||
<a href="../../classes/Admin/ProjectsController.html#method-i-project" name="method-i-project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-project_source')" id="l_method-i-project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/projects_controller.rb, line 48</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project</span>
|
||||
<span class="ruby-identifier">id</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]
|
||||
|
||||
<span class="ruby-ivar">@project</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">find_with_namespace</span>(<span class="ruby-identifier">id</span>)
|
||||
<span class="ruby-ivar">@project</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">render_404</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,130 +0,0 @@
|
|||
<?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"><
|
||||
|
||||
<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>
|
|
@ -1,234 +0,0 @@
|
|||
<?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::TeamMembersController</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::TeamMembersController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="../AdminController.html">AdminController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/app/controllers/admin/team_members_controller_rb.html">app/controllers/admin/team_members_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-edit">edit</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-update">update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../../classes/Admin/TeamMembersController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/team_members_controller.rb, line 16</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-ivar">@admin_team_member</span> = <span class="ruby-constant">UsersProject</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-ivar">@admin_team_member</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-edit">
|
||||
|
||||
<b>edit</b>()
|
||||
|
||||
<a href="../../classes/Admin/TeamMembersController.html#method-i-edit" name="method-i-edit" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-edit_source')" id="l_method-i-edit_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-edit_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/team_members_controller.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">edit</span>
|
||||
<span class="ruby-ivar">@admin_team_member</span> = <span class="ruby-constant">UsersProject</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-update">
|
||||
|
||||
<b>update</b>()
|
||||
|
||||
<a href="../../classes/Admin/TeamMembersController.html#method-i-update" name="method-i-update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-update_source')" id="l_method-i-update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/team_members_controller.rb, line 6</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">update</span>
|
||||
<span class="ruby-ivar">@admin_team_member</span> = <span class="ruby-constant">UsersProject</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_team_member</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:team_member</span>])
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@admin_team_member</span>.<span class="ruby-identifier">project</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Project Access was successfully updated.'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"edit"</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,616 +0,0 @@
|
|||
<?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::UsersController</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::UsersController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="../AdminController.html">AdminController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/app/controllers/admin/users_controller_rb.html">app/controllers/admin/users_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>B</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-block">block</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create">create</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-edit">edit</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>S</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-show">show</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>T</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-team_update">team_update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-unblock">unblock</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-update">update</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-block">
|
||||
|
||||
<b>block</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-block" name="method-i-block" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-block_source')" id="l_method-i-block_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-block_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 40</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">block</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">block</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">alert</span><span class="ruby-operator">:</span> <span class="ruby-string">"Successfully blocked"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">alert</span><span class="ruby-operator">:</span> <span class="ruby-string">"Error occured. User was not blocked"</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-create">
|
||||
|
||||
<b>create</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 60</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create</span>
|
||||
<span class="ruby-identifier">admin</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-string">"admin"</span>)
|
||||
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>], <span class="ruby-identifier">as</span><span class="ruby-operator">:</span> <span class="ruby-value">:admin</span>)
|
||||
<span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">admin</span> = (<span class="ruby-identifier">admin</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">admin</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-number">0</span>)
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">save</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@admin_user</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'User was successfully created.'</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">json</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@admin_user</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-value">:created</span>, <span class="ruby-identifier">location</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@admin_user</span> }
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"new"</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">json</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">errors</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-value">:unprocessable_entity</span> }
|
||||
<span class="ruby-keyword">end</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-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 99</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">my_own_projects</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">></span> <span class="ruby-number">0</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_users_path</span>, <span class="ruby-identifier">alert</span><span class="ruby-operator">:</span> <span class="ruby-string">"User is a project owner and can't be removed."</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">return</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">admin_users_url</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">head</span> <span class="ruby-value">:ok</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-edit">
|
||||
|
||||
<b>edit</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-edit" name="method-i-edit" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-edit_source')" id="l_method-i-edit_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-edit_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 36</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">edit</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.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/users_controller.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-ivar">@admin_users</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">scoped</span>
|
||||
<span class="ruby-ivar">@admin_users</span> = <span class="ruby-ivar">@admin_users</span>.<span class="ruby-identifier">filter</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:filter</span>])
|
||||
<span class="ruby-ivar">@admin_users</span> = <span class="ruby-ivar">@admin_users</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:name</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-ivar">@admin_users</span> = <span class="ruby-ivar">@admin_users</span>.<span class="ruby-identifier">alphabetically</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-new">
|
||||
|
||||
<b>new</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-new" name="method-i-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-new_source')" id="l_method-i-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 32</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">new</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>({ <span class="ruby-identifier">projects_limit</span><span class="ruby-operator">:</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">gitlab</span>.<span class="ruby-identifier">default_projects_limit</span> }, <span class="ruby-identifier">as</span><span class="ruby-operator">:</span> <span class="ruby-value">:admin</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show">
|
||||
|
||||
<b>show</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.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/users_controller.rb, line 9</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">projects</span>.<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-constant">Project</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-constant">Project</span>.<span class="ruby-identifier">without_user</span>(<span class="ruby-ivar">@admin_user</span>)
|
||||
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-team_update">
|
||||
|
||||
<b>team_update</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-team_update" name="method-i-team_update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-team_update_source')" id="l_method-i-team_update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-team_update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 19</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">team_update</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-constant">UsersProject</span>.<span class="ruby-identifier">user_bulk_import</span>(
|
||||
<span class="ruby-ivar">@admin_user</span>,
|
||||
<span class="ruby-identifier">params</span>[<span class="ruby-value">:project_ids</span>],
|
||||
<span class="ruby-identifier">params</span>[<span class="ruby-value">:project_access</span>]
|
||||
)
|
||||
|
||||
<span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@admin_user</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'Teams were successfully updated.'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-unblock">
|
||||
|
||||
<b>unblock</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-unblock" name="method-i-unblock" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-unblock_source')" id="l_method-i-unblock_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-unblock_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 50</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">unblock</span>
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">update_attribute</span>(<span class="ruby-value">:blocked</span>, <span class="ruby-keyword">false</span>)
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">alert</span><span class="ruby-operator">:</span> <span class="ruby-string">"Successfully unblocked"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:back</span>, <span class="ruby-identifier">alert</span><span class="ruby-operator">:</span> <span class="ruby-string">"Error occured. User was not unblocked"</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-update">
|
||||
|
||||
<b>update</b>()
|
||||
|
||||
<a href="../../classes/Admin/UsersController.html#method-i-update" name="method-i-update" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-update_source')" id="l_method-i-update_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-update_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin/users_controller.rb, line 77</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">update</span>
|
||||
<span class="ruby-identifier">admin</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-string">"admin"</span>)
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>][<span class="ruby-value">:password</span>].<span class="ruby-identifier">blank?</span>
|
||||
<span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-value">:password</span>)
|
||||
<span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-value">:password_confirmation</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-ivar">@admin_user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">admin</span> = (<span class="ruby-identifier">admin</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">admin</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-number">0</span>)
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:user</span>], <span class="ruby-identifier">as</span><span class="ruby-operator">:</span> <span class="ruby-value">:admin</span>)
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_to</span> [<span class="ruby-value">:admin</span>, <span class="ruby-ivar">@admin_user</span>], <span class="ruby-identifier">notice</span><span class="ruby-operator">:</span> <span class="ruby-string">'User was successfully updated.'</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">head</span> <span class="ruby-value">:ok</span> }
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-string">"edit"</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">json</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@admin_user</span>.<span class="ruby-identifier">errors</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-value">:unprocessable_entity</span> }
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,140 +0,0 @@
|
|||
<?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>AdminController</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>
|
||||
AdminController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ApplicationController.html">ApplicationController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/admin_controller_rb.html">app/controllers/admin_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Provides a base class for <a href="Admin.html">Admin</a> controllers to
|
||||
subclass</p>
|
||||
|
||||
<p>Automatically sets the layout and ensures an administrator is logged in</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>A</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authenticate_admin-21">authenticate_admin!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authenticate_admin-21">
|
||||
|
||||
<b>authenticate_admin!</b>()
|
||||
|
||||
<a href="../classes/AdminController.html#method-i-authenticate_admin-21" name="method-i-authenticate_admin-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authenticate_admin-21_source')" id="l_method-i-authenticate_admin-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authenticate_admin-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/admin_controller.rb, line 8</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authenticate_admin!</span>
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">render_404</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">is_admin?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,942 +0,0 @@
|
|||
<?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>ApplicationController</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>
|
||||
ApplicationController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
ActionController::Base
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/application_controller_rb.html">app/controllers/application_controller.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-abilities">abilities</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-access_denied-21">access_denied!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-add_abilities">add_abilities</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-after_sign_in_path_for">after_sign_in_path_for</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authorize_code_access-21">authorize_code_access!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authorize_project-21">authorize_project!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-can-3F">can?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-dev_tools">dev_tools</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-git_not_found-21">git_not_found!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>L</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-log_exception">log_exception</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>M</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-method_missing">method_missing</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-no_cache_headers">no_cache_headers</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-not_found-21">not_found!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-project">project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>R</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-reject_blocked-21">reject_blocked!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-render_403">render_403</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-render_404">render_404</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-require_non_empty_project">require_non_empty_project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>S</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-set_current_user_for_observers">set_current_user_for_observers</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Protected methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-abilities">
|
||||
|
||||
<b>abilities</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-abilities" name="method-i-abilities" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-abilities_source')" id="l_method-i-abilities_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-abilities_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 58</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">abilities</span>
|
||||
<span class="ruby-ivar">@abilities</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Six</span>.<span class="ruby-identifier">new</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-access_denied-21">
|
||||
|
||||
<b>access_denied!</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-access_denied-21" name="method-i-access_denied-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-access_denied-21_source')" id="l_method-i-access_denied-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-access_denied-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 91</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">access_denied!</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"errors/access_denied"</span>, <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-string">"errors"</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-number">404</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-add_abilities">
|
||||
|
||||
<b>add_abilities</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-add_abilities" name="method-i-add_abilities" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-add_abilities_source')" id="l_method-i-add_abilities_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-add_abilities_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 79</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">add_abilities</span>
|
||||
<span class="ruby-identifier">abilities</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Ability</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-after_sign_in_path_for">
|
||||
|
||||
<b>after_sign_in_path_for</b>(resource)
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-after_sign_in_path_for" name="method-i-after_sign_in_path_for" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-after_sign_in_path_for_source')" id="l_method-i-after_sign_in_path_for_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-after_sign_in_path_for_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 43</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">after_sign_in_path_for</span> <span class="ruby-identifier">resource</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:blocked</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">blocked</span>
|
||||
<span class="ruby-identifier">sign_out</span> <span class="ruby-identifier">resource</span>
|
||||
<span class="ruby-identifier">flash</span>[<span class="ruby-value">:alert</span>] = <span class="ruby-string">"Your account is blocked. Retry when an admin unblock it."</span>
|
||||
<span class="ruby-identifier">new_user_session_path</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">super</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-authorize_code_access-21">
|
||||
|
||||
<b>authorize_code_access!</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-authorize_code_access-21" name="method-i-authorize_code_access-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authorize_code_access-21_source')" id="l_method-i-authorize_code_access-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authorize_code_access-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 87</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authorize_code_access!</span>
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">access_denied!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">can?</span>(<span class="ruby-identifier">current_user</span>, <span class="ruby-value">:download_code</span>, <span class="ruby-identifier">project</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authorize_project-21">
|
||||
|
||||
<b>authorize_project!</b>(action)
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-authorize_project-21" name="method-i-authorize_project-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authorize_project-21_source')" id="l_method-i-authorize_project-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authorize_project-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 83</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authorize_project!</span>(<span class="ruby-identifier">action</span>)
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">access_denied!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">can?</span>(<span class="ruby-identifier">current_user</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">project</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-can-3F">
|
||||
|
||||
<b>can?</b>(object, action, subject)
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-can-3F" name="method-i-can-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-can-3F_source')" id="l_method-i-can-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-can-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 62</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">can?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-identifier">abilities</span>.<span class="ruby-identifier">allowed?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-dev_tools">
|
||||
|
||||
<b>dev_tools</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-dev_tools" name="method-i-dev_tools" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-dev_tools_source')" id="l_method-i-dev_tools_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-dev_tools_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 129</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">dev_tools</span>
|
||||
<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">MiniProfiler</span>.<span class="ruby-identifier">authorize_request</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-git_not_found-21">
|
||||
|
||||
<b>git_not_found!</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-git_not_found-21" name="method-i-git_not_found-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-git_not_found-21_source')" id="l_method-i-git_not_found-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-git_not_found-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 99</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">git_not_found!</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"errors/git_not_found"</span>, <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-string">"errors"</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-number">404</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-log_exception">
|
||||
|
||||
<b>log_exception</b>(exception)
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-log_exception" name="method-i-log_exception" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-log_exception_source')" id="l_method-i-log_exception_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-log_exception_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 29</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">log_exception</span>(<span class="ruby-identifier">exception</span>)
|
||||
<span class="ruby-identifier">application_trace</span> = <span class="ruby-constant">ActionDispatch</span><span class="ruby-operator">::</span><span class="ruby-constant">ExceptionWrapper</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>, <span class="ruby-identifier">exception</span>).<span class="ruby-identifier">application_trace</span>
|
||||
<span class="ruby-identifier">application_trace</span>.<span class="ruby-identifier">map!</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-node">" #{t}\n"</span> }
|
||||
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">"\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-method_missing">
|
||||
|
||||
<b>method_missing</b>(method_sym, *arguments, &block)
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-method_missing" name="method-i-method_missing" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-method_missing_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 103</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">method_missing</span>(<span class="ruby-identifier">method_sym</span>, *<span class="ruby-identifier">arguments</span>, &<span class="ruby-identifier">block</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">method_sym</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r^authorize_(.*)!$/</span>
|
||||
<span class="ruby-identifier">authorize_project!</span>(<span class="ruby-node">$1</span>.<span class="ruby-identifier">to_sym</span>)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">super</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-no_cache_headers">
|
||||
|
||||
<b>no_cache_headers</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-no_cache_headers" name="method-i-no_cache_headers" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-no_cache_headers_source')" id="l_method-i-no_cache_headers_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-no_cache_headers_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 123</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">no_cache_headers</span>
|
||||
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-string">"Cache-Control"</span>] = <span class="ruby-string">"no-cache, no-store, max-age=0, must-revalidate"</span>
|
||||
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-string">"Pragma"</span>] = <span class="ruby-string">"no-cache"</span>
|
||||
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-string">"Expires"</span>] = <span class="ruby-string">"Fri, 01 Jan 1990 00:00:00 GMT"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-not_found-21">
|
||||
|
||||
<b>not_found!</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-not_found-21" name="method-i-not_found-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-not_found-21_source')" id="l_method-i-not_found-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-not_found-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 95</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">not_found!</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"errors/not_found"</span>, <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-string">"errors"</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-number">404</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-project">
|
||||
|
||||
<b>project</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-project" name="method-i-project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-project_source')" id="l_method-i-project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 66</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project</span>
|
||||
<span class="ruby-identifier">id</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]
|
||||
|
||||
<span class="ruby-ivar">@project</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">find_with_namespace</span>(<span class="ruby-identifier">id</span>)
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@project</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">can?</span>(<span class="ruby-identifier">current_user</span>, <span class="ruby-value">:read_project</span>, <span class="ruby-ivar">@project</span>)
|
||||
<span class="ruby-ivar">@project</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-ivar">@project</span> = <span class="ruby-keyword">nil</span>
|
||||
<span class="ruby-identifier">render_404</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-reject_blocked-21">
|
||||
|
||||
<b>reject_blocked!</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-reject_blocked-21" name="method-i-reject_blocked-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-reject_blocked-21_source')" id="l_method-i-reject_blocked-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-reject_blocked-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 35</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">reject_blocked!</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">current_user</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">blocked</span>
|
||||
<span class="ruby-identifier">sign_out</span> <span class="ruby-identifier">current_user</span>
|
||||
<span class="ruby-identifier">flash</span>[<span class="ruby-value">:alert</span>] = <span class="ruby-string">"Your account is blocked. Retry when an admin unblock it."</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">new_user_session_path</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-render_403">
|
||||
|
||||
<b>render_403</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-render_403" name="method-i-render_403" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-render_403_source')" id="l_method-i-render_403_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-render_403_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 115</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">render_403</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">file</span><span class="ruby-operator">:</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"public"</span>, <span class="ruby-string">"403"</span>), <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-string">"403"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-render_404">
|
||||
|
||||
<b>render_404</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-render_404" name="method-i-render_404" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-render_404_source')" id="l_method-i-render_404_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-render_404_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 111</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">render_404</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-identifier">file</span><span class="ruby-operator">:</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"public"</span>, <span class="ruby-string">"404"</span>), <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-string">"404"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-require_non_empty_project">
|
||||
|
||||
<b>require_non_empty_project</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-require_non_empty_project" name="method-i-require_non_empty_project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-require_non_empty_project_source')" id="l_method-i-require_non_empty_project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-require_non_empty_project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 119</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">require_non_empty_project</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-ivar">@project</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">empty_repo?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-set_current_user_for_observers">
|
||||
|
||||
<b>set_current_user_for_observers</b>()
|
||||
|
||||
<a href="../classes/ApplicationController.html#method-i-set_current_user_for_observers" name="method-i-set_current_user_for_observers" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-set_current_user_for_observers_source')" id="l_method-i-set_current_user_for_observers_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-set_current_user_for_observers_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/application_controller.rb, line 53</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_current_user_for_observers</span>
|
||||
<span class="ruby-constant">MergeRequestObserver</span>.<span class="ruby-identifier">current_user</span> = <span class="ruby-identifier">current_user</span>
|
||||
<span class="ruby-constant">IssueObserver</span>.<span class="ruby-identifier">current_user</span> = <span class="ruby-identifier">current_user</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<?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>ApplicationDecorator</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>
|
||||
ApplicationDecorator
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Draper::Base
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/decorators/application_decorator_rb.html">app/decorators/application_decorator.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,890 +0,0 @@
|
|||
<?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>ApplicationHelper</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>
|
||||
ApplicationHelper
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/helpers/application_helper_rb.html">app/helpers/application_helper.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-app_theme">app_theme</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authbutton">authbutton</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-current_action-3F">current_action?</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-current_controller-3F">current_controller?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-emoji_autocomplete_source">emoji_autocomplete_source</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-gravatar_icon">gravatar_icon</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-grouped_options_refs">grouped_options_refs</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>H</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-hexdigest">hexdigest</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>L</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-last_commit">last_commit</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-ldap_enable-3F">ldap_enable?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-project_last_activity">project_last_activity</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>R</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-request_protocol">request_protocol</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>S</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-search_autocomplete_source">search_autocomplete_source</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-show_last_push_widget-3F">show_last_push_widget?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-user_color_scheme_class">user_color_scheme_class</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>W</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-web_app_url">web_app_url</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-app_theme">
|
||||
|
||||
<b>app_theme</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-app_theme" name="method-i-app_theme" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-app_theme_source')" id="l_method-i-app_theme_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-app_theme_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 130</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">app_theme</span>
|
||||
<span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">Theme</span>.<span class="ruby-identifier">css_class_by_id</span>(<span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">try</span>(<span class="ruby-value">:theme_id</span>))
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authbutton">
|
||||
|
||||
<b>authbutton</b>(provider, size = 64)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-authbutton" name="method-i-authbutton" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authbutton_source')" id="l_method-i-authbutton_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authbutton_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 159</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authbutton</span>(<span class="ruby-identifier">provider</span>, <span class="ruby-identifier">size</span> = <span class="ruby-number">64</span>)
|
||||
<span class="ruby-identifier">file_name</span> = <span class="ruby-node">"#{provider.to_s.split('_').first}_#{size}.png"</span>
|
||||
<span class="ruby-identifier">image_tag</span>(<span class="ruby-node">"authbuttons/#{file_name}"</span>,
|
||||
<span class="ruby-identifier">alt</span><span class="ruby-operator">:</span> <span class="ruby-node">"Sign in with #{provider.to_s.titleize}"</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-current_action-3F">
|
||||
|
||||
<b>current_action?</b>(*args)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-current_action-3F" name="method-i-current_action-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Check if a partcular action is the current one</p>
|
||||
|
||||
<p>args - One or more action names to check</p>
|
||||
|
||||
<p>Examples</p>
|
||||
|
||||
<pre class="ruby"><span class="ruby-comment"># On Projects#new</span>
|
||||
<span class="ruby-identifier">current_action?</span>(:<span class="ruby-identifier">new</span>) <span class="ruby-comment"># => true</span>
|
||||
<span class="ruby-identifier">current_action?</span>(:<span class="ruby-identifier">create</span>) <span class="ruby-comment"># => false</span>
|
||||
<span class="ruby-identifier">current_action?</span>(:<span class="ruby-identifier">new</span>, :<span class="ruby-identifier">create</span>) <span class="ruby-comment"># => true</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-current_action-3F_source')" id="l_method-i-current_action-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-current_action-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 30</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">current_action?</span>(*<span class="ruby-identifier">args</span>)
|
||||
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">action_name</span> }
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-current_controller-3F">
|
||||
|
||||
<b>current_controller?</b>(*args)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-current_controller-3F" name="method-i-current_controller-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Check if a particular controller is the current one</p>
|
||||
|
||||
<p>args - One or more controller names to check</p>
|
||||
|
||||
<p>Examples</p>
|
||||
|
||||
<pre class="ruby"><span class="ruby-comment"># On TreeController</span>
|
||||
<span class="ruby-identifier">current_controller?</span>(:<span class="ruby-identifier">tree</span>) <span class="ruby-comment"># => true</span>
|
||||
<span class="ruby-identifier">current_controller?</span>(:<span class="ruby-identifier">commits</span>) <span class="ruby-comment"># => false</span>
|
||||
<span class="ruby-identifier">current_controller?</span>(:<span class="ruby-identifier">commits</span>, :<span class="ruby-identifier">tree</span>) <span class="ruby-comment"># => true</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-current_controller-3F_source')" id="l_method-i-current_controller-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-current_controller-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 16</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">current_controller?</span>(*<span class="ruby-identifier">args</span>)
|
||||
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">controller_name</span> }
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-emoji_autocomplete_source">
|
||||
|
||||
<b>emoji_autocomplete_source</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-emoji_autocomplete_source" name="method-i-emoji_autocomplete_source" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-emoji_autocomplete_source_source')" id="l_method-i-emoji_autocomplete_source_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-emoji_autocomplete_source_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 120</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">emoji_autocomplete_source</span>
|
||||
<span class="ruby-comment"># should be an array of strings</span>
|
||||
<span class="ruby-comment"># so to_s can be called, because it is sufficient and to_json is too slow</span>
|
||||
<span class="ruby-constant">Emoji</span>.<span class="ruby-identifier">names</span>.<span class="ruby-identifier">to_s</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-gravatar_icon">
|
||||
|
||||
<b>gravatar_icon</b>(user_email = '', size = nil)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-gravatar_icon" name="method-i-gravatar_icon" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-gravatar_icon_source')" id="l_method-i-gravatar_icon_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-gravatar_icon_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 34</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">gravatar_icon</span>(<span class="ruby-identifier">user_email</span> = <span class="ruby-string">''</span>, <span class="ruby-identifier">size</span> = <span class="ruby-keyword">nil</span>)
|
||||
<span class="ruby-identifier">size</span> = <span class="ruby-number">40</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">size</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">size</span> <span class="ruby-operator"><=</span> <span class="ruby-number">0</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">gravatar</span>.<span class="ruby-identifier">enabled</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">user_email</span>.<span class="ruby-identifier">blank?</span>
|
||||
<span class="ruby-string">'no_avatar.png'</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">gravatar_url</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">ssl?</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">gravatar</span>.<span class="ruby-identifier">ssl_url</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">gravatar</span>.<span class="ruby-identifier">plain_url</span>
|
||||
<span class="ruby-identifier">user_email</span>.<span class="ruby-identifier">strip!</span>
|
||||
<span class="ruby-identifier">sprintf</span>(<span class="ruby-identifier">gravatar_url</span>, {<span class="ruby-value">:hash</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">user_email</span>.<span class="ruby-identifier">downcase</span>), <span class="ruby-value">:email</span> =<span class="ruby-operator">></span> <span class="ruby-constant">URI</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-identifier">user_email</span>), <span class="ruby-value">:size</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">size</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-grouped_options_refs">
|
||||
|
||||
<b>grouped_options_refs</b>(destination = :tree)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-grouped_options_refs" name="method-i-grouped_options_refs" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-grouped_options_refs_source')" id="l_method-i-grouped_options_refs_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-grouped_options_refs_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 64</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">grouped_options_refs</span>(<span class="ruby-identifier">destination</span> = <span class="ruby-value">:tree</span>)
|
||||
<span class="ruby-identifier">options</span> = [
|
||||
[<span class="ruby-string">"Branch"</span>, <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">branch_names</span> ],
|
||||
[ <span class="ruby-string">"Tag"</span>, <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">tag_names</span> ]
|
||||
]
|
||||
|
||||
<span class="ruby-comment"># If reference is commit id -</span>
|
||||
<span class="ruby-comment"># we should add it to branch/tag selectbox</span>
|
||||
<span class="ruby-keyword">if</span>(<span class="ruby-ivar">@ref</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@ref</span>) <span class="ruby-operator">&&</span>
|
||||
<span class="ruby-ivar">@ref</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r^[0-9a-zA-Z]{6,52}$/</span>)
|
||||
<span class="ruby-identifier">options</span> <span class="ruby-operator"><<</span> [<span class="ruby-string">"Commit"</span>, [<span class="ruby-ivar">@ref</span>]]
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">grouped_options_for_select</span>(<span class="ruby-identifier">options</span>, <span class="ruby-ivar">@ref</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">default_branch</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-hexdigest">
|
||||
|
||||
<b>hexdigest</b>(string)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-hexdigest" name="method-i-hexdigest" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-hexdigest_source')" id="l_method-i-hexdigest_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-hexdigest_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 146</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">hexdigest</span>(<span class="ruby-identifier">string</span>)
|
||||
<span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">hexdigest</span> <span class="ruby-identifier">string</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-last_commit">
|
||||
|
||||
<b>last_commit</b>(project)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-last_commit" name="method-i-last_commit" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-last_commit_source')" id="l_method-i-last_commit_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-last_commit_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 54</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">last_commit</span>(<span class="ruby-identifier">project</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">repo_exists?</span>
|
||||
<span class="ruby-identifier">time_ago_in_words</span>(<span class="ruby-identifier">project</span>.<span class="ruby-identifier">commit</span>.<span class="ruby-identifier">committed_date</span>) <span class="ruby-operator">+</span> <span class="ruby-string">" ago"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-string">"Never"</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">rescue</span>
|
||||
<span class="ruby-string">"Never"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-ldap_enable-3F">
|
||||
|
||||
<b>ldap_enable?</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-ldap_enable-3F" name="method-i-ldap_enable-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-ldap_enable-3F_source')" id="l_method-i-ldap_enable-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-ldap_enable-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 126</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">ldap_enable?</span>
|
||||
<span class="ruby-constant">Devise</span>.<span class="ruby-identifier">omniauth_providers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:ldap</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-project_last_activity">
|
||||
|
||||
<b>project_last_activity</b>(project)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-project_last_activity" name="method-i-project_last_activity" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-project_last_activity_source')" id="l_method-i-project_last_activity_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-project_last_activity_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 150</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_last_activity</span> <span class="ruby-identifier">project</span>
|
||||
<span class="ruby-identifier">activity</span> = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">last_activity</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">activity</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">activity</span>.<span class="ruby-identifier">created_at</span>
|
||||
<span class="ruby-identifier">time_ago_in_words</span>(<span class="ruby-identifier">activity</span>.<span class="ruby-identifier">created_at</span>) <span class="ruby-operator">+</span> <span class="ruby-string">" ago"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-string">"Never"</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-request_protocol">
|
||||
|
||||
<b>request_protocol</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-request_protocol" name="method-i-request_protocol" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-request_protocol_source')" id="l_method-i-request_protocol_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-request_protocol_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 46</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">request_protocol</span>
|
||||
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">ssl?</span> <span class="ruby-operator">?</span> <span class="ruby-string">"https"</span> <span class="ruby-operator">:</span> <span class="ruby-string">"http"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-search_autocomplete_source">
|
||||
|
||||
<b>search_autocomplete_source</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-search_autocomplete_source" name="method-i-search_autocomplete_source" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-search_autocomplete_source_source')" id="l_method-i-search_autocomplete_source_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-search_autocomplete_source_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 80</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">search_autocomplete_source</span>
|
||||
<span class="ruby-identifier">projects</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">authorized_projects</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> { <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name_with_namespace</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_path</span>(<span class="ruby-identifier">p</span>) } }
|
||||
<span class="ruby-identifier">groups</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">authorized_groups</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">group</span><span class="ruby-operator">|</span> { <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"<group> #{group.name}"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">group_path</span>(<span class="ruby-identifier">group</span>) } }
|
||||
|
||||
<span class="ruby-identifier">default_nav</span> = [
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"My Profile"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">profile_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"My SSH Keys"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">keys_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"My Dashboard"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">root_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Admin Section"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">admin_root_path</span> },
|
||||
]
|
||||
|
||||
<span class="ruby-identifier">help_nav</span> = [
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Workflow Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_workflow_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Permissions Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_permissions_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Web Hooks Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_web_hooks_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"System Hooks Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_system_hooks_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"API Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_api_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Markdown Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_markdown_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"SSH Keys Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_ssh_path</span> },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-string">"Gitlab Rake Tasks Help"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">help_raketasks_path</span> },
|
||||
]
|
||||
|
||||
<span class="ruby-identifier">project_nav</span> = []
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@project</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@project</span>.<span class="ruby-identifier">new_record?</span>
|
||||
<span class="ruby-identifier">project_nav</span> = [
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Issues"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_issues_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Commits"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_commits_path</span>(<span class="ruby-ivar">@project</span>, <span class="ruby-ivar">@ref</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">root_ref</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Merge Requests"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_merge_requests_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Milestones"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_milestones_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Snippets"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_snippets_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Team"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_team_index_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Tree"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_tree_path</span>(<span class="ruby-ivar">@project</span>, <span class="ruby-ivar">@ref</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">root_ref</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Wall"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">wall_project_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
{ <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{@project.name} Wiki"</span>, <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">project_wikis_path</span>(<span class="ruby-ivar">@project</span>) },
|
||||
]
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
[<span class="ruby-identifier">groups</span>, <span class="ruby-identifier">projects</span>, <span class="ruby-identifier">default_nav</span>, <span class="ruby-identifier">project_nav</span>, <span class="ruby-identifier">help_nav</span>].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">to_json</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show_last_push_widget-3F">
|
||||
|
||||
<b>show_last_push_widget?</b>(event)
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-show_last_push_widget-3F" name="method-i-show_last_push_widget-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-show_last_push_widget-3F_source')" id="l_method-i-show_last_push_widget-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-show_last_push_widget-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 138</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show_last_push_widget?</span>(<span class="ruby-identifier">event</span>)
|
||||
<span class="ruby-identifier">event</span> <span class="ruby-operator">&&</span>
|
||||
<span class="ruby-identifier">event</span>.<span class="ruby-identifier">last_push_to_non_root?</span> <span class="ruby-operator">&&</span>
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">event</span>.<span class="ruby-identifier">rm_ref?</span> <span class="ruby-operator">&&</span>
|
||||
<span class="ruby-identifier">event</span>.<span class="ruby-identifier">project</span> <span class="ruby-operator">&&</span>
|
||||
<span class="ruby-identifier">event</span>.<span class="ruby-identifier">project</span>.<span class="ruby-identifier">merge_requests_enabled</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-user_color_scheme_class">
|
||||
|
||||
<b>user_color_scheme_class</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-user_color_scheme_class" name="method-i-user_color_scheme_class" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-user_color_scheme_class_source')" id="l_method-i-user_color_scheme_class_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-user_color_scheme_class_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 134</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">user_color_scheme_class</span>
|
||||
<span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">dark_scheme</span> <span class="ruby-operator">?</span> <span class="ruby-value">:black</span> <span class="ruby-operator">:</span> <span class="ruby-value">:white</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-web_app_url">
|
||||
|
||||
<b>web_app_url</b>()
|
||||
|
||||
<a href="../classes/ApplicationHelper.html#method-i-web_app_url" name="method-i-web_app_url" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-web_app_url_source')" id="l_method-i-web_app_url_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-web_app_url_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 50</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">web_app_url</span>
|
||||
<span class="ruby-node">"#{request_protocol}://#{Gitlab.config.gitlab.host}/"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,132 +0,0 @@
|
|||
<?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>AttachmentUploader</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>
|
||||
AttachmentUploader
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
CarrierWave::Uploader::Base
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/uploaders/attachment_uploader_rb.html">app/uploaders/attachment_uploader.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-store_dir">store_dir</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-store_dir">
|
||||
|
||||
<b>store_dir</b>()
|
||||
|
||||
<a href="../classes/AttachmentUploader.html#method-i-store_dir" name="method-i-store_dir" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Override the directory where uploaded files will be stored. This is a
|
||||
sensible default for uploaders that are meant to be mounted:</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-store_dir_source')" id="l_method-i-store_dir_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-store_dir_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/uploaders/attachment_uploader.rb, line 15</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">store_dir</span>
|
||||
<span class="ruby-node">"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,528 +0,0 @@
|
|||
<?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>Authority</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>
|
||||
Authority
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/roles/authority_rb.html">app/roles/authority.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-add_access">add_access</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-allow_read_for-3F">allow_read_for?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-dev_access_for-3F">dev_access_for?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-guest_access_for-3F">guest_access_for?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>M</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-master_access_for-3F">master_access_for?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>R</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-report_access_for-3F">report_access_for?</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-repository_masters">repository_masters</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-repository_readers">repository_readers</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-repository_writers">repository_writers</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-reset_access">reset_access</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_access">
|
||||
|
||||
<b>add_access</b>(user, *access)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-add_access" name="method-i-add_access" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Compatible with all access rights Should be rewrited for new access rights</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-add_access_source')" id="l_method-i-add_access_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-add_access_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 4</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">add_access</span>(<span class="ruby-identifier">user</span>, *<span class="ruby-identifier">access</span>)
|
||||
<span class="ruby-identifier">access</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">access</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:admin</span>)
|
||||
{ <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span> }
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">access</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:write</span>)
|
||||
{ <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">DEVELOPER</span> }
|
||||
<span class="ruby-keyword">else</span>
|
||||
{ <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">REPORTER</span> }
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-identifier">opts</span> = { <span class="ruby-identifier">user</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span> }
|
||||
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">access</span>)
|
||||
<span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">opts</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-allow_read_for-3F">
|
||||
|
||||
<b>allow_read_for?</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-allow_read_for-3F" name="method-i-allow_read_for-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-allow_read_for-3F_source')" id="l_method-i-allow_read_for-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-allow_read_for-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 39</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">allow_read_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>).<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-dev_access_for-3F">
|
||||
|
||||
<b>dev_access_for?</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-dev_access_for-3F" name="method-i-dev_access_for-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-dev_access_for-3F_source')" id="l_method-i-dev_access_for-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-dev_access_for-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 51</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">dev_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> [<span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">DEVELOPER</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span>]).<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-guest_access_for-3F">
|
||||
|
||||
<b>guest_access_for?</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-guest_access_for-3F" name="method-i-guest_access_for-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-guest_access_for-3F_source')" id="l_method-i-guest_access_for-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-guest_access_for-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 43</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">guest_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>).<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-master_access_for-3F">
|
||||
|
||||
<b>master_access_for?</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-master_access_for-3F" name="method-i-master_access_for-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-master_access_for-3F_source')" id="l_method-i-master_access_for-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-master_access_for-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 55</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">master_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> [<span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span>]).<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-report_access_for-3F">
|
||||
|
||||
<b>report_access_for?</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-report_access_for-3F" name="method-i-report_access_for-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-report_access_for-3F_source')" id="l_method-i-report_access_for-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-report_access_for-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 47</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">report_access_for?</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-operator">!</span><span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> [<span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">REPORTER</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">DEVELOPER</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span>]).<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-repository_masters">
|
||||
|
||||
<b>repository_masters</b>()
|
||||
|
||||
<a href="../classes/Authority.html#method-i-repository_masters" name="method-i-repository_masters" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-repository_masters_source')" id="l_method-i-repository_masters_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-repository_masters_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 33</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">repository_masters</span>
|
||||
<span class="ruby-identifier">keys</span> = <span class="ruby-constant">Key</span>.<span class="ruby-identifier">joins</span>({<span class="ruby-identifier">user</span><span class="ruby-operator">:</span> <span class="ruby-value">:users_projects</span>}).
|
||||
<span class="ruby-identifier">where</span>(<span class="ruby-string">"users_projects.project_id = ? AND users_projects.project_access = ?"</span>, <span class="ruby-identifier">id</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span>)
|
||||
<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span>(&<span class="ruby-value">:identifier</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-repository_readers">
|
||||
|
||||
<b>repository_readers</b>()
|
||||
|
||||
<a href="../classes/Authority.html#method-i-repository_readers" name="method-i-repository_readers" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-repository_readers_source')" id="l_method-i-repository_readers_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-repository_readers_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 21</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">repository_readers</span>
|
||||
<span class="ruby-identifier">keys</span> = <span class="ruby-constant">Key</span>.<span class="ruby-identifier">joins</span>({<span class="ruby-identifier">user</span><span class="ruby-operator">:</span> <span class="ruby-value">:users_projects</span>}).
|
||||
<span class="ruby-identifier">where</span>(<span class="ruby-string">"users_projects.project_id = ? AND users_projects.project_access = ?"</span>, <span class="ruby-identifier">id</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">REPORTER</span>)
|
||||
<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span>(&<span class="ruby-value">:identifier</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">map</span>(&<span class="ruby-value">:identifier</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-repository_writers">
|
||||
|
||||
<b>repository_writers</b>()
|
||||
|
||||
<a href="../classes/Authority.html#method-i-repository_writers" name="method-i-repository_writers" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-repository_writers_source')" id="l_method-i-repository_writers_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-repository_writers_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 27</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">repository_writers</span>
|
||||
<span class="ruby-identifier">keys</span> = <span class="ruby-constant">Key</span>.<span class="ruby-identifier">joins</span>({<span class="ruby-identifier">user</span><span class="ruby-operator">:</span> <span class="ruby-value">:users_projects</span>}).
|
||||
<span class="ruby-identifier">where</span>(<span class="ruby-string">"users_projects.project_id = ? AND users_projects.project_access = ?"</span>, <span class="ruby-identifier">id</span>, <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">DEVELOPER</span>)
|
||||
<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span>(&<span class="ruby-value">:identifier</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-reset_access">
|
||||
|
||||
<b>reset_access</b>(user)
|
||||
|
||||
<a href="../classes/Authority.html#method-i-reset_access" name="method-i-reset_access" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-reset_access_source')" id="l_method-i-reset_access_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-reset_access_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/authority.rb, line 17</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">reset_access</span>(<span class="ruby-identifier">user</span>)
|
||||
<span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">project_id</span><span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">user_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>).<span class="ruby-identifier">destroy</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,261 +0,0 @@
|
|||
<?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>BaseContext</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>
|
||||
BaseContext
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Object
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/contexts/base_context_rb.html">app/contexts/base_context.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-abilities">abilities</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-can-3F">can?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Section attributes -->
|
||||
<div class="sectiontitle">Attributes</div>
|
||||
<table border='0' cellpadding='5'>
|
||||
|
||||
<tr valign='top'>
|
||||
<td class='attr-rw'>
|
||||
[RW]
|
||||
</td>
|
||||
<td class='attr-name'>current_user</td>
|
||||
<td class='attr-desc'></td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td class='attr-rw'>
|
||||
[RW]
|
||||
</td>
|
||||
<td class='attr-name'>params</td>
|
||||
<td class='attr-desc'></td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td class='attr-rw'>
|
||||
[RW]
|
||||
</td>
|
||||
<td class='attr-name'>project</td>
|
||||
<td class='attr-desc'></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Class Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-new">
|
||||
|
||||
<b>new</b>(project, user, params)
|
||||
|
||||
<a href="../classes/BaseContext.html#method-c-new" name="method-c-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/contexts/base_context.rb, line 4</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">project</span>, <span class="ruby-identifier">user</span>, <span class="ruby-identifier">params</span>)
|
||||
<span class="ruby-ivar">@project</span>, <span class="ruby-ivar">@current_user</span>, <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">project</span>, <span class="ruby-identifier">user</span>, <span class="ruby-identifier">params</span>.<span class="ruby-identifier">dup</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-abilities">
|
||||
|
||||
<b>abilities</b>()
|
||||
|
||||
<a href="../classes/BaseContext.html#method-i-abilities" name="method-i-abilities" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-abilities_source')" id="l_method-i-abilities_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-abilities_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/contexts/base_context.rb, line 8</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">abilities</span>
|
||||
<span class="ruby-ivar">@abilities</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
||||
<span class="ruby-identifier">abilities</span> = <span class="ruby-constant">Six</span>.<span class="ruby-identifier">new</span>
|
||||
<span class="ruby-identifier">abilities</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Ability</span>
|
||||
<span class="ruby-identifier">abilities</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-can-3F">
|
||||
|
||||
<b>can?</b>(object, action, subject)
|
||||
|
||||
<a href="../classes/BaseContext.html#method-i-can-3F" name="method-i-can-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-can-3F_source')" id="l_method-i-can-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-can-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/contexts/base_context.rb, line 16</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">can?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-identifier">abilities</span>.<span class="ruby-identifier">allowed?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,152 +0,0 @@
|
|||
<?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>BlameController</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>
|
||||
BlameController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/blame_controller_rb.html">app/controllers/blame_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Controller for viewing a file’s blame</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
|
||||
<!-- Includes -->
|
||||
<div class="sectiontitle">Included Modules</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
|
||||
<a href="ExtractsPath.html">
|
||||
ExtractsPath
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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/BlameController.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/blame_controller.rb, line 12</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@repo</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">repo</span>
|
||||
<span class="ruby-ivar">@blame</span> = <span class="ruby-constant">Grit</span><span class="ruby-operator">::</span><span class="ruby-constant">Blob</span>.<span class="ruby-identifier">blame</span>(<span class="ruby-ivar">@repo</span>, <span class="ruby-ivar">@commit</span>.<span class="ruby-identifier">id</span>, <span class="ruby-ivar">@path</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,160 +0,0 @@
|
|||
<?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>BlobController</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>
|
||||
BlobController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/blob_controller_rb.html">app/controllers/blob_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Controller for viewing a file’s blame</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
|
||||
<!-- Includes -->
|
||||
<div class="sectiontitle">Included Modules</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
|
||||
<a href="ExtractsPath.html">
|
||||
ExtractsPath
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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/BlobController.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/blob_controller.rb, line 12</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@tree</span>.<span class="ruby-identifier">is_blob?</span>
|
||||
<span class="ruby-identifier">send_data</span>(
|
||||
<span class="ruby-ivar">@tree</span>.<span class="ruby-identifier">data</span>,
|
||||
<span class="ruby-identifier">type</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@tree</span>.<span class="ruby-identifier">mime_type</span>,
|
||||
<span class="ruby-identifier">disposition</span><span class="ruby-operator">:</span> <span class="ruby-string">'inline'</span>,
|
||||
<span class="ruby-identifier">filename</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@tree</span>.<span class="ruby-identifier">name</span>
|
||||
)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">not_found!</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,160 +0,0 @@
|
|||
<?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>CommitController</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>
|
||||
CommitController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/commit_controller_rb.html">app/controllers/commit_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Controller for a specific <a href="Commit.html">Commit</a></p>
|
||||
|
||||
<p>Not to be confused with <a
|
||||
href="CommitsController.html">CommitsController</a>, plural.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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/CommitController.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/commit_controller.rb, line 10</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-identifier">result</span> = <span class="ruby-constant">CommitLoadContext</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">project</span>, <span class="ruby-identifier">current_user</span>, <span class="ruby-identifier">params</span>).<span class="ruby-identifier">execute</span>
|
||||
|
||||
<span class="ruby-ivar">@commit</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:commit</span>]
|
||||
<span class="ruby-identifier">git_not_found!</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@commit</span>
|
||||
|
||||
<span class="ruby-ivar">@suppress_diff</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:suppress_diff</span>]
|
||||
<span class="ruby-ivar">@note</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:note</span>]
|
||||
<span class="ruby-ivar">@line_notes</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:line_notes</span>]
|
||||
<span class="ruby-ivar">@notes_count</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:notes_count</span>]
|
||||
<span class="ruby-ivar">@comments_allowed</span> = <span class="ruby-keyword">true</span>
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-keyword">do</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">:status</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:huge_commit</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"huge_commit"</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">return</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">diff</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">text</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@commit</span>.<span class="ruby-identifier">to_diff</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">patch</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">text</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@commit</span>.<span class="ruby-identifier">to_patch</span> }
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,472 +0,0 @@
|
|||
<?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>CommitDecorator</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>
|
||||
CommitDecorator
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ApplicationDecorator.html">ApplicationDecorator</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/decorators/commit_decorator_rb.html">app/decorators/commit_decorator.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-author_link">author_link</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-committer_link">committer_link</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-description">description</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>L</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-link_title">link_title</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-no_commit_message">no_commit_message</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-person_link">person_link</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>T</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-title">title</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-author_link">
|
||||
|
||||
<b>author_link</b>(options = {})
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-author_link" name="method-i-author_link" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Returns a link to the commit author. If the author has a matching user and
|
||||
is a member of the current @project it will link to the team member page.
|
||||
Otherwise it will link to the author email as specified in the commit.</p>
|
||||
|
||||
<p>options:</p>
|
||||
|
||||
<pre>avatar: true will prepend the avatar image
|
||||
size: size of the avatar image in px</pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-author_link_source')" id="l_method-i-author_link_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-author_link_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 52</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">author_link</span>(<span class="ruby-identifier">options</span> = {})
|
||||
<span class="ruby-identifier">person_link</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span> <span class="ruby-identifier">source</span><span class="ruby-operator">:</span> <span class="ruby-value">:author</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-committer_link">
|
||||
|
||||
<b>committer_link</b>(options = {})
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-committer_link" name="method-i-committer_link" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Just like <a
|
||||
href="CommitDecorator.html#method-i-author_link">author_link</a> but for
|
||||
the committer.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-committer_link_source')" id="l_method-i-committer_link_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-committer_link_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 57</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">committer_link</span>(<span class="ruby-identifier">options</span> = {})
|
||||
<span class="ruby-identifier">person_link</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span> <span class="ruby-identifier">source</span><span class="ruby-operator">:</span> <span class="ruby-value">:committer</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-description">
|
||||
|
||||
<b>description</b>()
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-description" name="method-i-description" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the commits description</p>
|
||||
|
||||
<p>cut off, ellipses (`&hellp;`) are prepended to the commit message.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-description_source')" id="l_method-i-description_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-description_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 34</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">description</span>
|
||||
<span class="ruby-identifier">description</span> = <span class="ruby-identifier">safe_message</span>
|
||||
|
||||
<span class="ruby-identifier">title_end</span> = <span class="ruby-identifier">description</span>.<span class="ruby-identifier">index</span>(<span class="ruby-regexp">%r\n/</span>)
|
||||
<span class="ruby-keyword">if</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">title_end</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">description</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-number">80</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">title_end</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">title_end</span> <span class="ruby-operator">></span> <span class="ruby-number">80</span>)
|
||||
<span class="ruby-string">"&hellip;"</span>.<span class="ruby-identifier">html_safe</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">description</span>[<span class="ruby-number">70</span><span class="ruby-operator">..</span><span class="ruby-number">-1</span>]
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">description</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r\n/</span>, <span class="ruby-number">2</span>)[<span class="ruby-number">1</span>].<span class="ruby-identifier">try</span>(<span class="ruby-value">:chomp</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-link_title">
|
||||
|
||||
<b>link_title</b>()
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-link_title" name="method-i-link_title" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Returns a string describing the commit for use in a link title</p>
|
||||
|
||||
<p>Example</p>
|
||||
|
||||
<pre>"Commit: Alex Denisov - Project git clone panel"</pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-link_title_source')" id="l_method-i-link_title_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-link_title_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 9</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">link_title</span>
|
||||
<span class="ruby-node">"Commit: #{author_name} - #{title}"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-title">
|
||||
|
||||
<b>title</b>()
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-title" name="method-i-title" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the commits title.</p>
|
||||
|
||||
<p>Usually, the commit title is the first line of the commit message. In case
|
||||
this first line is longer than 80 characters, it is cut off after 70
|
||||
characters and ellipses (`&hellp;`) are appended.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-title_source')" id="l_method-i-title_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-title_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">title</span>
|
||||
<span class="ruby-identifier">title</span> = <span class="ruby-identifier">safe_message</span>
|
||||
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">no_commit_message</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">title</span>.<span class="ruby-identifier">blank?</span>
|
||||
|
||||
<span class="ruby-identifier">title_end</span> = <span class="ruby-identifier">title</span>.<span class="ruby-identifier">index</span>(<span class="ruby-regexp">%r\n/</span>)
|
||||
<span class="ruby-keyword">if</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">title_end</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">title</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-number">80</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">title_end</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">title_end</span> <span class="ruby-operator">></span> <span class="ruby-number">80</span>)
|
||||
<span class="ruby-identifier">title</span>[<span class="ruby-number">0</span><span class="ruby-operator">..</span><span class="ruby-number">69</span>] <span class="ruby-operator"><<</span> <span class="ruby-string">"&hellip;"</span>.<span class="ruby-identifier">html_safe</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">title</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r\n/</span>, <span class="ruby-number">2</span>).<span class="ruby-identifier">first</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Protected methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-no_commit_message">
|
||||
|
||||
<b>no_commit_message</b>()
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-no_commit_message" name="method-i-no_commit_message" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-no_commit_message_source')" id="l_method-i-no_commit_message_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-no_commit_message_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 63</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">no_commit_message</span>
|
||||
<span class="ruby-string">"--no commit message"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-person_link">
|
||||
|
||||
<b>person_link</b>(options = {})
|
||||
|
||||
<a href="../classes/CommitDecorator.html#method-i-person_link" name="method-i-person_link" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Private: Returns a link to a person. If the person has a matching user and
|
||||
is a member of the current @project it will link to the team member page.
|
||||
Otherwise it will link to the person email as specified in the commit.</p>
|
||||
|
||||
<p>options:</p>
|
||||
|
||||
<pre>source: one of :author or :committer
|
||||
avatar: true will prepend the avatar image
|
||||
size: size of the avatar image in px</pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-person_link_source')" id="l_method-i-person_link_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-person_link_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/commit_decorator.rb, line 75</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">person_link</span>(<span class="ruby-identifier">options</span> = {})
|
||||
<span class="ruby-identifier">source_name</span> = <span class="ruby-identifier">send</span> <span class="ruby-node">"#{options[:source]}_name"</span>.<span class="ruby-identifier">to_sym</span>
|
||||
<span class="ruby-identifier">source_email</span> = <span class="ruby-identifier">send</span> <span class="ruby-node">"#{options[:source]}_email"</span>.<span class="ruby-identifier">to_sym</span>
|
||||
<span class="ruby-identifier">text</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:avatar</span>]
|
||||
<span class="ruby-identifier">avatar</span> = <span class="ruby-identifier">h</span>.<span class="ruby-identifier">image_tag</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">gravatar_icon</span>(<span class="ruby-identifier">source_email</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:size</span>]), <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-node">"avatar #{"s#{options[:size]}" if options[:size]}"</span>, <span class="ruby-keyword ruby-title">width</span><span class="ruby-operator">:</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:size</span>], <span class="ruby-identifier">alt</span><span class="ruby-operator">:</span> <span class="ruby-string">""</span>
|
||||
<span class="ruby-node">%Q{#{avatar} <span class="commit-#{options[:source]}-name">#{source_name}</span>}</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">source_name</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-identifier">team_member</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">try</span>(<span class="ruby-value">:team_member_by_name_or_email</span>, <span class="ruby-identifier">source_name</span>, <span class="ruby-identifier">source_email</span>)
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">team_member</span>.<span class="ruby-identifier">nil?</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">mail_to</span> <span class="ruby-identifier">source_email</span>, <span class="ruby-identifier">text</span>.<span class="ruby-identifier">html_safe</span>, <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-node">"commit-#{options[:source]}-link"</span>
|
||||
<span class="ruby-keyword ruby-title">else</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">link_to</span> <span class="ruby-identifier">text</span>, <span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_team_member_path</span>(<span class="ruby-ivar">@project</span>, <span class="ruby-identifier">team_member</span>), <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-node">"commit-#{options[:source]}-link"</span>
|
||||
<span class="ruby-keyword ruby-title">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +0,0 @@
|
|||
<?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>CommitLoadContext</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>
|
||||
CommitLoadContext
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="BaseContext.html">BaseContext</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/contexts/commit_load_context_rb.html">app/contexts/commit_load_context.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>
|
||||
|
||||
</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>()
|
||||
|
||||
<a href="../classes/CommitLoadContext.html#method-i-execute" name="method-i-execute" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</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 app/contexts/commit_load_context.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">execute</span>
|
||||
<span class="ruby-identifier">result</span> = {
|
||||
<span class="ruby-identifier">commit</span><span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>,
|
||||
<span class="ruby-identifier">suppress_diff</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>,
|
||||
<span class="ruby-identifier">line_notes</span><span class="ruby-operator">:</span> [],
|
||||
<span class="ruby-identifier">notes_count</span><span class="ruby-operator">:</span> <span class="ruby-number">0</span>,
|
||||
<span class="ruby-identifier">note</span><span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>,
|
||||
<span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-value">:ok</span>
|
||||
}
|
||||
|
||||
<span class="ruby-identifier">commit</span> = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">commit</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">commit</span>
|
||||
<span class="ruby-identifier">commit</span> = <span class="ruby-constant">CommitDecorator</span>.<span class="ruby-identifier">decorate</span>(<span class="ruby-identifier">commit</span>)
|
||||
<span class="ruby-identifier">line_notes</span> = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">commit_line_notes</span>(<span class="ruby-identifier">commit</span>)
|
||||
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:commit</span>] = <span class="ruby-identifier">commit</span>
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:note</span>] = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">build_commit_note</span>(<span class="ruby-identifier">commit</span>)
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:line_notes</span>] = <span class="ruby-identifier">line_notes</span>
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:notes_count</span>] = <span class="ruby-identifier">line_notes</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">project</span>.<span class="ruby-identifier">commit_notes</span>(<span class="ruby-identifier">commit</span>).<span class="ruby-identifier">count</span>
|
||||
|
||||
<span class="ruby-keyword">begin</span>
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:suppress_diff</span>] = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">diffs</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">Commit</span><span class="ruby-operator">::</span><span class="ruby-constant">DIFF_SAFE_SIZE</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">params</span>[<span class="ruby-value">:force_show_diff</span>]
|
||||
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Grit</span><span class="ruby-operator">::</span><span class="ruby-constant">Git</span><span class="ruby-operator">::</span><span class="ruby-constant">GitTimeout</span>
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:suppress_diff</span>] = <span class="ruby-keyword">true</span>
|
||||
<span class="ruby-identifier">result</span>[<span class="ruby-value">:status</span>] = <span class="ruby-value">:huge_commit</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">result</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,155 +0,0 @@
|
|||
<?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>CommitsController</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>
|
||||
CommitsController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/commits_controller_rb.html">app/controllers/commits_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>
|
||||
|
||||
|
||||
|
||||
<!-- Includes -->
|
||||
<div class="sectiontitle">Included Modules</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
|
||||
<a href="ExtractsPath.html">
|
||||
ExtractsPath
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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/CommitsController.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/commits_controller.rb, line 11</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@repo</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">repo</span>
|
||||
<span class="ruby-ivar">@limit</span>, <span class="ruby-ivar">@offset</span> = (<span class="ruby-identifier">params</span>[<span class="ruby-value">:limit</span>] <span class="ruby-operator">||</span> <span class="ruby-number">40</span>), (<span class="ruby-identifier">params</span>[<span class="ruby-value">:offset</span>] <span class="ruby-operator">||</span> <span class="ruby-number">0</span>)
|
||||
|
||||
<span class="ruby-ivar">@commits</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">commits</span>(<span class="ruby-ivar">@ref</span>, <span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@limit</span>, <span class="ruby-ivar">@offset</span>)
|
||||
<span class="ruby-ivar">@commits</span> = <span class="ruby-constant">CommitDecorator</span>.<span class="ruby-identifier">decorate</span>(<span class="ruby-ivar">@commits</span>)
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-comment"># index.html.erb</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">atom</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span> }
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,409 +0,0 @@
|
|||
<?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>CommitsHelper</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>
|
||||
CommitsHelper
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/helpers/commits_helper_rb.html">app/helpers/commits_helper.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>B</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-build_line_anchor">build_line_anchor</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-commit_to_html">commit_to_html</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-diff_line_content">diff_line_content</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-each_diff_line">each_diff_line</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-identification_type">identification_type</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-image_diff_class">image_diff_class</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-build_line_anchor">
|
||||
|
||||
<b>build_line_anchor</b>(index, line_new, line_old)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-build_line_anchor" name="method-i-build_line_anchor" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-build_line_anchor_source')" id="l_method-i-build_line_anchor_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-build_line_anchor_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 12</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">build_line_anchor</span>(<span class="ruby-identifier">index</span>, <span class="ruby-identifier">line_new</span>, <span class="ruby-identifier">line_old</span>)
|
||||
<span class="ruby-node">"#{index}_#{line_old}_#{line_new}"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-commit_to_html">
|
||||
|
||||
<b>commit_to_html</b>(commit)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-commit_to_html" name="method-i-commit_to_html" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-commit_to_html_source')" id="l_method-i-commit_to_html_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-commit_to_html_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 68</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">commit_to_html</span> <span class="ruby-identifier">commit</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">model</span>
|
||||
<span class="ruby-identifier">escape_javascript</span>(<span class="ruby-identifier">render</span> <span class="ruby-string">'commits/commit'</span>, <span class="ruby-identifier">commit</span><span class="ruby-operator">:</span> <span class="ruby-identifier">commit</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-diff_line_content">
|
||||
|
||||
<b>diff_line_content</b>(line)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-diff_line_content" name="method-i-diff_line_content" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-diff_line_content_source')" id="l_method-i-diff_line_content_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-diff_line_content_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 74</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">diff_line_content</span>(<span class="ruby-identifier">line</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">blank?</span>
|
||||
<span class="ruby-string">" &nbsp;"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">line</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-each_diff_line">
|
||||
|
||||
<b>each_diff_line</b>(diff_arr, index)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-each_diff_line" name="method-i-each_diff_line" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-each_diff_line_source')" id="l_method-i-each_diff_line_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-each_diff_line_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 16</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">each_diff_line</span>(<span class="ruby-identifier">diff_arr</span>, <span class="ruby-identifier">index</span>)
|
||||
<span class="ruby-identifier">line_old</span> = <span class="ruby-number">1</span>
|
||||
<span class="ruby-identifier">line_new</span> = <span class="ruby-number">1</span>
|
||||
<span class="ruby-identifier">type</span> = <span class="ruby-keyword">nil</span>
|
||||
|
||||
<span class="ruby-identifier">lines_arr</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">InlineDiff</span>.<span class="ruby-identifier">processing</span> <span class="ruby-identifier">diff_arr</span>
|
||||
<span class="ruby-identifier">lines_arr</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^\-\-\- \/dev\/null/</span>)
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^\+\+\+ \/dev\/null/</span>)
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^\-\-\- a/</span>)
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^\+\+\+ b/</span>)
|
||||
|
||||
<span class="ruby-identifier">full_line</span> = <span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">%r\n/</span>, <span class="ruby-string">''</span>))
|
||||
<span class="ruby-identifier">full_line</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">InlineDiff</span>.<span class="ruby-identifier">replace_markers</span> <span class="ruby-identifier">full_line</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^@@ -/</span>)
|
||||
<span class="ruby-identifier">type</span> = <span class="ruby-string">"match"</span>
|
||||
|
||||
<span class="ruby-identifier">line_old</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r\-[0-9]*/</span>)[<span class="ruby-number">0</span>].<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">abs</span> <span class="ruby-keyword">rescue</span> <span class="ruby-number">0</span>
|
||||
<span class="ruby-identifier">line_new</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r\+[0-9]*/</span>)[<span class="ruby-number">0</span>].<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">abs</span> <span class="ruby-keyword">rescue</span> <span class="ruby-number">0</span>
|
||||
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line_old</span> <span class="ruby-operator">==</span> <span class="ruby-number">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">line_new</span> <span class="ruby-operator">==</span> <span class="ruby-number">1</span> <span class="ruby-comment">#top of file</span>
|
||||
<span class="ruby-keyword">yield</span>(<span class="ruby-identifier">full_line</span>, <span class="ruby-identifier">type</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
||||
<span class="ruby-keyword">next</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">identification_type</span>(<span class="ruby-identifier">line</span>)
|
||||
<span class="ruby-identifier">line_code</span> = <span class="ruby-identifier">build_line_anchor</span>(<span class="ruby-identifier">index</span>, <span class="ruby-identifier">line_new</span>, <span class="ruby-identifier">line_old</span>)
|
||||
<span class="ruby-keyword">yield</span>(<span class="ruby-identifier">full_line</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">line_code</span>, <span class="ruby-identifier">line_new</span>, <span class="ruby-identifier">line_old</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>[<span class="ruby-number">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">"+"</span>
|
||||
<span class="ruby-identifier">line_new</span> <span class="ruby-operator">+=</span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">line</span>[<span class="ruby-number">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">"-"</span>
|
||||
<span class="ruby-identifier">line_old</span> <span class="ruby-operator">+=</span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">line_new</span> <span class="ruby-operator">+=</span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-identifier">line_old</span> <span class="ruby-operator">+=</span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-keyword">end</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-identification_type">
|
||||
|
||||
<b>identification_type</b>(line)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-identification_type" name="method-i-identification_type" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-identification_type_source')" id="l_method-i-identification_type_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-identification_type_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">identification_type</span>(<span class="ruby-identifier">line</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>[<span class="ruby-number">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">"+"</span>
|
||||
<span class="ruby-string">"new"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">line</span>[<span class="ruby-number">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">"-"</span>
|
||||
<span class="ruby-string">"old"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">nil</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-image_diff_class">
|
||||
|
||||
<b>image_diff_class</b>(diff)
|
||||
|
||||
<a href="../classes/CommitsHelper.html#method-i-image_diff_class" name="method-i-image_diff_class" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-image_diff_class_source')" id="l_method-i-image_diff_class_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-image_diff_class_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/commits_helper.rb, line 58</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">image_diff_class</span>(<span class="ruby-identifier">diff</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">deleted_file</span>
|
||||
<span class="ruby-string">"diff_removed"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">new_file</span>
|
||||
<span class="ruby-string">"diff_added"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">nil</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,232 +0,0 @@
|
|||
<?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>CompareController</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>
|
||||
CompareController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/compare_controller_rb.html">app/controllers/compare_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create">create</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<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-create">
|
||||
|
||||
<b>create</b>()
|
||||
|
||||
<a href="../classes/CompareController.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/compare_controller.rb, line 22</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">project_compare_path</span>(<span class="ruby-ivar">@project</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:from</span>], <span class="ruby-identifier">params</span>[<span class="ruby-value">:to</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../classes/CompareController.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/compare_controller.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show">
|
||||
|
||||
<b>show</b>()
|
||||
|
||||
<a href="../classes/CompareController.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/compare_controller.rb, line 10</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-identifier">result</span> = <span class="ruby-constant">Commit</span>.<span class="ruby-identifier">compare</span>(<span class="ruby-identifier">project</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:from</span>], <span class="ruby-identifier">params</span>[<span class="ruby-value">:to</span>])
|
||||
|
||||
<span class="ruby-ivar">@commits</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:commits</span>]
|
||||
<span class="ruby-ivar">@commit</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:commit</span>]
|
||||
<span class="ruby-ivar">@diffs</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:diffs</span>]
|
||||
<span class="ruby-ivar">@refs_are_same</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:same</span>]
|
||||
<span class="ruby-ivar">@line_notes</span> = []
|
||||
|
||||
<span class="ruby-ivar">@commits</span> = <span class="ruby-constant">CommitDecorator</span>.<span class="ruby-identifier">decorate</span>(<span class="ruby-ivar">@commits</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,411 +0,0 @@
|
|||
<?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>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>
|
||||
DashboardController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ApplicationController.html">ApplicationController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/dashboard_controller_rb.html">app/controllers/dashboard_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-dashboard_filter">dashboard_filter</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-event_filter">event_filter</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-issues">issues</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>M</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-merge_requests">merge_requests</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-projects">projects</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/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/dashboard_controller.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-ivar">@groups</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">authorized_groups</span>
|
||||
|
||||
<span class="ruby-ivar">@has_authorized_projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">></span> <span class="ruby-number">0</span>
|
||||
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:scope</span>]
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'personal'</span> <span class="ruby-keyword">then</span>
|
||||
<span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">personal</span>(<span class="ruby-identifier">current_user</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'joined'</span> <span class="ruby-keyword">then</span>
|
||||
<span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">joined</span>(<span class="ruby-identifier">current_user</span>)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-ivar">@projects</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-ivar">@projects</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-number">30</span>)
|
||||
|
||||
<span class="ruby-ivar">@events</span> = <span class="ruby-constant">Event</span>.<span class="ruby-identifier">in_projects</span>(<span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">project_ids</span>)
|
||||
<span class="ruby-ivar">@events</span> = <span class="ruby-ivar">@event_filter</span>.<span class="ruby-identifier">apply_filter</span>(<span class="ruby-ivar">@events</span>)
|
||||
<span class="ruby-ivar">@events</span> = <span class="ruby-ivar">@events</span>.<span class="ruby-identifier">limit</span>(<span class="ruby-number">20</span>).<span class="ruby-identifier">offset</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:offset</span>] <span class="ruby-operator">||</span> <span class="ruby-number">0</span>)
|
||||
|
||||
<span class="ruby-ivar">@last_push</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">recent_push</span>
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">atom</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</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-issues">
|
||||
|
||||
<b>issues</b>()
|
||||
|
||||
<a href="../classes/DashboardController.html#method-i-issues" name="method-i-issues" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Get only assigned issues</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-issues_source')" id="l_method-i-issues_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-issues_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/dashboard_controller.rb, line 44</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">issues</span>
|
||||
<span class="ruby-ivar">@issues</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">assigned_issues</span>
|
||||
<span class="ruby-ivar">@issues</span> = <span class="ruby-identifier">dashboard_filter</span>(<span class="ruby-ivar">@issues</span>)
|
||||
<span class="ruby-ivar">@issues</span> = <span class="ruby-ivar">@issues</span>.<span class="ruby-identifier">recent</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-number">20</span>)
|
||||
<span class="ruby-ivar">@issues</span> = <span class="ruby-ivar">@issues</span>.<span class="ruby-identifier">includes</span>(<span class="ruby-value">:author</span>, <span class="ruby-value">:project</span>)
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">atom</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">layout</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</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-merge_requests">
|
||||
|
||||
<b>merge_requests</b>()
|
||||
|
||||
<a href="../classes/DashboardController.html#method-i-merge_requests" name="method-i-merge_requests" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Get authored or assigned open merge requests</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-merge_requests_source')" id="l_method-i-merge_requests_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-merge_requests_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/dashboard_controller.rb, line 37</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">merge_requests</span>
|
||||
<span class="ruby-ivar">@merge_requests</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">cared_merge_requests</span>
|
||||
<span class="ruby-ivar">@merge_requests</span> = <span class="ruby-identifier">dashboard_filter</span>(<span class="ruby-ivar">@merge_requests</span>)
|
||||
<span class="ruby-ivar">@merge_requests</span> = <span class="ruby-ivar">@merge_requests</span>.<span class="ruby-identifier">recent</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-number">20</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Protected methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-dashboard_filter">
|
||||
|
||||
<b>dashboard_filter</b>(items)
|
||||
|
||||
<a href="../classes/DashboardController.html#method-i-dashboard_filter" name="method-i-dashboard_filter" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-dashboard_filter_source')" id="l_method-i-dashboard_filter_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-dashboard_filter_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/dashboard_controller.rb, line 66</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">dashboard_filter</span> <span class="ruby-identifier">items</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>]
|
||||
<span class="ruby-identifier">items</span> = <span class="ruby-identifier">items</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">project_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>])
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:search</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-identifier">items</span> = <span class="ruby-identifier">items</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:search</span>])
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status</span>]
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'closed'</span>
|
||||
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">closed</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'all'</span>
|
||||
<span class="ruby-identifier">items</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">opened</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-event_filter">
|
||||
|
||||
<b>event_filter</b>()
|
||||
|
||||
<a href="../classes/DashboardController.html#method-i-event_filter" name="method-i-event_filter" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-event_filter_source')" id="l_method-i-event_filter_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-event_filter_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/dashboard_controller.rb, line 62</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">event_filter</span>
|
||||
<span class="ruby-ivar">@event_filter</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">EventFilter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:event_filter</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-projects">
|
||||
|
||||
<b>projects</b>()
|
||||
|
||||
<a href="../classes/DashboardController.html#method-i-projects" name="method-i-projects" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-projects_source')" id="l_method-i-projects_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-projects_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/dashboard_controller.rb, line 58</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">projects</span>
|
||||
<span class="ruby-ivar">@projects</span> = <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">authorized_projects</span>.<span class="ruby-identifier">sorted_by_activity</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,195 +0,0 @@
|
|||
<?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>DashboardHelper</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>
|
||||
DashboardHelper
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/helpers/dashboard_helper_rb.html">app/helpers/dashboard_helper.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-dashboard_filter_path">dashboard_filter_path</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-entities_per_project">entities_per_project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-dashboard_filter_path">
|
||||
|
||||
<b>dashboard_filter_path</b>(entity, options={})
|
||||
|
||||
<a href="../classes/DashboardHelper.html#method-i-dashboard_filter_path" name="method-i-dashboard_filter_path" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-dashboard_filter_path_source')" id="l_method-i-dashboard_filter_path_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-dashboard_filter_path_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/dashboard_helper.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">dashboard_filter_path</span>(<span class="ruby-identifier">entity</span>, <span class="ruby-identifier">options</span>={})
|
||||
<span class="ruby-identifier">exist_opts</span> = {
|
||||
<span class="ruby-identifier">status</span><span class="ruby-operator">:</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status</span>],
|
||||
<span class="ruby-identifier">project_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:project_id</span>],
|
||||
}
|
||||
|
||||
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">exist_opts</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
||||
|
||||
<span class="ruby-keyword">case</span> <span class="ruby-identifier">entity</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'issue'</span> <span class="ruby-keyword">then</span>
|
||||
<span class="ruby-identifier">dashboard_issues_path</span>(<span class="ruby-identifier">options</span>)
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'merge_request'</span>
|
||||
<span class="ruby-identifier">dashboard_merge_requests_path</span>(<span class="ruby-identifier">options</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-entities_per_project">
|
||||
|
||||
<b>entities_per_project</b>(project, entity)
|
||||
|
||||
<a href="../classes/DashboardHelper.html#method-i-entities_per_project" name="method-i-entities_per_project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-entities_per_project_source')" id="l_method-i-entities_per_project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-entities_per_project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/dashboard_helper.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">entities_per_project</span> <span class="ruby-identifier">project</span>, <span class="ruby-identifier">entity</span>
|
||||
<span class="ruby-identifier">items</span> = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">items_for</span>(<span class="ruby-identifier">entity</span>)
|
||||
|
||||
<span class="ruby-identifier">items</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status</span>]
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'closed'</span>
|
||||
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">closed</span>
|
||||
<span class="ruby-keyword">when</span> <span class="ruby-string">'all'</span>
|
||||
<span class="ruby-identifier">items</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">opened</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">assignee_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">id</span>).<span class="ruby-identifier">count</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,332 +0,0 @@
|
|||
<?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>DeployKeysController</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>
|
||||
DeployKeysController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ProjectResourceController.html">ProjectResourceController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/deploy_keys_controller_rb.html">app/controllers/deploy_keys_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create">create</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-destroy">destroy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>I</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-index">index</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<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-create">
|
||||
|
||||
<b>create</b>()
|
||||
|
||||
<a href="../classes/DeployKeysController.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/deploy_keys_controller.rb, line 21</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create</span>
|
||||
<span class="ruby-ivar">@key</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:key</span>])
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@key</span>.<span class="ruby-identifier">save</span>
|
||||
<span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">project_deploy_keys_path</span>(<span class="ruby-ivar">@project</span>)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"new"</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-destroy">
|
||||
|
||||
<b>destroy</b>()
|
||||
|
||||
<a href="../classes/DeployKeysController.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-destroy_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/deploy_keys_controller.rb, line 30</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroy</span>
|
||||
<span class="ruby-ivar">@key</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-ivar">@key</span>.<span class="ruby-identifier">destroy</span>
|
||||
|
||||
<span class="ruby-identifier">respond_to</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">project_deploy_keys_url</span> }
|
||||
<span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">nothing</span><span class="ruby-operator">:</span> <span class="ruby-keyword">true</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-index">
|
||||
|
||||
<b>index</b>()
|
||||
|
||||
<a href="../classes/DeployKeysController.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/deploy_keys_controller.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>
|
||||
<span class="ruby-ivar">@keys</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">all</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-new">
|
||||
|
||||
<b>new</b>()
|
||||
|
||||
<a href="../classes/DeployKeysController.html#method-i-new" name="method-i-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-new_source')" id="l_method-i-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/deploy_keys_controller.rb, line 15</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">new</span>
|
||||
<span class="ruby-ivar">@key</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">new</span>
|
||||
|
||||
<span class="ruby-identifier">respond_with</span>(<span class="ruby-ivar">@key</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-show">
|
||||
|
||||
<b>show</b>()
|
||||
|
||||
<a href="../classes/DeployKeysController.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/deploy_keys_controller.rb, line 11</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">show</span>
|
||||
<span class="ruby-ivar">@key</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">deploy_keys</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,131 +0,0 @@
|
|||
<?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>ErrorsController</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>
|
||||
ErrorsController
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ApplicationController.html">ApplicationController</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/controllers/errors_controller_rb.html">app/controllers/errors_controller.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-githost">githost</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-githost">
|
||||
|
||||
<b>githost</b>()
|
||||
|
||||
<a href="../classes/ErrorsController.html#method-i-githost" name="method-i-githost" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-githost_source')" id="l_method-i-githost_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-githost_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/controllers/errors_controller.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">githost</span>
|
||||
<span class="ruby-identifier">render</span> <span class="ruby-string">"errors/gitolite"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,240 +0,0 @@
|
|||
<?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>EventDecorator</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>
|
||||
EventDecorator
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="ApplicationDecorator.html">ApplicationDecorator</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/decorators/event_decorator_rb.html">app/decorators/event_decorator.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>F</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-feed_summary">feed_summary</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-feed_title">feed_title</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-feed_url">feed_url</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-feed_summary">
|
||||
|
||||
<b>feed_summary</b>()
|
||||
|
||||
<a href="../classes/EventDecorator.html#method-i-feed_summary" name="method-i-feed_summary" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-feed_summary_source')" id="l_method-i-feed_summary_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-feed_summary_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/event_decorator.rb, line 37</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">feed_summary</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">issue?</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">render</span> <span class="ruby-string">"events/event_issue"</span>, <span class="ruby-identifier">issue</span><span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">issue</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">push?</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">render</span> <span class="ruby-string">"events/event_push"</span>, <span class="ruby-identifier">event</span><span class="ruby-operator">:</span> <span class="ruby-keyword">self</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-feed_title">
|
||||
|
||||
<b>feed_title</b>()
|
||||
|
||||
<a href="../classes/EventDecorator.html#method-i-feed_title" name="method-i-feed_title" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-feed_title_source')" id="l_method-i-feed_title_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-feed_title_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/event_decorator.rb, line 4</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">feed_title</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">issue?</span>
|
||||
<span class="ruby-node">"#{self.author_name} #{self.action_name} issue ##{self.target_id}: #{self.issue_title} at #{self.project.name}"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merge_request?</span>
|
||||
<span class="ruby-node">"#{self.author_name} #{self.action_name} MR ##{self.target_id}: #{self.merge_request_title} at #{self.project.name}"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">push?</span>
|
||||
<span class="ruby-node">"#{self.author_name} #{self.push_action_name} #{self.ref_type} #{self.ref_name} at #{self.project.name}"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">membership_changed?</span>
|
||||
<span class="ruby-node">"#{self.author_name} #{self.action_name} #{self.project.name}"</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-string">""</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-feed_url">
|
||||
|
||||
<b>feed_url</b>()
|
||||
|
||||
<a href="../classes/EventDecorator.html#method-i-feed_url" name="method-i-feed_url" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-feed_url_source')" id="l_method-i-feed_url_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-feed_url_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/decorators/event_decorator.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">feed_url</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">issue?</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_issue_url</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">project</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">issue</span>)
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merge_request?</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_merge_request_url</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">project</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merge_request</span>)
|
||||
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">push?</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">push_with_commits?</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">commits_count</span> <span class="ruby-operator">></span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_compare_url</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">project</span>, <span class="ruby-value">:from</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent_commit</span>.<span class="ruby-identifier">id</span>, <span class="ruby-value">:to</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">last_commit</span>.<span class="ruby-identifier">id</span>)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_commit_url</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">project</span>, <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">last_commit</span>.<span class="ruby-identifier">id</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">h</span>.<span class="ruby-identifier">project_commits_url</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">project</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_name</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,543 +0,0 @@
|
|||
<?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>EventFilter</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>
|
||||
EventFilter
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Object
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/lib/event_filter_rb.html">lib/event_filter.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-active-3F">active?</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-apply_filter">apply_filter</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-comments">comments</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>D</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-default_filter">default_filter</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>M</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-merged">merged</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>O</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-options">options</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-push">push</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>T</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-team">team</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Section attributes -->
|
||||
<div class="sectiontitle">Attributes</div>
|
||||
<table border='0' cellpadding='5'>
|
||||
|
||||
<tr valign='top'>
|
||||
<td class='attr-rw'>
|
||||
[RW]
|
||||
</td>
|
||||
<td class='attr-name'>params</td>
|
||||
<td class='attr-desc'></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Class Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-comments">
|
||||
|
||||
<b>comments</b>()
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-comments" name="method-c-comments" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-comments_source')" id="l_method-c-comments_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-comments_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 17</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">comments</span>
|
||||
<span class="ruby-string">'comments'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-default_filter">
|
||||
|
||||
<b>default_filter</b>()
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-default_filter" name="method-c-default_filter" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-default_filter_source')" id="l_method-c-default_filter_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-default_filter_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 5</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">default_filter</span>
|
||||
<span class="ruby-node">%w{ push issues merge_requests team}</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-merged">
|
||||
|
||||
<b>merged</b>()
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-merged" name="method-c-merged" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-merged_source')" id="l_method-c-merged_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-merged_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 13</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">merged</span>
|
||||
<span class="ruby-string">'merged'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-new">
|
||||
|
||||
<b>new</b>(params)
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-new" name="method-c-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 26</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span> <span class="ruby-identifier">params</span>
|
||||
<span class="ruby-ivar">@params</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>
|
||||
<span class="ruby-identifier">params</span>.<span class="ruby-identifier">dup</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
[]<span class="ruby-comment">#EventFilter.default_filter</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-c-push">
|
||||
|
||||
<b>push</b>()
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-push" name="method-c-push" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-push_source')" id="l_method-c-push_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-push_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 9</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">push</span>
|
||||
<span class="ruby-string">'push'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-team">
|
||||
|
||||
<b>team</b>()
|
||||
|
||||
<a href="../classes/EventFilter.html#method-c-team" name="method-c-team" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-team_source')" id="l_method-c-team_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-team_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 21</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">team</span>
|
||||
<span class="ruby-string">'team'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-active-3F">
|
||||
|
||||
<b>active?</b>(key)
|
||||
|
||||
<a href="../classes/EventFilter.html#method-i-active-3F" name="method-i-active-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-active-3F_source')" id="l_method-i-active-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-active-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 65</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">active?</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-identifier">params</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-apply_filter">
|
||||
|
||||
<b>apply_filter</b>(events)
|
||||
|
||||
<a href="../classes/EventFilter.html#method-i-apply_filter" name="method-i-apply_filter" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-apply_filter_source')" id="l_method-i-apply_filter_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-apply_filter_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 34</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">apply_filter</span> <span class="ruby-identifier">events</span>
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">events</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">present?</span>
|
||||
|
||||
<span class="ruby-identifier">filter</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">dup</span>
|
||||
|
||||
<span class="ruby-identifier">actions</span> = []
|
||||
<span class="ruby-identifier">actions</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Pushed</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">'push'</span>
|
||||
<span class="ruby-identifier">actions</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Merged</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">'merged'</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">'team'</span>
|
||||
<span class="ruby-identifier">actions</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Joined</span>
|
||||
<span class="ruby-identifier">actions</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Left</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">actions</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Event</span><span class="ruby-operator">::</span><span class="ruby-constant">Commented</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">'comments'</span>
|
||||
|
||||
<span class="ruby-identifier">events</span> = <span class="ruby-identifier">events</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">action</span><span class="ruby-operator">:</span> <span class="ruby-identifier">actions</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-options">
|
||||
|
||||
<b>options</b>(key)
|
||||
|
||||
<a href="../classes/EventFilter.html#method-i-options" name="method-i-options" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-options_source')" id="l_method-i-options_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-options_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/event_filter.rb, line 53</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">options</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-identifier">filter</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">dup</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-identifier">filter</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">filter</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">filter</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,289 +0,0 @@
|
|||
<?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>EventsHelper</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>
|
||||
EventsHelper
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/helpers/events_helper_rb.html">app/helpers/events_helper.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-event_action_name">event_action_name</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-event_filter_link">event_filter_link</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-event_image">event_image</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>L</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-link_to_author">link_to_author</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-event_action_name">
|
||||
|
||||
<b>event_action_name</b>(event)
|
||||
|
||||
<a href="../classes/EventsHelper.html#method-i-event_action_name" name="method-i-event_action_name" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-event_action_name_source')" id="l_method-i-event_action_name_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-event_action_name_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/events_helper.rb, line 13</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">event_action_name</span>(<span class="ruby-identifier">event</span>)
|
||||
<span class="ruby-identifier">target</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">target_type</span>
|
||||
<span class="ruby-identifier">event</span>.<span class="ruby-identifier">target_type</span>.<span class="ruby-identifier">titleize</span>.<span class="ruby-identifier">downcase</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-string">'project'</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
[<span class="ruby-identifier">event</span>.<span class="ruby-identifier">action_name</span>, <span class="ruby-identifier">target</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">" "</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-event_filter_link">
|
||||
|
||||
<b>event_filter_link</b>(key, tooltip)
|
||||
|
||||
<a href="../classes/EventsHelper.html#method-i-event_filter_link" name="method-i-event_filter_link" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-event_filter_link_source')" id="l_method-i-event_filter_link_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-event_filter_link_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/events_helper.rb, line 37</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">event_filter_link</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">tooltip</span>
|
||||
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>
|
||||
|
||||
<span class="ruby-identifier">filter</span> = <span class="ruby-ivar">@event_filter</span>.<span class="ruby-identifier">options</span> <span class="ruby-identifier">key</span>
|
||||
|
||||
<span class="ruby-identifier">inactive</span> = <span class="ruby-keyword">if</span> <span class="ruby-ivar">@event_filter</span>.<span class="ruby-identifier">active?</span> <span class="ruby-identifier">key</span>
|
||||
<span class="ruby-keyword">nil</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-string">'inactive'</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">content_tag</span> <span class="ruby-value">:div</span>, <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-node">"filter_icon #{inactive}"</span> <span class="ruby-keyword ruby-title">do</span>
|
||||
<span class="ruby-identifier">link_to</span> <span class="ruby-identifier">dashboard_path</span>(<span class="ruby-identifier">event_filter</span><span class="ruby-operator">:</span> <span class="ruby-identifier">filter</span>), <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-string">'has_tooltip'</span>, <span class="ruby-string">'data-original-title'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword ruby-title">tooltip</span> <span class="ruby-keyword">do</span>
|
||||
<span class="ruby-identifier">image_tag</span> <span class="ruby-node">"event_filter_#{key}.png"</span>
|
||||
<span class="ruby-keyword">end</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-event_image">
|
||||
|
||||
<b>event_image</b>(event)
|
||||
|
||||
<a href="../classes/EventsHelper.html#method-i-event_image" name="method-i-event_image" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-event_image_source')" id="l_method-i-event_image_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-event_image_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/events_helper.rb, line 23</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">event_image</span> <span class="ruby-identifier">event</span>
|
||||
<span class="ruby-identifier">event_image_path</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">push?</span>
|
||||
<span class="ruby-string">"event_push.png"</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">merged?</span>
|
||||
<span class="ruby-string">"event_mr_merged.png"</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">event_image_path</span>
|
||||
|
||||
<span class="ruby-identifier">content_tag</span> <span class="ruby-value">:div</span>, <span class="ruby-keyword">class</span><span class="ruby-operator">:</span> <span class="ruby-string">'event_icon'</span> <span class="ruby-keyword ruby-title">do</span>
|
||||
<span class="ruby-identifier">image_tag</span> <span class="ruby-identifier">event_image_path</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-link_to_author">
|
||||
|
||||
<b>link_to_author</b>(event)
|
||||
|
||||
<a href="../classes/EventsHelper.html#method-i-link_to_author" name="method-i-link_to_author" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-link_to_author_source')" id="l_method-i-link_to_author_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-link_to_author_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/helpers/events_helper.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">link_to_author</span>(<span class="ruby-identifier">event</span>)
|
||||
<span class="ruby-identifier">project</span> = <span class="ruby-identifier">event</span>.<span class="ruby-identifier">project</span>
|
||||
<span class="ruby-identifier">tm</span> = <span class="ruby-identifier">project</span>.<span class="ruby-identifier">team_member_by_id</span>(<span class="ruby-identifier">event</span>.<span class="ruby-identifier">author_id</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">tm</span>
|
||||
<span class="ruby-identifier">link_to</span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">author_name</span>, <span class="ruby-identifier">project_team_member_path</span>(<span class="ruby-identifier">project</span>, <span class="ruby-identifier">tm</span>)
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">event</span>.<span class="ruby-identifier">author_name</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,300 +0,0 @@
|
|||
<?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>ExtractsPath</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>
|
||||
ExtractsPath
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/lib/extracts_path_rb.html">lib/extracts_path.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Module providing methods for dealing with separating a tree-ish string and
|
||||
a file path string when combined in a request parameter</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Namespace -->
|
||||
<div class="sectiontitle">Namespace</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="ExtractsPath/InvalidPathError.html">ExtractsPath::InvalidPathError</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>A</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-assign_ref_vars">assign_ref_vars</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>E</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-extract_ref">extract_ref</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-assign_ref_vars">
|
||||
|
||||
<b>assign_ref_vars</b>()
|
||||
|
||||
<a href="../classes/ExtractsPath.html#method-i-assign_ref_vars" name="method-i-assign_ref_vars" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Assigns common instance variables for views working with Git tree-ish
|
||||
objects</p>
|
||||
|
||||
<p>Assignments are:</p>
|
||||
<ul><li>
|
||||
<p>@id - A string representing the joined ref and path</p>
|
||||
</li><li>
|
||||
<p>@ref - A string representing the ref (e.g., the branch, tag, or commit
|
||||
SHA)</p>
|
||||
</li><li>
|
||||
<p>@path - A string representing the filesystem path</p>
|
||||
</li><li>
|
||||
<p>@commit - A <a href="CommitDecorator.html">CommitDecorator</a> representing
|
||||
the commit from the given ref</p>
|
||||
</li><li>
|
||||
<p>@tree - A <a href="TreeDecorator.html">TreeDecorator</a> representing the
|
||||
tree at the given ref/path</p>
|
||||
</li></ul>
|
||||
|
||||
<p>If the :id parameter appears to be requesting a specific response format,
|
||||
that will be handled as well.</p>
|
||||
|
||||
<p>Automatically renders `not_found!` if a valid tree path could not be
|
||||
resolved (e.g., when a user inserts an invalid path or ref).</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-assign_ref_vars_source')" id="l_method-i-assign_ref_vars_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-assign_ref_vars_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/extracts_path.rb, line 104</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">assign_ref_vars</span>
|
||||
<span class="ruby-comment"># Handle formats embedded in the id</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>].<span class="ruby-identifier">ends_with?</span>(<span class="ruby-string">'.atom'</span>)
|
||||
<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>].<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r\.atom$/</span>, <span class="ruby-string">''</span>)
|
||||
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">format</span> = <span class="ruby-value">:atom</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-ivar">@ref</span>, <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">extract_ref</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">fullpath</span>)
|
||||
|
||||
<span class="ruby-ivar">@id</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@ref</span>, <span class="ruby-ivar">@path</span>)
|
||||
|
||||
<span class="ruby-ivar">@commit</span> = <span class="ruby-constant">CommitDecorator</span>.<span class="ruby-identifier">decorate</span>(<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">commit</span>(<span class="ruby-ivar">@ref</span>))
|
||||
|
||||
<span class="ruby-ivar">@tree</span> = <span class="ruby-constant">Tree</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@commit</span>.<span class="ruby-identifier">tree</span>, <span class="ruby-ivar">@project</span>, <span class="ruby-ivar">@ref</span>, <span class="ruby-ivar">@path</span>)
|
||||
<span class="ruby-ivar">@tree</span> = <span class="ruby-constant">TreeDecorator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@tree</span>)
|
||||
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPathError</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@tree</span>.<span class="ruby-identifier">invalid?</span>
|
||||
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-constant">InvalidPathError</span>
|
||||
<span class="ruby-identifier">not_found!</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-extract_ref">
|
||||
|
||||
<b>extract_ref</b>(input)
|
||||
|
||||
<a href="../classes/ExtractsPath.html#method-i-extract_ref" name="method-i-extract_ref" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Given a string containing both a Git tree-ish, such as a branch or tag, and
|
||||
a filesystem path joined by forward slashes, attempts to separate the two.</p>
|
||||
|
||||
<p>Expects a @project instance variable to contain the active project. This is
|
||||
used to check the input against a list of valid repository refs.</p>
|
||||
|
||||
<p>Examples</p>
|
||||
|
||||
<pre class="ruby"><span class="ruby-comment"># No @project available</span>
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">'master'</span>)
|
||||
<span class="ruby-comment"># => ['', '']</span>
|
||||
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">'master'</span>)
|
||||
<span class="ruby-comment"># => ['master', '']</span>
|
||||
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">"f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG"</span>)
|
||||
<span class="ruby-comment"># => ['f4b14494ef6abf3d144c28e4af0c20143383e062', 'CHANGELOG']</span>
|
||||
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">"v2.0.0/README.md"</span>)
|
||||
<span class="ruby-comment"># => ['v2.0.0', 'README.md']</span>
|
||||
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">'/gitlab/vagrant/tree/master/app/models/project.rb'</span>)
|
||||
<span class="ruby-comment"># => ['master', 'app/models/project.rb']</span>
|
||||
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">'issues/1234/app/models/project.rb'</span>)
|
||||
<span class="ruby-comment"># => ['issues/1234', 'app/models/project.rb']</span>
|
||||
|
||||
<span class="ruby-comment"># Given an invalid branch, we fall back to just splitting on the first slash</span>
|
||||
<span class="ruby-identifier">extract_ref</span>(<span class="ruby-string">'non/existent/branch/README.md'</span>)
|
||||
<span class="ruby-comment"># => ['non', 'existent/branch/README.md']</span>
|
||||
</pre>
|
||||
|
||||
<p>Returns an Array where the first value is the tree-ish and the second is
|
||||
the path</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-extract_ref_source')" id="l_method-i-extract_ref_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-extract_ref_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/extracts_path.rb, line 48</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">extract_ref</span>(<span class="ruby-identifier">input</span>)
|
||||
<span class="ruby-identifier">pair</span> = [<span class="ruby-string">''</span>, <span class="ruby-string">''</span>]
|
||||
|
||||
<span class="ruby-keyword">return</span> <span class="ruby-identifier">pair</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@project</span>
|
||||
|
||||
<span class="ruby-comment"># Remove project, actions and all other staff from path</span>
|
||||
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-node">"/#{@project.path_with_namespace}"</span>, <span class="ruby-string">""</span>)
|
||||
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r^\/(tree|commits|blame|blob)\//</span>, <span class="ruby-string">""</span>) <span class="ruby-comment"># remove actions</span>
|
||||
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r\?.*$/</span>, <span class="ruby-string">""</span>) <span class="ruby-comment"># remove stamps suffix</span>
|
||||
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r.atom$/</span>, <span class="ruby-string">""</span>) <span class="ruby-comment"># remove rss feed</span>
|
||||
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r\/edit$/</span>, <span class="ruby-string">""</span>) <span class="ruby-comment"># remove edit route part</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^([[:alnum:]]{40})(.+)/</span>)
|
||||
<span class="ruby-comment"># If the ref appears to be a SHA, we're done, just split the string</span>
|
||||
<span class="ruby-identifier">pair</span> = <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">captures</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-comment"># Otherwise, attempt to detect the ref using a list of the project's</span>
|
||||
<span class="ruby-comment"># branches and tags</span>
|
||||
|
||||
<span class="ruby-comment"># Append a trailing slash if we only get a ref and no file path</span>
|
||||
<span class="ruby-identifier">id</span> = <span class="ruby-identifier">input</span>
|
||||
<span class="ruby-identifier">id</span> <span class="ruby-operator">+=</span> <span class="ruby-string">'/'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">id</span>.<span class="ruby-identifier">ends_with?</span>(<span class="ruby-string">'/'</span>)
|
||||
|
||||
<span class="ruby-identifier">valid_refs</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">ref_names</span>
|
||||
<span class="ruby-identifier">valid_refs</span>.<span class="ruby-identifier">select!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">id</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-node">"#{v}/"</span>) }
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">valid_refs</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-number">1</span>
|
||||
<span class="ruby-comment"># No exact ref match, so just try our best</span>
|
||||
<span class="ruby-identifier">pair</span> = <span class="ruby-identifier">id</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r([^\/]+)(.*)/</span>).<span class="ruby-identifier">captures</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-comment"># Partition the string into the ref and the path, ignoring the empty first value</span>
|
||||
<span class="ruby-identifier">pair</span> = <span class="ruby-identifier">id</span>.<span class="ruby-identifier">partition</span>(<span class="ruby-identifier">valid_refs</span>.<span class="ruby-identifier">first</span>)[<span class="ruby-number">1</span><span class="ruby-operator">..</span><span class="ruby-number">-1</span>]
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-comment"># Remove ending slashes from path</span>
|
||||
<span class="ruby-identifier">pair</span>[<span class="ruby-number">1</span>].<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">%r^\/|\/$/</span>, <span class="ruby-string">''</span>)
|
||||
|
||||
<span class="ruby-identifier">pair</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||
<?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>ExtractsPath::InvalidPathError</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>
|
||||
ExtractsPath::InvalidPathError
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
StandardError
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/extracts_path_rb.html">lib/extracts_path.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p>Raised when given an invalid file path</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,376 +0,0 @@
|
|||
<?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>FileSizeValidator</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>
|
||||
FileSizeValidator
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
ActiveModel::EachValidator
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/lib/file_size_validator_rb.html">lib/file_size_validator.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="FileSizeValidator/Helper.html">FileSizeValidator::Helper</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-check_validity-21">check_validity!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>H</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-help">help</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-new">new</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>V</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-validate_each">validate_each</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Section constants -->
|
||||
<div class="sectiontitle">Constants</div>
|
||||
<table border='0' cellpadding='5'>
|
||||
|
||||
<tr valign='top'>
|
||||
<td class="attr-name">MESSAGES</td>
|
||||
<td>=</td>
|
||||
<td class="attr-value">{ is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze</td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td> </td>
|
||||
<td colspan="2" class="attr-desc"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign='top'>
|
||||
<td class="attr-name">CHECKS</td>
|
||||
<td>=</td>
|
||||
<td class="attr-value">{ is: :==, minimum: :>=, maximum: :<= }.freeze</td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td> </td>
|
||||
<td colspan="2" class="attr-desc"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign='top'>
|
||||
<td class="attr-name">DEFAULT_TOKENIZER</td>
|
||||
<td>=</td>
|
||||
<td class="attr-value">lambda { |value| value.split(//) }</td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td> </td>
|
||||
<td colspan="2" class="attr-desc"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign='top'>
|
||||
<td class="attr-name">RESERVED_OPTIONS</td>
|
||||
<td>=</td>
|
||||
<td class="attr-value">[:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]</td>
|
||||
</tr>
|
||||
|
||||
<tr valign='top'>
|
||||
<td> </td>
|
||||
<td colspan="2" class="attr-desc"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Class Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-new">
|
||||
|
||||
<b>new</b>(options)
|
||||
|
||||
<a href="../classes/FileSizeValidator.html#method-c-new" name="method-c-new" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-new_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/file_size_validator.rb, line 8</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">options</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">range</span> = (<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:in</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:within</span>))
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">":in and :within must be a Range"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Range</span>)
|
||||
<span class="ruby-identifier">options</span>[<span class="ruby-value">:minimum</span>], <span class="ruby-identifier">options</span>[<span class="ruby-value">:maximum</span>] = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-identifier">range</span>.<span class="ruby-identifier">end</span>
|
||||
<span class="ruby-identifier">options</span>[<span class="ruby-value">:maximum</span>] <span class="ruby-operator">-=</span> <span class="ruby-number">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">exclude_end?</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-keyword">super</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-check_validity-21">
|
||||
|
||||
<b>check_validity!</b>()
|
||||
|
||||
<a href="../classes/FileSizeValidator.html#method-i-check_validity-21" name="method-i-check_validity-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-check_validity-21_source')" id="l_method-i-check_validity-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-check_validity-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/file_size_validator.rb, line 18</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">check_validity!</span>
|
||||
<span class="ruby-identifier">keys</span> = <span class="ruby-constant">CHECKS</span>.<span class="ruby-identifier">keys</span> & <span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">empty?</span>
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">'Range unspecified. Specify the :within, :maximum, :minimum, or :is option.'</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
|
||||
<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">key</span>]
|
||||
|
||||
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Integer</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">>=</span> <span class="ruby-number">0</span>
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">":#{key} must be a nonnegative Integer"</span>
|
||||
<span class="ruby-keyword">end</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-help">
|
||||
|
||||
<b>help</b>()
|
||||
|
||||
<a href="../classes/FileSizeValidator.html#method-i-help" name="method-i-help" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-help_source')" id="l_method-i-help_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-help_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/file_size_validator.rb, line 57</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">help</span>
|
||||
<span class="ruby-constant">Helper</span>.<span class="ruby-identifier">instance</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-validate_each">
|
||||
|
||||
<b>validate_each</b>(record, attribute, value)
|
||||
|
||||
<a href="../classes/FileSizeValidator.html#method-i-validate_each" name="method-i-validate_each" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-validate_each_source')" id="l_method-i-validate_each_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-validate_each_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/file_size_validator.rb, line 34</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">validate_each</span>(<span class="ruby-identifier">record</span>, <span class="ruby-identifier">attribute</span>, <span class="ruby-identifier">value</span>)
|
||||
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">"A CarrierWave::Uploader::Base object was expected"</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">CarrierWave</span><span class="ruby-operator">::</span><span class="ruby-constant">Uploader</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
|
||||
|
||||
<span class="ruby-identifier">value</span> = (<span class="ruby-identifier">options</span>[<span class="ruby-value">:tokenizer</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">DEFAULT_TOKENIZER</span>).<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
|
||||
|
||||
<span class="ruby-constant">CHECKS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">validity_check</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">check_value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">key</span>]
|
||||
|
||||
<span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> [] <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-value">:maximum</span>
|
||||
|
||||
<span class="ruby-identifier">value_size</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">size</span>
|
||||
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value_size</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">validity_check</span>, <span class="ruby-identifier">check_value</span>)
|
||||
|
||||
<span class="ruby-identifier">errors_options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">except</span>(*<span class="ruby-constant">RESERVED_OPTIONS</span>)
|
||||
<span class="ruby-identifier">errors_options</span>[<span class="ruby-value">:file_size</span>] = <span class="ruby-identifier">help</span>.<span class="ruby-identifier">number_to_human_size</span> <span class="ruby-identifier">check_value</span>
|
||||
|
||||
<span class="ruby-identifier">default_message</span> = <span class="ruby-identifier">options</span>[<span class="ruby-constant">MESSAGES</span>[<span class="ruby-identifier">key</span>]]
|
||||
<span class="ruby-identifier">errors_options</span>[<span class="ruby-value">:message</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">default_message</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">default_message</span>
|
||||
|
||||
<span class="ruby-identifier">record</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">attribute</span>, <span class="ruby-constant">MESSAGES</span>[<span class="ruby-identifier">key</span>], <span class="ruby-identifier">errors_options</span>)
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,94 +0,0 @@
|
|||
<?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>FileSizeValidator::Helper</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>
|
||||
FileSizeValidator::Helper
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Object
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/file_size_validator_rb.html">lib/file_size_validator.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Includes -->
|
||||
<div class="sectiontitle">Included Modules</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
|
||||
Singleton
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
ActionView::Helpers::NumberHelper
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,125 +0,0 @@
|
|||
<?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>GitHost</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>
|
||||
GitHost
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/app/roles/git_host_rb.html">app/roles/git_host.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>G</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-git_host">git_host</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-git_host">
|
||||
|
||||
<b>git_host</b>()
|
||||
|
||||
<a href="../classes/GitHost.html#method-i-git_host" name="method-i-git_host" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-git_host_source')" id="l_method-i-git_host_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-git_host_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File app/roles/git_host.rb, line 2</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">git_host</span>
|
||||
<span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">Gitolite</span>.<span class="ruby-identifier">new</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,265 +0,0 @@
|
|||
<?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>Gitlab</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>
|
||||
Gitlab
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../files/lib/gitlab/auth_rb.html">lib/gitlab/auth.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/regex_rb.html">lib/gitlab/regex.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/git_logger_rb.html">lib/gitlab/git_logger.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/satellite/merge_action_rb.html">lib/gitlab/satellite/merge_action.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/satellite/satellite_rb.html">lib/gitlab/satellite/satellite.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/satellite/edit_file_action_rb.html">lib/gitlab/satellite/edit_file_action.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/satellite/action_rb.html">lib/gitlab/satellite/action.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/backend/gitolite_config_rb.html">lib/gitlab/backend/gitolite_config.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/backend/gitolite_rb.html">lib/gitlab/backend/gitolite.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/logger_rb.html">lib/gitlab/logger.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/markdown_rb.html">lib/gitlab/markdown.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/app_logger_rb.html">lib/gitlab/app_logger.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/seeder_rb.html">lib/gitlab/seeder.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/git_stats_rb.html">lib/gitlab/git_stats.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/project_mover_rb.html">lib/gitlab/project_mover.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/graph/commit_rb.html">lib/gitlab/graph/commit.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/graph/json_builder_rb.html">lib/gitlab/graph/json_builder.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/theme_rb.html">lib/gitlab/theme.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/gitlab/inline_diff_rb.html">lib/gitlab/inline_diff.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/projects_rb.html">lib/api/projects.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/merge_requests_rb.html">lib/api/merge_requests.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/users_rb.html">lib/api/users.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/session_rb.html">lib/api/session.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/notes_rb.html">lib/api/notes.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/helpers_rb.html">lib/api/helpers.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/entities_rb.html">lib/api/entities.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/milestones_rb.html">lib/api/milestones.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api/issues_rb.html">lib/api/issues.rb</a></li>
|
||||
|
||||
<li><a href="../files/lib/api_rb.html">lib/api.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
<div class="description">
|
||||
|
||||
<p><a href="Gitlab/ProjectMover.html">ProjectMover</a> class</p>
|
||||
|
||||
<p>Used for moving project repositories from one subdir to another</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Namespace -->
|
||||
<div class="sectiontitle">Namespace</div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/APIHelpers.html">Gitlab::APIHelpers</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/Entities.html">Gitlab::Entities</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/Graph.html">Gitlab::Graph</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/Markdown.html">Gitlab::Markdown</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/Regex.html">Gitlab::Regex</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">MODULE</span>
|
||||
<a href="Gitlab/Satellite.html">Gitlab::Satellite</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/API.html">Gitlab::API</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/AppLogger.html">Gitlab::AppLogger</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Auth.html">Gitlab::Auth</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/GitLogger.html">Gitlab::GitLogger</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/GitStats.html">Gitlab::GitStats</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Gitolite.html">Gitlab::Gitolite</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/GitoliteConfig.html">Gitlab::GitoliteConfig</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/InlineDiff.html">Gitlab::InlineDiff</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Issues.html">Gitlab::Issues</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Logger.html">Gitlab::Logger</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/MergeRequests.html">Gitlab::MergeRequests</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Milestones.html">Gitlab::Milestones</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Notes.html">Gitlab::Notes</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/ProjectMover.html">Gitlab::ProjectMover</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Projects.html">Gitlab::Projects</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Seeder.html">Gitlab::Seeder</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Session.html">Gitlab::Session</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Theme.html">Gitlab::Theme</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Gitlab/Users.html">Gitlab::Users</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<?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>Gitlab::API</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>
|
||||
Gitlab::API
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Grape::API
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/api_rb.html">lib/api.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,703 +0,0 @@
|
|||
<?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>Gitlab::APIHelpers</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>
|
||||
Gitlab::APIHelpers
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/api/helpers_rb.html">lib/api/helpers.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-attributes_for_keys">attributes_for_keys</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authenticate-21">authenticate!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authenticated_as_admin-21">authenticated_as_admin!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-authorize-21">authorize!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-can-3F">can?</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-current_user">current_user</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>F</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-find_project">find_project</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-forbidden-21">forbidden!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>N</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-not_allowed-21">not_allowed!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-not_found-21">not_found!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>P</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-paginate">paginate</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>R</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-render_api_error-21">render_api_error!</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>U</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-unauthorized-21">unauthorized!</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-user_project">user_project</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-attributes_for_keys">
|
||||
|
||||
<b>attributes_for_keys</b>(keys)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-attributes_for_keys" name="method-i-attributes_for_keys" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-attributes_for_keys_source')" id="l_method-i-attributes_for_keys_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-attributes_for_keys_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 44</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">attributes_for_keys</span>(<span class="ruby-identifier">keys</span>)
|
||||
<span class="ruby-identifier">attrs</span> = {}
|
||||
<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
||||
<span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">present?</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-identifier">attrs</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authenticate-21">
|
||||
|
||||
<b>authenticate!</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-authenticate-21" name="method-i-authenticate-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authenticate-21_source')" id="l_method-i-authenticate-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authenticate-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 26</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authenticate!</span>
|
||||
<span class="ruby-identifier">unauthorized!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">current_user</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authenticated_as_admin-21">
|
||||
|
||||
<b>authenticated_as_admin!</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-authenticated_as_admin-21" name="method-i-authenticated_as_admin-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authenticated_as_admin-21_source')" id="l_method-i-authenticated_as_admin-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authenticated_as_admin-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 30</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authenticated_as_admin!</span>
|
||||
<span class="ruby-identifier">forbidden!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">is_admin?</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-authorize-21">
|
||||
|
||||
<b>authorize!</b>(action, subject)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-authorize-21" name="method-i-authorize-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-authorize-21_source')" id="l_method-i-authorize-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-authorize-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 34</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">authorize!</span> <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>
|
||||
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">abilities</span>.<span class="ruby-identifier">allowed?</span>(<span class="ruby-identifier">current_user</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-identifier">forbidden!</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-can-3F">
|
||||
|
||||
<b>can?</b>(object, action, subject)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-can-3F" name="method-i-can-3F" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-can-3F_source')" id="l_method-i-can-3F_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-can-3F_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 40</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">can?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-identifier">abilities</span>.<span class="ruby-identifier">allowed?</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">subject</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-current_user">
|
||||
|
||||
<b>current_user</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-current_user" name="method-i-current_user" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-current_user_source')" id="l_method-i-current_user_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-current_user_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 3</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">current_user</span>
|
||||
<span class="ruby-ivar">@current_user</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_authentication_token</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:private_token</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-string">"HTTP_PRIVATE_TOKEN"</span>])
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-find_project">
|
||||
|
||||
<b>find_project</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-find_project" name="method-i-find_project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-find_project_source')" id="l_method-i-find_project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-find_project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 12</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">find_project</span>
|
||||
<span class="ruby-identifier">project</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">find_by_id</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]) <span class="ruby-operator">||</span> <span class="ruby-constant">Project</span>.<span class="ruby-identifier">find_with_namespace</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-identifier">project</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">can?</span>(<span class="ruby-identifier">current_user</span>, <span class="ruby-value">:read_project</span>, <span class="ruby-identifier">project</span>)
|
||||
<span class="ruby-identifier">project</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">nil</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-forbidden-21">
|
||||
|
||||
<b>forbidden!</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-forbidden-21" name="method-i-forbidden-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>error helpers</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-forbidden-21_source')" id="l_method-i-forbidden-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-forbidden-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 54</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">forbidden!</span>
|
||||
<span class="ruby-identifier">render_api_error!</span>(<span class="ruby-string">'403 Forbidden'</span>, <span class="ruby-number">403</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-not_allowed-21">
|
||||
|
||||
<b>not_allowed!</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-not_allowed-21" name="method-i-not_allowed-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-not_allowed-21_source')" id="l_method-i-not_allowed-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-not_allowed-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 69</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">not_allowed!</span>
|
||||
<span class="ruby-identifier">render_api_error!</span>(<span class="ruby-string">'Method Not Allowed'</span>, <span class="ruby-number">405</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-not_found-21">
|
||||
|
||||
<b>not_found!</b>(resource = nil)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-not_found-21" name="method-i-not_found-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-not_found-21_source')" id="l_method-i-not_found-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-not_found-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 58</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">not_found!</span>(<span class="ruby-identifier">resource</span> = <span class="ruby-keyword">nil</span>)
|
||||
<span class="ruby-identifier">message</span> = [<span class="ruby-string">"404"</span>]
|
||||
<span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">resource</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">resource</span>
|
||||
<span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"Not Found"</span>
|
||||
<span class="ruby-identifier">render_api_error!</span>(<span class="ruby-identifier">message</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>), <span class="ruby-number">404</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-paginate">
|
||||
|
||||
<b>paginate</b>(object)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-paginate" name="method-i-paginate" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-paginate_source')" id="l_method-i-paginate_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-paginate_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 22</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">paginate</span>(<span class="ruby-identifier">object</span>)
|
||||
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]).<span class="ruby-identifier">per</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:per_page</span>].<span class="ruby-identifier">to_i</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-render_api_error-21">
|
||||
|
||||
<b>render_api_error!</b>(message, status)
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-render_api_error-21" name="method-i-render_api_error-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-render_api_error-21_source')" id="l_method-i-render_api_error-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-render_api_error-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 73</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">render_api_error!</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">status</span>)
|
||||
<span class="ruby-identifier">error!</span>({<span class="ruby-string">'message'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">message</span>}, <span class="ruby-identifier">status</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-unauthorized-21">
|
||||
|
||||
<b>unauthorized!</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-unauthorized-21" name="method-i-unauthorized-21" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-unauthorized-21_source')" id="l_method-i-unauthorized-21_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-unauthorized-21_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 65</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">unauthorized!</span>
|
||||
<span class="ruby-identifier">render_api_error!</span>(<span class="ruby-string">'401 Unauthorized'</span>, <span class="ruby-number">401</span>)
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-user_project">
|
||||
|
||||
<b>user_project</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/APIHelpers.html#method-i-user_project" name="method-i-user_project" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-user_project_source')" id="l_method-i-user_project_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-user_project_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/api/helpers.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">user_project</span>
|
||||
<span class="ruby-ivar">@project</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">find_project</span>
|
||||
<span class="ruby-ivar">@project</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">not_found!</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,173 +0,0 @@
|
|||
<?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>Gitlab::AppLogger</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>
|
||||
Gitlab::AppLogger
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
<a href="Logger.html">Gitlab::Logger</a>
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/gitlab/app_logger_rb.html">lib/gitlab/app_logger.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>F</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-c-file_name">file_name</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-format_message">format_message</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Class Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-c-file_name">
|
||||
|
||||
<b>file_name</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/AppLogger.html#method-c-file_name" name="method-c-file_name" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-c-file_name_source')" id="l_method-c-file_name_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-c-file_name_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/app_logger.rb, line 3</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">file_name</span>
|
||||
<span class="ruby-string">'application.log'</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-format_message">
|
||||
|
||||
<b>format_message</b>(severity, timestamp, progname, msg)
|
||||
|
||||
<a href="../../classes/Gitlab/AppLogger.html#method-i-format_message" name="method-i-format_message" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-format_message_source')" id="l_method-i-format_message_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-format_message_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/app_logger.rb, line 7</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">format_message</span>(<span class="ruby-identifier">severity</span>, <span class="ruby-identifier">timestamp</span>, <span class="ruby-identifier">progname</span>, <span class="ruby-identifier">msg</span>)
|
||||
<span class="ruby-node">"#{timestamp.to_s(:long)}: #{msg}\n"</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<?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>Gitlab::Application</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>
|
||||
Gitlab::Application
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Rails::Application
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/config/application_rb.html">config/application.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,315 +0,0 @@
|
|||
<?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>Gitlab::Auth</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>
|
||||
Gitlab::Auth
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Object
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/gitlab/auth_rb.html">lib/gitlab/auth.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Method ref -->
|
||||
<div class="sectiontitle">Methods</div>
|
||||
<dl class="methods">
|
||||
|
||||
<dt>C</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-create_from_omniauth">create_from_omniauth</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>F</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-find_for_ldap_auth">find_for_ldap_auth</a>,
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-find_or_new_for_omniauth">find_or_new_for_omniauth</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>L</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#method-i-log">log</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<div class="sectiontitle">Instance Public methods</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-create_from_omniauth">
|
||||
|
||||
<b>create_from_omniauth</b>(auth, ldap = false)
|
||||
|
||||
<a href="../../classes/Gitlab/Auth.html#method-i-create_from_omniauth" name="method-i-create_from_omniauth" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-create_from_omniauth_source')" id="l_method-i-create_from_omniauth_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-create_from_omniauth_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/auth.rb, line 20</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">create_from_omniauth</span>(<span class="ruby-identifier">auth</span>, <span class="ruby-identifier">ldap</span> = <span class="ruby-keyword">false</span>)
|
||||
<span class="ruby-identifier">provider</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">provider</span>
|
||||
<span class="ruby-identifier">uid</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">uid</span>
|
||||
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-string">"utf-8"</span>)
|
||||
<span class="ruby-identifier">email</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">nil?</span>
|
||||
|
||||
<span class="ruby-identifier">ldap_prefix</span> = <span class="ruby-identifier">ldap</span> <span class="ruby-operator">?</span> <span class="ruby-string">'(LDAP) '</span> <span class="ruby-operator">:</span> <span class="ruby-string">''</span>
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">OmniAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">"#{ldap_prefix}#{provider} does not provide an email"</span> <span class="ruby-string">" address"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">blank?</span>
|
||||
|
||||
<span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"#{ldap_prefix}Creating user from #{provider} login"</span> <span class="ruby-node">" {uid => #{uid}, name => #{name}, email => #{email}}"</span>
|
||||
<span class="ruby-identifier">password</span> = <span class="ruby-constant">Devise</span>.<span class="ruby-identifier">friendly_token</span>[<span class="ruby-number">0</span>, <span class="ruby-number">8</span>].<span class="ruby-identifier">downcase</span>
|
||||
<span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>({
|
||||
<span class="ruby-identifier">extern_uid</span><span class="ruby-operator">:</span> <span class="ruby-identifier">uid</span>,
|
||||
<span class="ruby-identifier">provider</span><span class="ruby-operator">:</span> <span class="ruby-identifier">provider</span>,
|
||||
<span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-identifier">name</span>,
|
||||
<span class="ruby-identifier">username</span><span class="ruby-operator">:</span> <span class="ruby-identifier">email</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r^[^@]*/</span>)[<span class="ruby-number">0</span>],
|
||||
<span class="ruby-identifier">email</span><span class="ruby-operator">:</span> <span class="ruby-identifier">email</span>,
|
||||
<span class="ruby-identifier">password</span><span class="ruby-operator">:</span> <span class="ruby-identifier">password</span>,
|
||||
<span class="ruby-identifier">password_confirmation</span><span class="ruby-operator">:</span> <span class="ruby-identifier">password</span>,
|
||||
<span class="ruby-identifier">projects_limit</span><span class="ruby-operator">:</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">gitlab</span>.<span class="ruby-identifier">default_projects_limit</span>,
|
||||
}, <span class="ruby-identifier">as</span><span class="ruby-operator">:</span> <span class="ruby-value">:admin</span>)
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">omniauth</span>[<span class="ruby-string">'block_auto_created_users'</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">ldap</span>
|
||||
<span class="ruby-ivar">@user</span>.<span class="ruby-identifier">blocked</span> = <span class="ruby-keyword">true</span>
|
||||
<span class="ruby-keyword">end</span>
|
||||
<span class="ruby-ivar">@user</span>.<span class="ruby-identifier">save!</span>
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<div class="title method-title" id="method-i-find_for_ldap_auth">
|
||||
|
||||
<b>find_for_ldap_auth</b>(auth, signed_in_resource = nil)
|
||||
|
||||
<a href="../../classes/Gitlab/Auth.html#method-i-find_for_ldap_auth" name="method-i-find_for_ldap_auth" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-find_for_ldap_auth_source')" id="l_method-i-find_for_ldap_auth_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-find_for_ldap_auth_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/auth.rb, line 3</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">find_for_ldap_auth</span>(<span class="ruby-identifier">auth</span>, <span class="ruby-identifier">signed_in_resource</span> = <span class="ruby-keyword">nil</span>)
|
||||
<span class="ruby-identifier">uid</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">uid</span>
|
||||
<span class="ruby-identifier">provider</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">provider</span>
|
||||
<span class="ruby-identifier">email</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">nil?</span>
|
||||
<span class="ruby-identifier">raise</span> <span class="ruby-constant">OmniAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-string">"LDAP accounts must provide an uid and email address"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">uid</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">email</span>.<span class="ruby-identifier">nil?</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_extern_uid_and_provider</span>(<span class="ruby-identifier">uid</span>, <span class="ruby-identifier">provider</span>)
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_email</span>(<span class="ruby-identifier">email</span>)
|
||||
<span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Updating legacy LDAP user #{email} with extern_uid => #{uid}"</span>
|
||||
<span class="ruby-ivar">@user</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-value">:extern_uid</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uid</span>, <span class="ruby-value">:provider</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">provider</span>)
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-identifier">create_from_omniauth</span>(<span class="ruby-identifier">auth</span>, <span class="ruby-keyword">true</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-find_or_new_for_omniauth">
|
||||
|
||||
<b>find_or_new_for_omniauth</b>(auth)
|
||||
|
||||
<a href="../../classes/Gitlab/Auth.html#method-i-find_or_new_for_omniauth" name="method-i-find_or_new_for_omniauth" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-find_or_new_for_omniauth_source')" id="l_method-i-find_or_new_for_omniauth_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-find_or_new_for_omniauth_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/auth.rb, line 50</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">find_or_new_for_omniauth</span>(<span class="ruby-identifier">auth</span>)
|
||||
<span class="ruby-identifier">provider</span>, <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">provider</span>, <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">uid</span>
|
||||
<span class="ruby-identifier">email</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">info</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">nil?</span>
|
||||
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_provider_and_extern_uid</span>(<span class="ruby-identifier">provider</span>, <span class="ruby-identifier">uid</span>)
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_email</span>(<span class="ruby-identifier">email</span>)
|
||||
<span class="ruby-ivar">@user</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-value">:extern_uid</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uid</span>, <span class="ruby-value">:provider</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">provider</span>)
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">else</span>
|
||||
<span class="ruby-keyword">if</span> <span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">omniauth</span>[<span class="ruby-string">'allow_single_sign_on'</span>]
|
||||
<span class="ruby-ivar">@user</span> = <span class="ruby-identifier">create_from_omniauth</span>(<span class="ruby-identifier">auth</span>)
|
||||
<span class="ruby-ivar">@user</span>
|
||||
<span class="ruby-keyword">end</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-log">
|
||||
|
||||
<b>log</b>()
|
||||
|
||||
<a href="../../classes/Gitlab/Auth.html#method-i-log" name="method-i-log" class="permalink">Link</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="sourcecode">
|
||||
|
||||
<p class="source-link">
|
||||
Source:
|
||||
<a href="javascript:toggleSource('method-i-log_source')" id="l_method-i-log_source">show</a>
|
||||
|
||||
</p>
|
||||
<div id="method-i-log_source" class="dyn-source">
|
||||
<pre><span class="ruby-comment"># File lib/gitlab/auth.rb, line 67</span>
|
||||
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">log</span>
|
||||
<span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">AppLogger</span>
|
||||
<span class="ruby-keyword">end</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,151 +0,0 @@
|
|||
<?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>Gitlab::Entities</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>
|
||||
Gitlab::Entities
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../files/lib/api/entities_rb.html">lib/api/entities.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="Entities/Hook.html">Gitlab::Entities::Hook</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/Issue.html">Gitlab::Entities::Issue</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/MRNote.html">Gitlab::Entities::MRNote</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/MergeRequest.html">Gitlab::Entities::MergeRequest</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/Milestone.html">Gitlab::Entities::Milestone</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/Note.html">Gitlab::Entities::Note</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/Project.html">Gitlab::Entities::Project</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/ProjectMember.html">Gitlab::Entities::ProjectMember</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/ProjectSnippet.html">Gitlab::Entities::ProjectSnippet</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/RepoCommit.html">Gitlab::Entities::RepoCommit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/RepoObject.html">Gitlab::Entities::RepoObject</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/SSHKey.html">Gitlab::Entities::SSHKey</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/User.html">Gitlab::Entities::User</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/UserBasic.html">Gitlab::Entities::UserBasic</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class="type">CLASS</span>
|
||||
<a href="Entities/UserLogin.html">Gitlab::Entities::UserLogin</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<?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>Gitlab::Entities::Hook</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>
|
||||
Gitlab::Entities::Hook
|
||||
|
||||
<span class="parent"><
|
||||
|
||||
Grape::Entity
|
||||
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
<ul class="files">
|
||||
|
||||
<li><a href="../../../files/lib/api/entities_rb.html">lib/api/entities.rb</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bodyContent">
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Methods -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue