Merge branch 'master' into 114-comment_notifications

Conflicts:
	config/locales/ru.yml
This commit is contained in:
Alexander Machehin 2012-01-31 21:33:22 +06:00
commit f15cb90b87
302 changed files with 419 additions and 111 deletions

1
.gitignore vendored
View File

@ -12,6 +12,5 @@ public/assets/*
config/initializers/local.rb config/initializers/local.rb
public/system/* public/system/*
public/downloads/* public/downloads/*
.rvmrc
*.swp *.swp
*.tmproj *.tmproj

16
Gemfile
View File

@ -10,7 +10,6 @@ gem 'devise', '~> 1.5.2'
gem 'omniauth', '~> 1.0.1' gem 'omniauth', '~> 1.0.1'
gem 'omniauth-openid', '~> 1.0.1' gem 'omniauth-openid', '~> 1.0.1'
gem 'cancan', '~> 1.6.7' gem 'cancan', '~> 1.6.7'
#gem 'bitmask_attributes'
gem "haml-rails", '~> 0.3.4' gem "haml-rails", '~> 0.3.4'
# gem "compass", '~> 0.11.5' # update when it will be needed # gem "compass", '~> 0.11.5' # update when it will be needed
@ -24,7 +23,6 @@ gem "will_paginate", "~> 3.0.2"
gem 'meta-tags', '~> 1.2.4', :require => 'meta_tags' gem 'meta-tags', '~> 1.2.4', :require => 'meta_tags'
gem "russian" gem "russian"
# gem 'ghoul_grack', '~> 0.0.1'
gem 'grack', :git => 'git://github.com/rdblue/grack.git', :require => 'git_http' gem 'grack', :git => 'git://github.com/rdblue/grack.git', :require => 'git_http'
gem "grit" gem "grit"
gem 'whenever', :require => false gem 'whenever', :require => false
@ -32,18 +30,17 @@ gem 'delayed_job'
gem 'highline', '~> 1.6.8' gem 'highline', '~> 1.6.8'
# XML-RPC support # XML-RPC support
# gem 'actionwebservice' #, :git => 'git://github.com/ywen/actionwebservice.git'
gem "rails-xmlrpc", '~> 0.3.6' # :git => 'git://github.com/chipiga/rails-xmlrpc.git' gem "rails-xmlrpc", '~> 0.3.6' # :git => 'git://github.com/chipiga/rails-xmlrpc.git'
# gem 'passenger', '~> 3.0.11'
gem 'unicorn', '~> 4.1.1' gem 'unicorn', '~> 4.1.1'
group :production do group :production do
gem "airbrake", '~> 3.0.5' gem "airbrake", '~> 3.0.5'
gem 'newrelic_rpm'
gem 'bluepill', :require => false gem 'bluepill', :require => false
end end
gem 'newrelic_rpm'
group :development do group :development do
# gem 'letter_opener' # gem 'letter_opener'
gem 'rails3-generators' gem 'rails3-generators'
@ -51,25 +48,16 @@ group :development do
gem 'hpricot' gem 'hpricot'
gem 'ruby_parser' gem 'ruby_parser'
# debug
gem 'ruby-debug'
# gem 'looksee'
# gem 'awesome_print'
# gem 'wirble'
gem 'hirb' gem 'hirb'
# gem 'rails-footnotes', '>= 3.7.5.rc4' # this shit is very buggy don't forget to switch it off back
# deploy # deploy
gem 'capistrano', :require => false gem 'capistrano', :require => false
gem 'capistrano-ext', :require => false gem 'capistrano-ext', :require => false
gem 'cape', :require => false gem 'cape', :require => false
# gem 'capistrano-exts', :require => false #, :git => 'git://github.com/chipiga/capistrano-exts.git'
# gem 'capistrano-recipes', :require => false
gem 'capistrano_colors', :require => false gem 'capistrano_colors', :require => false
end end
group :development, :test do group :development, :test do
gem 'mysql2', '<= 0.2.9'
gem 'rspec-rails', '~> 2.7.0' gem 'rspec-rails', '~> 2.7.0'
gem 'factory_girl_rails', '~> 1.4.0' gem 'factory_girl_rails', '~> 1.4.0'
gem 'rr' gem 'rr'

View File

@ -60,7 +60,6 @@ GEM
capistrano_colors (0.5.5) capistrano_colors (0.5.5)
chronic (0.6.6) chronic (0.6.6)
cocaine (0.2.1) cocaine (0.2.1)
columnize (0.3.5)
daemons (1.1.4) daemons (1.1.4)
delayed_job (2.1.4) delayed_job (2.1.4)
activesupport (~> 3.0) activesupport (~> 3.0)
@ -95,8 +94,6 @@ GEM
yui-compressor (>= 0.9.3) yui-compressor (>= 0.9.3)
json (1.6.3) json (1.6.3)
kgio (2.6.0) kgio (2.6.0)
linecache (0.46)
rbx-require-relative (> 0.0.4)
mail (2.2.19) mail (2.2.19)
activesupport (>= 2.3.6) activesupport (>= 2.3.6)
i18n (>= 0.4.0) i18n (>= 0.4.0)
@ -105,7 +102,6 @@ GEM
meta-tags (1.2.4) meta-tags (1.2.4)
actionpack actionpack
mime-types (1.17.2) mime-types (1.17.2)
mysql2 (0.2.9)
net-scp (1.0.4) net-scp (1.0.4)
net-ssh (>= 1.99.1) net-ssh (>= 1.99.1)
net-sftp (2.0.5) net-sftp (2.0.5)
@ -157,7 +153,6 @@ GEM
thor (~> 0.14.4) thor (~> 0.14.4)
raindrops (0.8.0) raindrops (0.8.0)
rake (0.9.2.2) rake (0.9.2.2)
rbx-require-relative (0.0.5)
rdoc (3.11) rdoc (3.11)
json (~> 1.4) json (~> 1.4)
rr (1.0.4) rr (1.0.4)
@ -174,11 +169,6 @@ GEM
activesupport (~> 3.0) activesupport (~> 3.0)
railties (~> 3.0) railties (~> 3.0)
rspec (~> 2.7.0) rspec (~> 2.7.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-openid (2.1.8) ruby-openid (2.1.8)
ruby_parser (2.3.1) ruby_parser (2.3.1)
sexp_processor (~> 3.0) sexp_processor (~> 3.0)
@ -232,7 +222,6 @@ DEPENDENCIES
hpricot hpricot
jammit jammit
meta-tags (~> 1.2.4) meta-tags (~> 1.2.4)
mysql2 (<= 0.2.9)
newrelic_rpm newrelic_rpm
omniauth (~> 1.0.1) omniauth (~> 1.0.1)
omniauth-openid (~> 1.0.1) omniauth-openid (~> 1.0.1)
@ -244,7 +233,6 @@ DEPENDENCIES
rails3-jquery-autocomplete rails3-jquery-autocomplete
rr rr
rspec-rails (~> 2.7.0) rspec-rails (~> 2.7.0)
ruby-debug
ruby_parser ruby_parser
russian russian
schema_plus (~> 0.2.1) schema_plus (~> 0.2.1)

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery protect_from_forgery

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AutoBuildListsController < ApplicationController class AutoBuildListsController < ApplicationController
before_filter :authenticate_user!, :except => :auto_build before_filter :authenticate_user!, :except => :auto_build
before_filter :find_auto_build_list, :only => :destroy before_filter :find_auto_build_list, :only => :destroy

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class BuildListsController < ApplicationController class BuildListsController < ApplicationController
CALLBACK_ACTIONS = [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt] CALLBACK_ACTIONS = [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
NESTED_ACTIONS = [:index, :new, :create] NESTED_ACTIONS = [:index, :new, :create]
@ -39,7 +40,7 @@ class BuildListsController < ApplicationController
Arch.where(:id => params[:arches]).each do |arch| Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => params[:bpls]).each do |bpl| Platform.main.where(:id => params[:bpls]).each do |bpl|
@build_list = @project.build_lists.build(params[:build_list]) @build_list = @project.build_lists.build(params[:build_list])
@build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/(.+)_latest$/).to_a.last || @build_list.project_version).first.id @build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/^latest_(.+)/).to_a.last || @build_list.project_version).first.id
@build_list.bpl = bpl; @build_list.arch = arch; @build_list.user = current_user @build_list.bpl = bpl; @build_list.arch = arch; @build_list.user = current_user
flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :bpl => bpl.name, :pl => @build_list.pl} flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :bpl => bpl.name, :pl => @build_list.pl}
if @build_list.save if @build_list.save

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CategoriesController < ApplicationController class CategoriesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_category, :only => [:show, :edit, :update, :destroy] before_filter :find_category, :only => [:show, :edit, :update, :destroy]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CollaboratorsController < ApplicationController class CollaboratorsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CommentsController < ApplicationController class CommentsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :set_commentable, :only => [:index, :edit, :create, :update, :destroy] before_filter :set_commentable, :only => [:index, :edit, :create, :update, :destroy]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CommitSubscribesController < ApplicationController class CommitSubscribesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*-
class ContainersController < ApplicationController class ContainersController < ApplicationController
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class DownloadsController < ApplicationController class DownloadsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
load_and_authorize_resource load_and_authorize_resource

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class EventLogsController < ApplicationController class EventLogsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
load_and_authorize_resource load_and_authorize_resource

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::BaseController < ApplicationController class Git::BaseController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::BlobsController < Git::BaseController class Git::BlobsController < Git::BaseController
before_filter :set_path before_filter :set_path
before_filter :set_commit_hash before_filter :set_commit_hash

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::CommitsController < Git::BaseController class Git::CommitsController < Git::BaseController
def index def index

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::RepositoriesController < Git::BaseController class Git::RepositoriesController < Git::BaseController
def show def show

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::TreesController < Git::BaseController class Git::TreesController < Git::BaseController
def show def show

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class GroupsController < ApplicationController class GroupsController < ApplicationController
is_related_controller! is_related_controller!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class IssuesController < ApplicationController class IssuesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_project before_filter :find_project

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class MembersController < ApplicationController class MembersController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
is_related_controller! is_related_controller!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class PersonalRepositoriesController < ApplicationController class PersonalRepositoriesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_repository#, :only => [:show, :destroy, :add_project, :remove_project, :make_private, :settings] before_filter :find_repository#, :only => [:show, :destroy, :add_project, :remove_project, :make_private, :settings]

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class PlatformsController < ApplicationController class PlatformsController < ApplicationController
before_filter :authenticate_user!, :except => :easy_urpmi before_filter :authenticate_user!, :except => :easy_urpmi
before_filter :find_platform, :only => [:freeze, :unfreeze, :clone, :edit, :destroy] before_filter :find_platform, :only => [:freeze, :unfreeze, :clone, :edit, :destroy]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class PrivateUsersController < ApplicationController class PrivateUsersController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_platform_and_private_users before_filter :find_platform_and_private_users
@ -13,7 +14,7 @@ class PrivateUsersController < ApplicationController
@pair = PrivateUser.generate_pair(params[:platform_id], current_user.id) @pair = PrivateUser.generate_pair(params[:platform_id], current_user.id)
@urpmi_list = @platform.urpmi_list(request.host, @pair) @urpmi_list = @platform.urpmi_list(request.host, @pair)
redirect_to platform_private_users_path(params[:platform_id]), :notice => "Логин: #{@pair[:login]} Пароль: #{@pair[:pass]}" redirect_to platform_private_users_path(params[:platform_id]), :notice => I18n.t('flash.private_users', :login => @pair[:login], :password => @pair[:pass])
end end
#def destroy #def destroy

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class PrivatesController < ApplicationController class PrivatesController < ApplicationController
require 'digest/sha2' require 'digest/sha2'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProductBuildListsController < ApplicationController class ProductBuildListsController < ApplicationController
before_filter :authenticate_user!, :except => [:status_build] before_filter :authenticate_user!, :except => [:status_build]
load_and_authorize_resource :platform, :only => [:create] load_and_authorize_resource :platform, :only => [:create]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProductsController < ApplicationController class ProductsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_product, :only => [:show, :edit, :update, :destroy] before_filter :find_product, :only => [:show, :edit, :update, :destroy]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
is_related_controller! is_related_controller!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RepositoriesController < ApplicationController class RepositoriesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_repository, :except => [:index, :new, :create] before_filter :find_repository, :except => [:index, :new, :create]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RpcController < ApplicationController class RpcController < ApplicationController
exposes_xmlrpc_methods exposes_xmlrpc_methods
@ -11,30 +12,30 @@ class RpcController < ApplicationController
# client.call("project_versions", 1) # client.call("project_versions", 1)
def platforms def platforms
ActiveSupport::Notifications.instrument("event_log.observer", :message => 'список платформ') ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.platforms_list')
Platform.select('name').where("platform_type = ?", 'main').map(&:name) Platform.select('name').where("platform_type = ?", 'main').map(&:name)
end end
def user_projects def user_projects
ActiveSupport::Notifications.instrument("event_log.observer", :message => 'список пользовательских проектов') ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.users_list')
current_user.projects.map{|p| { :id => p.id, :name => p.name } } current_user.projects.map{|p| { :id => p.id, :name => p.name } }
end end
def project_versions id def project_versions id
p = Project.find_by_id(id) p = Project.find_by_id(id)
ActiveSupport::Notifications.instrument("event_log.observer", :object => p, :message => "список версий") ActiveSupport::Notifications.instrument "event_log.observer", :object => p, :message => I18n.t('event_log.notices.versions_list')
p.project_versions.collect {|tag| tag.name.gsub(/^\w+\./, "")} rescue 'not found' p.tags.map(&:name) rescue 'not found'
end end
def build_status id def build_status id
bl = BuildList.find_by_id(id) bl = BuildList.find_by_id(id)
ActiveSupport::Notifications.instrument("event_log.observer", :object => bl, :message => 'статус сборки') ActiveSupport::Notifications.instrument "event_log.observer", :object => bl, :message => I18n.t('event_log.notices.status')
bl.try(:status) || 'not found' bl.try(:status) || 'not found'
end end
def build_packet project_id, repo_id def build_packet project_id, repo_id
# p = Project.find_by_id(project_id); r = Repository.find_by_id(repo_id) # p = Project.find_by_id(project_id); r = Repository.find_by_id(repo_id)
ActiveSupport::Notifications.instrument("event_log.observer", :message => 'сборка пакета') ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.project_build')
'unknown' # TODO: build packet 'unknown' # TODO: build packet
end end
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Settings::NotifiersController < ApplicationController class Settings::NotifiersController < ApplicationController
layout "sessions" layout "sessions"

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class SubscribesController < ApplicationController class SubscribesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def open_id def open_id
# raise env['omniauth.auth'].inspect # raise env['omniauth.auth'].inspect

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class UsersController < ApplicationController class UsersController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :find_user, :only => [:show, :edit, :update, :destroy] before_filter :find_user, :only => [:show, :edit, :update, :destroy]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module ApplicationHelper module ApplicationHelper
def choose_title def choose_title
title = if ['categories', 'personal_repositories', 'downloads'].include?(controller.controller_name) title = if ['categories', 'personal_repositories', 'downloads'].include?(controller.controller_name)

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*-
module CommentsHelper module CommentsHelper
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module CommitHelper module CommitHelper
def render_commit_stats(stats) def render_commit_stats(stats)

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module DiffHelper module DiffHelper
def render_diff(diff) def render_diff(diff)

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module GitHelper module GitHelper
def render_path def render_path

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*-
module IssuesHelper module IssuesHelper
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module PlatformsHelper module PlatformsHelper
def repository_name_postfix(platform) def repository_name_postfix(platform)
return "" unless platform return "" unless platform

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module ProjectsHelper module ProjectsHelper
def git_repo_url(name) def git_repo_url(name)
if current_user if current_user

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*-
module Settings::NotifiersHelper module Settings::NotifiersHelper
end end

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*-
module SubscribesHelper module SubscribesHelper
end end

View File

@ -1,4 +1,4 @@
# coding: UTF-8 # -*- encoding : utf-8 -*-
class UserMailer < ActionMailer::Base class UserMailer < ActionMailer::Base
default :from => APP_CONFIG['do-not-reply-email'] default :from => APP_CONFIG['do-not-reply-email']

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# If rules goes one by one CanCan joins them by 'OR' sql operator # If rules goes one by one CanCan joins them by 'OR' sql operator
# If rule has multiple conditions CanCan joins them by 'AND' sql operator # If rule has multiple conditions CanCan joins them by 'AND' sql operator
# WARNING: # WARNING:

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Arch < ActiveRecord::Base class Arch < ActiveRecord::Base
has_many :build_lists, :dependent => :destroy has_many :build_lists, :dependent => :destroy

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Authentication < ActiveRecord::Base class Authentication < ActiveRecord::Base
belongs_to :user belongs_to :user

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AutoBuildList < ActiveRecord::Base class AutoBuildList < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :arch belongs_to :arch

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class BuildList < ActiveRecord::Base class BuildList < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :arch belongs_to :arch

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class BuildList::Filter class BuildList::Filter
def initialize(project, options = {}) def initialize(project, options = {})
@project = project @project = project

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class BuildList::Item < ActiveRecord::Base class BuildList::Item < ActiveRecord::Base
belongs_to :build_list belongs_to :build_list

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Category < ActiveRecord::Base class Category < ActiveRecord::Base
has_many :projects, :dependent => :nullify has_many :projects, :dependent => :nullify

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Comment < ActiveRecord::Base class Comment < ActiveRecord::Base
belongs_to :commentable, :polymorphic => true belongs_to :commentable, :polymorphic => true
belongs_to :user belongs_to :user

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Container < ActiveRecord::Base class Container < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :owner, :class_name => 'User', :foreign_key => 'owner_id' belongs_to :owner, :class_name => 'User', :foreign_key => 'owner_id'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Download < ActiveRecord::Base class Download < ActiveRecord::Base
PREV_LOG_FILE = "#{ APP_CONFIG['nginx_log'] }.0" PREV_LOG_FILE = "#{ APP_CONFIG['nginx_log'] }.0"

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class EventLog < ActiveRecord::Base class EventLog < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :object, :polymorphic => true belongs_to :object, :polymorphic => true

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class EventLogObserver < ActiveRecord::Observer class EventLogObserver < ActiveRecord::Observer
observe :user, :private_user, :platform, :repository, :project, :product, :build_list, :auto_build_list, :product_build_list observe :user, :private_user, :platform, :repository, :project, :product, :build_list, :auto_build_list, :product_build_list

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::Repository class Git::Repository
delegate :commits, :commit, :tree, :tags, :heads, :commit_count, :log, :branches, :to => :repo delegate :commits, :commit, :tree, :tags, :heads, :commit_count, :log, :branches, :to => :repo

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Group < ActiveRecord::Base class Group < ActiveRecord::Base
belongs_to :owner, :class_name => 'User' belongs_to :owner, :class_name => 'User'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Issue < ActiveRecord::Base class Issue < ActiveRecord::Base
STATUSES = ['open', 'closed'] STATUSES = ['open', 'closed']

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
#require 'lib/build_server.rb' #require 'lib/build_server.rb'
class Platform < ActiveRecord::Base class Platform < ActiveRecord::Base
VISIBILITIES = ['open', 'hidden'] VISIBILITIES = ['open', 'hidden']

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class PrivateUser < ActiveRecord::Base class PrivateUser < ActiveRecord::Base
require 'digest/sha2' require 'digest/sha2'
require 'active_support/secure_random' require 'active_support/secure_random'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Product < ActiveRecord::Base class Product < ActiveRecord::Base
ATTRS_TO_CLONE = [ 'build_path', 'build_script', 'counter', 'ks', 'menu', 'tar', 'use_cron', 'cron_tab' ] ATTRS_TO_CLONE = [ 'build_path', 'build_script', 'counter', 'ks', 'menu', 'tar', 'use_cron', 'cron_tab' ]

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProductBuildList < ActiveRecord::Base class ProductBuildList < ActiveRecord::Base
BUILD_STARTED = 2 BUILD_STARTED = 2
BUILD_COMPLETED = 0 BUILD_COMPLETED = 0

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Project < ActiveRecord::Base class Project < ActiveRecord::Base
VISIBILITIES = ['open', 'hidden'] VISIBILITIES = ['open', 'hidden']
@ -49,7 +50,7 @@ class Project < ActiveRecord::Base
:pl => auto_build_list.pl, :pl => auto_build_list.pl,
:bpl => auto_build_list.bpl, :bpl => auto_build_list.bpl,
:arch => auto_build_list.arch, :arch => auto_build_list.arch,
:project_version => collected_project_versions.last, :project_version => versions.last,
:build_requires => true, :build_requires => true,
:update_type => 'bugfix') unless build_lists.for_creation_date_period(Time.current - 15.seconds, Time.current).present? :update_type => 'bugfix') unless build_lists.for_creation_date_period(Time.current - 15.seconds, Time.current).present?
end end
@ -70,16 +71,6 @@ class Project < ActiveRecord::Base
end end
end end
# TODO deprecate and remove project_versions and collected_project_versions ?
def project_versions
res = tags.select{|tag| tag.name =~ /^v\./}
return res if res and res.size > 0
tags
end
def collected_project_versions
project_versions.collect{|tag| tag.name.gsub(/^\w+\./, "")}
end
def tags def tags
self.git_repository.tags #.sort_by{|t| t.name.gsub(/[a-zA-Z.]+/, '').to_i} self.git_repository.tags #.sort_by{|t| t.name.gsub(/[a-zA-Z.]+/, '').to_i}
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProjectImport < ActiveRecord::Base class ProjectImport < ActiveRecord::Base
belongs_to :project belongs_to :project

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ProjectToRepository < ActiveRecord::Base class ProjectToRepository < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :repository belongs_to :repository

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Relation < ActiveRecord::Base class Relation < ActiveRecord::Base
belongs_to :target, :polymorphic => true belongs_to :target, :polymorphic => true
belongs_to :object, :polymorphic => true belongs_to :object, :polymorphic => true

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Repository < ActiveRecord::Base class Repository < ActiveRecord::Base
belongs_to :platform belongs_to :platform
belongs_to :owner, :polymorphic => true belongs_to :owner, :polymorphic => true

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Rpm < ActiveRecord::Base class Rpm < ActiveRecord::Base
belongs_to :arch belongs_to :arch
belongs_to :project belongs_to :project

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module Settings module Settings
def self.table_name_prefix def self.table_name_prefix
'settings_' 'settings_'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Settings::Notifier < ActiveRecord::Base class Settings::Notifier < ActiveRecord::Base
belongs_to :user belongs_to :user

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Subscribe < ActiveRecord::Base class Subscribe < ActiveRecord::Base
belongs_to :subscribeable, :polymorphic => true belongs_to :subscribeable, :polymorphic => true
belongs_to :user belongs_to :user

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class User < ActiveRecord::Base class User < ActiveRecord::Base
ROLES = ['admin'] ROLES = ['admin']
LANGUAGES_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']] LANGUAGES_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']]

View File

@ -14,7 +14,9 @@
.content .content
.inner .inner
.patch_and_diff .patch_and_diff
#{link_to "raw diff", commit_path(@project, @commit.id, :diff)} | #{link_to "patch", commit_path(@project, @commit.id, :patch)} = link_to "raw diff", commit_path(@project, @commit.id, :diff)
\|
= link_to "patch", commit_path(@project, @commit.id, :patch)
.clear .clear
= render_commit_stats(@commit.stats) = render_commit_stats(@commit.stats)

View File

@ -4,7 +4,8 @@
%th.last &nbsp; %th.last &nbsp;
- @projects.each do |project| - @projects.each do |project|
%tr{:class => cycle("odd", "even")} %tr{:class => cycle("odd", "even")}
%td %td= link_to project.name, project_path(project)
= link_to project.name, project_path(project)
%td.last %td.last
#{link_to t("layout.show"), project_path(project)} | #{link_to t("layout.delete"), url_for (:action => :remove_project, :project_id => project.id), :confirm => t("layout.projects.confirm_delete")} = link_to t("layout.show"), project_path(project)
\|
= link_to t("layout.delete"), url_for(:action => :remove_project, :project_id => project.id), :confirm => t("layout.projects.confirm_delete")

View File

@ -7,4 +7,6 @@
%td %td
= link_to project.name, project_path(project) = link_to project.name, project_path(project)
%td.last %td.last
#{link_to t("layout.show"), project_path(project)} | #{link_to t("layout.delete"), url_for (:action => :remove_project, :project_id => project.id), :confirm => t("layout.projects.confirm_delete")} = link_to t("layout.show"), project_path(project)
\|
= link_to t("layout.delete"), url_for(:action => :remove_project, :project_id => project.id), :confirm => t("layout.projects.confirm_delete")

View File

@ -33,7 +33,8 @@ rm -f srpm.cpio
# Commit and push changes # Commit and push changes
git add -A . git add -A .
git commit -m "Automatic import for version $version" git commit -m "Automatic import for version $version"
git push origin HEAD git branch $git_branch # Ensure branch exists
git push origin master $git_branch
# Cleanup # Cleanup
rm -rf $tmp_dir rm -rf $tmp_dir

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'rubygems' require 'rubygems'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require File.expand_path('../boot', __FILE__) require File.expand_path('../boot', __FILE__)
require 'rails/all' require 'rails/all'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'rubygems' require 'rubygems'
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# This configuration file works with both the Compass command line tool and within Rails. # This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here. # Require any additional compass plugins here.

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
set :rvm_type, :user set :rvm_type, :user
@ -27,9 +28,9 @@ set :scm, :git
set :repository, "git@github.com:warpc/rosa-build.git" set :repository, "git@github.com:warpc/rosa-build.git"
set :deploy_via, :remote_cache set :deploy_via, :remote_cache
require 'lib/recipes/nginx' require './lib/recipes/nginx'
require 'lib/recipes/unicorn' require './lib/recipes/unicorn'
require 'lib/recipes/bluepill' require './lib/recipes/bluepill'
namespace :deploy do namespace :deploy do
task :stub_xml_rpc do task :stub_xml_rpc do

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
set :branch, "pingwinsoft" set :branch, "pingwinsoft"
set :domain, "b.pingwinsoft.ru" # "195.19.76.12" set :domain, "b.pingwinsoft.ru" # "195.19.76.12"

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Load the rails application # Load the rails application
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rosa::Application.configure do Rosa::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rosa::Application.configure do Rosa::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rosa::Application.configure do Rosa::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
DEFAULT_KS = <<-eos DEFAULT_KS = <<-eos
timezone Europe/Moscow timezone Europe/Moscow
auth --useshadow --enablemd5 auth --useshadow --enablemd5

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rails.application.config.generators do |g| Rails.application.config.generators do |g|
g.test_framework = :rspec g.test_framework = :rspec
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format # Add new inflection rules using the following format

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env] APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
require 'modules' require 'modules'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks: # Add new mime types for use in respond_to blocks:

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Warden::Manager.after_authentication do |user,auth,opts| # after_set_user, :except => fetch Warden::Manager.after_authentication do |user,auth,opts| # after_set_user, :except => fetch
ActiveSupport::Notifications.instrument("event_log.observer", :object => user) ActiveSupport::Notifications.instrument("event_log.observer", :object => user)
end end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag =~ /<label/ if html_tag =~ /<label/
%|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe %|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
Rosa::Application.config.session_store :cookie_store, :key => '_rosa_session' Rosa::Application.config.session_store :cookie_store, :key => '_rosa_session'

View File

@ -377,6 +377,7 @@ en:
saved: Settings saved success saved: Settings saved success
save_error: Setting update error save_error: Setting update error
private_users: "Login: %{login} Password: %{password}"
subscribe: subscribe:
saved: Subscription on notifications for this task is created saved: Subscription on notifications for this task is created

View File

@ -0,0 +1,50 @@
en:
event_log:
controllers:
products_controller: 'Product Management'
platforms_controller: 'Management of platforms'
repositories_controller: 'Manage Repositories'
projects_controller: 'Project Management'
build_lists_controller: 'Management index chart'
auto_build_lists_controller: 'Control automatic build'
product_build_lists_controller: 'Build management products'
'devise/registrations_controller': 'User Registration'
'devise/sessions_controller': 'User Authentication'
'devise/passwords_controller': 'password recovery'
'users/omniauth_callbacks_controller': 'External authentication of users'
rpc_controller: 'XML RPC'
private_users_controller: 'access to private repositories'
personal_repositories_controller: 'Managing personal repositories'
actions:
'devise/sessions_controller':
create: 'input'
destroy: 'exit'
'users/omniauth_callbacks_controller':
open_id: 'login via OpenID'
projects_controller:
auto_build: 'sent to the automatic assembly'
build_lists_controller:
create: 'sent to assembly'
cancel: 'assembly abolished'
publish: 'assembly issued'
auto_build_lists_controller:
create: 'assigned'
destroy: 'canceled'
product_build_lists_controller:
create: 'sent to assembly'
rpc_controller:
xe_index: inquiry
private_users_controller:
create: 'given'
destroy: 'deleted'
personal_repositories_controller:
change_visibility: 'status change'
create: 'created'
update: 'updated'
destroy: 'deleted'
notices:
platforms_list: a list of platforms
users_list: list of custom projects
versions_list: version list
status: the status of the assembly
project_build: build package

Some files were not shown because too many files have changed in this diff Show More