diff --git a/.gitignore b/.gitignore index 6f93b8b07..fcd2664e1 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,5 @@ public/assets/* config/initializers/local.rb public/system/* public/downloads/* -.rvmrc *.swp *.tmproj diff --git a/Gemfile b/Gemfile index f7e8b21ca..41c2b515f 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,7 @@ gem "gollum", "1.3.1" gem "redcarpet", "1.17.2" gem 'creole' gem 'rdiscount' -gem 'org-ruby' +#gem 'org-ruby' gem 'RedCloth' gem 'wikicloth' @@ -61,7 +61,7 @@ group :development do gem 'ruby_parser' # debug - gem 'ruby-debug' + # gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19 # gem 'looksee' # gem 'awesome_print' # gem 'wirble' diff --git a/Gemfile.lock b/Gemfile.lock index 2a3fb845e..aab3d2d14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -63,7 +63,6 @@ GEM capistrano_colors (0.5.5) chronic (0.6.6) cocaine (0.2.1) - columnize (0.3.5) creole (0.4.2) daemons (1.1.4) delayed_job (2.1.4) @@ -110,8 +109,6 @@ GEM yui-compressor (>= 0.9.3) json (1.6.3) kgio (2.6.0) - linecache (0.46) - rbx-require-relative (> 0.0.4) mail (2.2.19) activesupport (>= 2.3.6) i18n (>= 0.4.0) @@ -136,8 +133,6 @@ GEM omniauth-openid (1.0.1) omniauth (~> 1.0) rack-openid (~> 1.3.1) - org-ruby (0.6.0) - rubypants (>= 0.2.0) orm_adapter (0.0.5) paperclip (2.5.0) activerecord (>= 2.3.0) @@ -169,14 +164,11 @@ GEM rails3-jquery-autocomplete (1.0.4) rails (~> 3.0) railties (3.0.11) - actionpack (= 3.0.11) - activesupport (= 3.0.11) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.4) raindrops (0.8.0) rake (0.9.2.2) - rbx-require-relative (0.0.5) rdiscount (1.6.8) rdoc (3.11) json (~> 1.4) @@ -195,15 +187,9 @@ GEM activesupport (~> 3.0) railties (~> 3.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_parser (2.3.1) sexp_processor (~> 3.0) - rubypants (0.2.0) russian (0.6.0) i18n (>= 0.5.0) sanitize (2.0.3) @@ -269,7 +255,6 @@ DEPENDENCIES newrelic_rpm omniauth (~> 1.0.1) omniauth-openid (~> 1.0.1) - org-ruby paperclip (~> 2.5) pg (~> 0.11.0) rails (= 3.0.11) @@ -280,7 +265,6 @@ DEPENDENCIES redcarpet (= 1.17.2) rr rspec-rails (~> 2.7.0) - ruby-debug ruby_parser russian schema_plus (~> 0.2.1) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 494f54ae1..ce09242b6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class ApplicationController < ActionController::Base protect_from_forgery diff --git a/app/controllers/auto_build_lists_controller.rb b/app/controllers/auto_build_lists_controller.rb index 4354b91d8..e69f6ecc1 100644 --- a/app/controllers/auto_build_lists_controller.rb +++ b/app/controllers/auto_build_lists_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class AutoBuildListsController < ApplicationController before_filter :authenticate_user!, :except => :auto_build before_filter :find_auto_build_list, :only => :destroy diff --git a/app/controllers/build_lists_controller.rb b/app/controllers/build_lists_controller.rb index 29d869151..9fb1cbcfb 100644 --- a/app/controllers/build_lists_controller.rb +++ b/app/controllers/build_lists_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class BuildListsController < ApplicationController CALLBACK_ACTIONS = [:publish_build, :status_build, :pre_build, :post_build, :circle_build, :new_bbdt] NESTED_ACTIONS = [:index, :new, :create] @@ -39,7 +40,7 @@ class BuildListsController < ApplicationController Arch.where(:id => params[:arches]).each do |arch| Platform.main.where(:id => params[:bpls]).each do |bpl| @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 flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :bpl => bpl.name, :pl => @build_list.pl} if @build_list.save diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index df0944d58..3dae0ee00 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class CategoriesController < ApplicationController before_filter :authenticate_user! before_filter :find_category, :only => [:show, :edit, :update, :destroy] diff --git a/app/controllers/collaborators_controller.rb b/app/controllers/collaborators_controller.rb index 2c11b6172..f05ab25ac 100644 --- a/app/controllers/collaborators_controller.rb +++ b/app/controllers/collaborators_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class CollaboratorsController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 6f699a602..704f598b1 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class CommentsController < ApplicationController before_filter :authenticate_user! before_filter :set_commentable, :only => [:index, :edit, :create, :update, :destroy] diff --git a/app/controllers/containers_controller.rb b/app/controllers/containers_controller.rb index 57c27003c..1475672a2 100644 --- a/app/controllers/containers_controller.rb +++ b/app/controllers/containers_controller.rb @@ -1,2 +1,3 @@ +# -*- encoding : utf-8 -*- class ContainersController < ApplicationController end diff --git a/app/controllers/downloads_controller.rb b/app/controllers/downloads_controller.rb index 41d3072f0..8c10a3940 100644 --- a/app/controllers/downloads_controller.rb +++ b/app/controllers/downloads_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class DownloadsController < ApplicationController before_filter :authenticate_user! load_and_authorize_resource diff --git a/app/controllers/event_logs_controller.rb b/app/controllers/event_logs_controller.rb index 91b16e482..1b491ba0a 100644 --- a/app/controllers/event_logs_controller.rb +++ b/app/controllers/event_logs_controller.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class EventLogsController < ApplicationController before_filter :authenticate_user! load_and_authorize_resource diff --git a/app/controllers/git/base_controller.rb b/app/controllers/git/base_controller.rb index 90ed02ecf..6fd5a43c7 100644 --- a/app/controllers/git/base_controller.rb +++ b/app/controllers/git/base_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::BaseController < ApplicationController before_filter :authenticate_user! @@ -39,4 +40,4 @@ class Git::BaseController < ApplicationController def set_current_branch @current_branch = @branches.select{|b| b.name == @treeish }.first end -end \ No newline at end of file +end diff --git a/app/controllers/git/blobs_controller.rb b/app/controllers/git/blobs_controller.rb index eb788d211..75663689e 100644 --- a/app/controllers/git/blobs_controller.rb +++ b/app/controllers/git/blobs_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::BlobsController < Git::BaseController before_filter :set_path before_filter :set_commit_hash diff --git a/app/controllers/git/commits_controller.rb b/app/controllers/git/commits_controller.rb index 021d60cee..45e4c50d5 100644 --- a/app/controllers/git/commits_controller.rb +++ b/app/controllers/git/commits_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::CommitsController < Git::BaseController def index diff --git a/app/controllers/git/repositories_controller.rb b/app/controllers/git/repositories_controller.rb index 5aea592cd..7b5420c80 100644 --- a/app/controllers/git/repositories_controller.rb +++ b/app/controllers/git/repositories_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::RepositoriesController < Git::BaseController def show @@ -7,4 +8,4 @@ class Git::RepositoriesController < Git::BaseController render :template => "git/repositories/empty" unless @tree end -end \ No newline at end of file +end diff --git a/app/controllers/git/trees_controller.rb b/app/controllers/git/trees_controller.rb index 0ee9ed4f0..081fa7e8b 100644 --- a/app/controllers/git/trees_controller.rb +++ b/app/controllers/git/trees_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::TreesController < Git::BaseController def show @@ -13,4 +14,4 @@ class Git::TreesController < Git::BaseController render :template => "git/repositories/show" end -end \ No newline at end of file +end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 37b95ac33..0ff9ec811 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class GroupsController < ApplicationController is_related_controller! diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 99f13be95..466e574db 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class IssuesController < ApplicationController before_filter :authenticate_user! before_filter :find_project diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index e139e2234..8d22c69f3 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class MembersController < ApplicationController before_filter :authenticate_user! is_related_controller! diff --git a/app/controllers/personal_repositories_controller.rb b/app/controllers/personal_repositories_controller.rb index e5fadb31d..c76c21623 100644 --- a/app/controllers/personal_repositories_controller.rb +++ b/app/controllers/personal_repositories_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class PersonalRepositoriesController < ApplicationController before_filter :authenticate_user! before_filter :find_repository#, :only => [:show, :destroy, :add_project, :remove_project, :make_private, :settings] diff --git a/app/controllers/platforms_controller.rb b/app/controllers/platforms_controller.rb index 9c9563e02..060fe99e0 100644 --- a/app/controllers/platforms_controller.rb +++ b/app/controllers/platforms_controller.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class PlatformsController < ApplicationController before_filter :authenticate_user!, :except => :easy_urpmi before_filter :find_platform, :only => [:freeze, :unfreeze, :clone, :edit, :destroy] diff --git a/app/controllers/private_users_controller.rb b/app/controllers/private_users_controller.rb index 8583eed73..0b25d1202 100644 --- a/app/controllers/private_users_controller.rb +++ b/app/controllers/private_users_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class PrivateUsersController < ApplicationController before_filter :authenticate_user! before_filter :find_platform_and_private_users @@ -13,7 +14,7 @@ class PrivateUsersController < ApplicationController @pair = PrivateUser.generate_pair(params[:platform_id], current_user.id) @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 #def destroy diff --git a/app/controllers/privates_controller.rb b/app/controllers/privates_controller.rb index a722eaa5c..a375d9ce9 100644 --- a/app/controllers/privates_controller.rb +++ b/app/controllers/privates_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class PrivatesController < ApplicationController require 'digest/sha2' diff --git a/app/controllers/product_build_lists_controller.rb b/app/controllers/product_build_lists_controller.rb index 9af5761aa..fac839015 100644 --- a/app/controllers/product_build_lists_controller.rb +++ b/app/controllers/product_build_lists_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProductBuildListsController < ApplicationController before_filter :authenticate_user!, :except => [:status_build] load_and_authorize_resource :platform, :only => [:create] diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 4ba424475..66beed7b7 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProductsController < ApplicationController before_filter :authenticate_user! before_filter :find_product, :only => [:show, :edit, :update, :destroy] diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 094268d4e..54c5d5496 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProjectsController < ApplicationController is_related_controller! diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 47217859f..317683699 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class RepositoriesController < ApplicationController before_filter :authenticate_user! before_filter :find_repository, :except => [:index, :new, :create] diff --git a/app/controllers/rpc_controller.rb b/app/controllers/rpc_controller.rb index 9ce8e9d38..e9e5ba78a 100644 --- a/app/controllers/rpc_controller.rb +++ b/app/controllers/rpc_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class RpcController < ApplicationController exposes_xmlrpc_methods @@ -11,30 +12,30 @@ class RpcController < ApplicationController # client.call("project_versions", 1) 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) end 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 } } end def project_versions id p = Project.find_by_id(id) - ActiveSupport::Notifications.instrument("event_log.observer", :object => p, :message => "список версий") - p.project_versions.collect {|tag| tag.name.gsub(/^\w+\./, "")} rescue 'not found' + ActiveSupport::Notifications.instrument "event_log.observer", :object => p, :message => I18n.t('event_log.notices.versions_list') + p.tags.map(&:name) rescue 'not found' end def build_status 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' end def build_packet project_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 end end diff --git a/app/controllers/settings/notifiers_controller.rb b/app/controllers/settings/notifiers_controller.rb index 03df52237..78d16a671 100644 --- a/app/controllers/settings/notifiers_controller.rb +++ b/app/controllers/settings/notifiers_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Settings::NotifiersController < ApplicationController layout "sessions" diff --git a/app/controllers/subscribes_controller.rb b/app/controllers/subscribes_controller.rb index e9ff43abf..ddf208c64 100644 --- a/app/controllers/subscribes_controller.rb +++ b/app/controllers/subscribes_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class SubscribesController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 55665e78d..a23a8c7e1 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def open_id # raise env['omniauth.auth'].inspect diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 79a088b01..fcb1079d4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class UsersController < ApplicationController before_filter :authenticate_user! before_filter :find_user, :only => [:show, :edit, :update, :destroy] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2a0a40d45..05055fa4f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module ApplicationHelper def choose_title title = if ['categories', 'personal_repositories', 'downloads'].include?(controller.controller_name) diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 0ec9ca5f2..cb5f47b33 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -1,2 +1,3 @@ +# -*- encoding : utf-8 -*- module CommentsHelper end diff --git a/app/helpers/commit_helper.rb b/app/helpers/commit_helper.rb index 58f1bcd57..8093043b3 100644 --- a/app/helpers/commit_helper.rb +++ b/app/helpers/commit_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module CommitHelper def render_commit_stats(stats) @@ -36,4 +37,4 @@ module CommitHelper truncate(message, :length => 42, :omission => "...") end -end \ No newline at end of file +end diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index e130c38b0..c3b12cb4e 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module DiffHelper def render_diff(diff) @@ -14,4 +15,4 @@ module DiffHelper res.html_safe end -end \ No newline at end of file +end diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb index 286fba6f2..619376dd2 100644 --- a/app/helpers/git_helper.rb +++ b/app/helpers/git_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module GitHelper def render_path diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index bfb9d25e5..07236a9d0 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -1,2 +1,3 @@ +# -*- encoding : utf-8 -*- module IssuesHelper end diff --git a/app/helpers/platforms_helper.rb b/app/helpers/platforms_helper.rb index c27de0604..deebfa87e 100644 --- a/app/helpers/platforms_helper.rb +++ b/app/helpers/platforms_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module PlatformsHelper def repository_name_postfix(platform) return "" unless platform diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 363bde95d..06c4de5b0 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module ProjectsHelper def git_repo_url(name) if current_user diff --git a/app/helpers/settings/notifiers_helper.rb b/app/helpers/settings/notifiers_helper.rb index 295af1e51..218ea67f6 100644 --- a/app/helpers/settings/notifiers_helper.rb +++ b/app/helpers/settings/notifiers_helper.rb @@ -1,2 +1,3 @@ +# -*- encoding : utf-8 -*- module Settings::NotifiersHelper end diff --git a/app/helpers/subscribes_helper.rb b/app/helpers/subscribes_helper.rb index dc1b490ec..dbf4053de 100644 --- a/app/helpers/subscribes_helper.rb +++ b/app/helpers/subscribes_helper.rb @@ -1,2 +1,3 @@ +# -*- encoding : utf-8 -*- module SubscribesHelper end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 39ceffa17..cbdc97486 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,4 +1,4 @@ -# coding: UTF-8 +# -*- encoding : utf-8 -*- class UserMailer < ActionMailer::Base default :from => APP_CONFIG['do-not-reply-email'] diff --git a/app/models/ability.rb b/app/models/ability.rb index 7709990ee..f2412a566 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # 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 # WARNING: diff --git a/app/models/arch.rb b/app/models/arch.rb index 90258febf..7a65eb3fe 100644 --- a/app/models/arch.rb +++ b/app/models/arch.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Arch < ActiveRecord::Base has_many :build_lists, :dependent => :destroy diff --git a/app/models/authentication.rb b/app/models/authentication.rb index 26ba03317..0f29e3da9 100644 --- a/app/models/authentication.rb +++ b/app/models/authentication.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Authentication < ActiveRecord::Base belongs_to :user diff --git a/app/models/auto_build_list.rb b/app/models/auto_build_list.rb index 9f607121d..ce88aa10a 100644 --- a/app/models/auto_build_list.rb +++ b/app/models/auto_build_list.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class AutoBuildList < ActiveRecord::Base belongs_to :project belongs_to :arch diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 91534a5a5..4da5118a8 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class BuildList < ActiveRecord::Base belongs_to :project belongs_to :arch diff --git a/app/models/build_list/filter.rb b/app/models/build_list/filter.rb index 6340dc1b7..8ffb725c6 100644 --- a/app/models/build_list/filter.rb +++ b/app/models/build_list/filter.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class BuildList::Filter def initialize(project, options = {}) @project = project @@ -73,4 +74,4 @@ class BuildList::Filter nil end end -end \ No newline at end of file +end diff --git a/app/models/build_list/item.rb b/app/models/build_list/item.rb index ec49f740c..e419526a9 100644 --- a/app/models/build_list/item.rb +++ b/app/models/build_list/item.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class BuildList::Item < ActiveRecord::Base belongs_to :build_list diff --git a/app/models/category.rb b/app/models/category.rb index 31e8001df..d84e8c70a 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Category < ActiveRecord::Base has_many :projects, :dependent => :nullify diff --git a/app/models/comment.rb b/app/models/comment.rb index 8ba9c05d0..4d0c5d020 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Comment < ActiveRecord::Base belongs_to :commentable, :polymorphic => true belongs_to :user diff --git a/app/models/container.rb b/app/models/container.rb index 7008fa54d..f2564b763 100644 --- a/app/models/container.rb +++ b/app/models/container.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Container < ActiveRecord::Base belongs_to :project belongs_to :owner, :class_name => 'User', :foreign_key => 'owner_id' diff --git a/app/models/download.rb b/app/models/download.rb index 6d0630bbf..bbdcbfa6e 100644 --- a/app/models/download.rb +++ b/app/models/download.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Download < ActiveRecord::Base PREV_LOG_FILE = "#{ APP_CONFIG['nginx_log'] }.0" diff --git a/app/models/event_log.rb b/app/models/event_log.rb index e69226f6c..ba1e2343e 100644 --- a/app/models/event_log.rb +++ b/app/models/event_log.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class EventLog < ActiveRecord::Base belongs_to :user belongs_to :object, :polymorphic => true diff --git a/app/models/event_log_observer.rb b/app/models/event_log_observer.rb index 4d1163327..7adbeb446 100644 --- a/app/models/event_log_observer.rb +++ b/app/models/event_log_observer.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class EventLogObserver < ActiveRecord::Observer observe :user, :private_user, :platform, :repository, :project, :product, :build_list, :auto_build_list, :product_build_list diff --git a/app/models/git/repository.rb b/app/models/git/repository.rb index 12bec4ee3..4ed82b210 100644 --- a/app/models/git/repository.rb +++ b/app/models/git/repository.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Git::Repository delegate :commits, :commit, :tree, :tags, :heads, :commit_count, :log, :branches, :to => :repo @@ -37,4 +38,4 @@ class Git::Repository [commits(treeish, options[:per_page], skip), options[:page], last_page] end -end \ No newline at end of file +end diff --git a/app/models/group.rb b/app/models/group.rb index 5ea1427f5..a720995ef 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Group < ActiveRecord::Base belongs_to :owner, :class_name => 'User' diff --git a/app/models/issue.rb b/app/models/issue.rb index efeffbf13..7f6bfaae6 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Issue < ActiveRecord::Base STATUSES = ['open', 'closed'] diff --git a/app/models/platform.rb b/app/models/platform.rb index afbb31da3..e7b552ba2 100644 --- a/app/models/platform.rb +++ b/app/models/platform.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- #require 'lib/build_server.rb' class Platform < ActiveRecord::Base VISIBILITIES = ['open', 'hidden'] diff --git a/app/models/private_user.rb b/app/models/private_user.rb index 48afa84f9..c21e6f97d 100644 --- a/app/models/private_user.rb +++ b/app/models/private_user.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class PrivateUser < ActiveRecord::Base require 'digest/sha2' require 'active_support/secure_random' diff --git a/app/models/product.rb b/app/models/product.rb index 84afdfb35..94248612c 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Product < ActiveRecord::Base ATTRS_TO_CLONE = [ 'build_path', 'build_script', 'counter', 'ks', 'menu', 'tar', 'use_cron', 'cron_tab' ] diff --git a/app/models/product_build_list.rb b/app/models/product_build_list.rb index 09d936ea2..b01ee85e4 100644 --- a/app/models/product_build_list.rb +++ b/app/models/product_build_list.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProductBuildList < ActiveRecord::Base BUILD_STARTED = 2 BUILD_COMPLETED = 0 diff --git a/app/models/project.rb b/app/models/project.rb index 64cb8869d..18725d165 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Project < ActiveRecord::Base VISIBILITIES = ['open', 'hidden'] MAX_OWN_PROJECTS = 32000 @@ -54,7 +55,7 @@ class Project < ActiveRecord::Base :pl => auto_build_list.pl, :bpl => auto_build_list.bpl, :arch => auto_build_list.arch, - :project_version => collected_project_versions.last, + :project_version => versions.last, :build_requires => true, :update_type => 'bugfix') unless build_lists.for_creation_date_period(Time.current - 15.seconds, Time.current).present? end @@ -75,16 +76,6 @@ class Project < ActiveRecord::Base 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 self.git_repository.tags #.sort_by{|t| t.name.gsub(/[a-zA-Z.]+/, '').to_i} end diff --git a/app/models/project_import.rb b/app/models/project_import.rb index b50ca7761..05544ba16 100644 --- a/app/models/project_import.rb +++ b/app/models/project_import.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProjectImport < ActiveRecord::Base belongs_to :project diff --git a/app/models/project_to_repository.rb b/app/models/project_to_repository.rb index 0679957eb..7bf5adba5 100644 --- a/app/models/project_to_repository.rb +++ b/app/models/project_to_repository.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class ProjectToRepository < ActiveRecord::Base belongs_to :project belongs_to :repository diff --git a/app/models/relation.rb b/app/models/relation.rb index a08ddf6a9..59c31d29d 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Relation < ActiveRecord::Base belongs_to :target, :polymorphic => true belongs_to :object, :polymorphic => true diff --git a/app/models/repository.rb b/app/models/repository.rb index 188b13e27..29cb61fff 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Repository < ActiveRecord::Base belongs_to :platform belongs_to :owner, :polymorphic => true diff --git a/app/models/rpm.rb b/app/models/rpm.rb index e954c8247..577028102 100644 --- a/app/models/rpm.rb +++ b/app/models/rpm.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Rpm < ActiveRecord::Base belongs_to :arch belongs_to :project diff --git a/app/models/settings.rb b/app/models/settings.rb index f6af89076..fee53706e 100644 --- a/app/models/settings.rb +++ b/app/models/settings.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module Settings def self.table_name_prefix 'settings_' diff --git a/app/models/settings/notifier.rb b/app/models/settings/notifier.rb index af21fd811..034117b26 100644 --- a/app/models/settings/notifier.rb +++ b/app/models/settings/notifier.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Settings::Notifier < ActiveRecord::Base belongs_to :user diff --git a/app/models/subscribe.rb b/app/models/subscribe.rb index 0c3a52698..cd7352038 100644 --- a/app/models/subscribe.rb +++ b/app/models/subscribe.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class Subscribe < ActiveRecord::Base belongs_to :subscribeable, :polymorphic => true belongs_to :user diff --git a/app/models/user.rb b/app/models/user.rb index ae724821f..59f9442f5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- class User < ActiveRecord::Base ROLES = ['admin'] LANGUAGES_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']] diff --git a/app/views/git/commits/show.html.haml b/app/views/git/commits/show.html.haml index 8f3ec67f8..d1a13e2f5 100644 --- a/app/views/git/commits/show.html.haml +++ b/app/views/git/commits/show.html.haml @@ -14,7 +14,9 @@ .content .inner .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 = render_commit_stats(@commit.stats) diff --git a/app/views/personal_repositories/_proj_list1.html.haml b/app/views/personal_repositories/_proj_list1.html.haml index c37d33bf7..8f98f58cd 100644 --- a/app/views/personal_repositories/_proj_list1.html.haml +++ b/app/views/personal_repositories/_proj_list1.html.haml @@ -4,7 +4,8 @@ %th.last   - @projects.each do |project| %tr{:class => cycle("odd", "even")} - %td - = link_to project.name, project_path(project) + %td= link_to project.name, project_path(project) %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") \ No newline at end of file diff --git a/app/views/repositories/_proj_list1.html.haml b/app/views/repositories/_proj_list1.html.haml index c37d33bf7..c548783b5 100644 --- a/app/views/repositories/_proj_list1.html.haml +++ b/app/views/repositories/_proj_list1.html.haml @@ -7,4 +7,6 @@ %td = link_to project.name, project_path(project) %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") diff --git a/bin/import_srpm.sh b/bin/import_srpm.sh index 6b3bd1512..272d95721 100755 --- a/bin/import_srpm.sh +++ b/bin/import_srpm.sh @@ -32,8 +32,9 @@ rm -f srpm.cpio # Commit and push changes git add -A . -git commit -m "Automatic import for version $version" -git push origin HEAD +git commit -m "Automatic import for version $version" +git branch $git_branch # Ensure branch exists +git push origin master $git_branch # Cleanup rm -rf $tmp_dir diff --git a/bin/xml-client-demo.rb b/bin/xml-client-demo.rb index baa02045b..af73ea16c 100755 --- a/bin/xml-client-demo.rb +++ b/bin/xml-client-demo.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- #!/usr/bin/env ruby require 'rubygems' @@ -34,4 +35,4 @@ project_id = 1 # FIXME repo_id = 1 # FIXME pp client.call("build_packet", project_id, repo_id) -puts 'DONE' \ No newline at end of file +puts 'DONE' diff --git a/config/application.rb b/config/application.rb index 901d86784..22fd70342 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path('../boot', __FILE__) require 'rails/all' diff --git a/config/boot.rb b/config/boot.rb index 4489e5868..f488c9a44 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require 'rubygems' # Set up gems listed in the Gemfile. diff --git a/config/compass.rb b/config/compass.rb index 07bb179f2..d3fe0bb92 100644 --- a/config/compass.rb +++ b/config/compass.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # This configuration file works with both the Compass command line tool and within Rails. # Require any additional compass plugins here. @@ -12,4 +13,4 @@ sass_dir = "app/stylesheets" javascripts_dir = "public/javascripts" http_stylesheets_path = "/stylesheets" -http_javascripts_path = "/javascripts" \ No newline at end of file +http_javascripts_path = "/javascripts" diff --git a/config/deploy.rb b/config/deploy.rb index b03d867e4..c67c374a3 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) set :rvm_type, :user @@ -27,9 +28,9 @@ set :scm, :git set :repository, "git@github.com:warpc/rosa-build.git" set :deploy_via, :remote_cache -require 'lib/recipes/nginx' -require 'lib/recipes/unicorn' -require 'lib/recipes/bluepill' +require './lib/recipes/nginx' +require './lib/recipes/unicorn' +require './lib/recipes/bluepill' namespace :deploy do task :stub_xml_rpc do diff --git a/config/deploy/pingwinsoft.rb b/config/deploy/pingwinsoft.rb index a15b8c22a..088b5b27d 100644 --- a/config/deploy/pingwinsoft.rb +++ b/config/deploy/pingwinsoft.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- set :branch, "pingwinsoft" set :domain, "b.pingwinsoft.ru" # "195.19.76.12" diff --git a/config/environment.rb b/config/environment.rb index b35a7204e..0a6cad37f 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Load the rails application require File.expand_path('../application', __FILE__) diff --git a/config/environments/development.rb b/config/environments/development.rb index 6a687d647..3e4c691ae 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- Rosa::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/config/environments/production.rb b/config/environments/production.rb index 0d9247b3a..fe08b9089 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- Rosa::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/config/environments/test.rb b/config/environments/test.rb index 8bff1dc49..44f17a243 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- Rosa::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 59385cdf3..b5e9a55a2 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # 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. diff --git a/config/initializers/default_product_files.rb b/config/initializers/default_product_files.rb index 6222e022c..2551ce137 100644 --- a/config/initializers/default_product_files.rb +++ b/config/initializers/default_product_files.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- DEFAULT_KS = <<-eos timezone Europe/Moscow auth --useshadow --enablemd5 diff --git a/config/initializers/generators.rb b/config/initializers/generators.rb index 2c07eb336..47fae7cb8 100644 --- a/config/initializers/generators.rb +++ b/config/initializers/generators.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- Rails.application.config.generators do |g| g.test_framework = :rspec end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e8b0131f..e3c680d36 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb index 70d1244b6..7dfd2abbd 100644 --- a/config/initializers/load_config.rb +++ b/config/initializers/load_config.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env] require 'modules' diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index e9307179b..a68a2d48e 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: @@ -5,4 +6,4 @@ # Mime::Type.register_alias "text/html", :iphone Mime::Type.register "text/plain", :diff -Mime::Type.register "text/plain", :patch \ No newline at end of file +Mime::Type.register "text/plain", :patch diff --git a/config/initializers/notifications.rb b/config/initializers/notifications.rb index 965ce9dc0..75d0ebba1 100644 --- a/config/initializers/notifications.rb +++ b/config/initializers/notifications.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- Warden::Manager.after_authentication do |user,auth,opts| # after_set_user, :except => fetch ActiveSupport::Notifications.instrument("event_log.observer", :object => user) end diff --git a/config/initializers/render_errors_in_forms.rb b/config/initializers/render_errors_in_forms.rb index e1ec4a433..fb36c59ed 100644 --- a/config/initializers/render_errors_in_forms.rb +++ b/config/initializers/render_errors_in_forms.rb @@ -1,7 +1,8 @@ +# -*- encoding : utf-8 -*- ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| if html_tag =~ /