Merge branch 'master' of github.com:warpc/rosa-build

This commit is contained in:
George Vinogradov 2011-10-28 00:07:44 +04:00
commit 0b62f60527
7 changed files with 15 additions and 12 deletions

View File

@ -3,5 +3,6 @@
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
require 'rake' require 'rake'
require 'airbrake/tasks'
Rosa::Application.load_tasks Rosa::Application.load_tasks

View File

@ -12,6 +12,7 @@ module PersonalRepository
pl.name = "#{self.uname}_personal" pl.name = "#{self.uname}_personal"
pl.unixname = "#{self.uname}_personal" pl.unixname = "#{self.uname}_personal"
pl.platform_type = 'personal' pl.platform_type = 'personal'
pl.distrib_type = 'mandriva2011'
pl.save pl.save
rep = pl.repositories.build rep = pl.repositories.build

View File

@ -23,7 +23,7 @@ class User < ActiveRecord::Base
include PersonalRepository include PersonalRepository
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false
validates :ssh_key, :uniqueness => true validates :ssh_key, :uniqueness => true, :allow_blank => true
validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? } validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? }
#TODO: Replace this simple cross-table uniq validation by more progressive analog #TODO: Replace this simple cross-table uniq validation by more progressive analog
validate lambda { validate lambda {

View File

@ -12,7 +12,7 @@
%a{:href => "/"}= t("layout.global_header") %a{:href => "/"}= t("layout.global_header")
#user-navigation #user-navigation
%ul.wat-cf %ul.wat-cf
%li= link_to current_user.uname, edit_user_path(current_user) %li= link_to current_user.uname, edit_user_registration_path
%li= link_to t('layout.logout'), destroy_user_session_path, :method => :delete, :class => "logout" %li= link_to t('layout.logout'), destroy_user_session_path, :method => :delete, :class => "logout"
#main-navigation #main-navigation
%ul.wat-cf %ul.wat-cf

View File

@ -1,8 +1 @@
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env] APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
def with_ga(&block)
Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 5}) do |ga|
block.call(ga)
end
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)
end

View File

@ -208,7 +208,6 @@ ActiveRecord::Schema.define(:version => 20111026200223) do
t.string "object_type" t.string "object_type"
t.integer "target_id" t.integer "target_id"
t.string "target_type" t.string "target_type"
t.integer "role_id"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end
@ -271,9 +270,8 @@ ActiveRecord::Schema.define(:version => 20111026200223) do
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "uname"
t.text "ssh_key" t.text "ssh_key"
t.integer "role_id" t.string "uname"
t.integer "global_role_id" t.integer "global_role_id"
end end

View File

@ -0,0 +1,10 @@
require 'gitolito'
class Object
def with_ga(&block)
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 5}) do |ga|
block.call(ga)
end
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)
end
end