Add magic encodings. Refs #95

This commit is contained in:
Pavel Chipiga 2012-01-30 22:39:34 +02:00
parent 33dce21312
commit 13780a1b53
289 changed files with 318 additions and 41 deletions

View File

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

View File

@ -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

View File

@ -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]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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]

View File

@ -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]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RpcController < ApplicationController
exposes_xmlrpc_methods

View File

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

View File

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

View File

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

View File

@ -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]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
# coding: UTF-8
# -*- encoding : utf-8 -*-
class UserMailer < ActionMailer::Base
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 rule has multiple conditions CanCan joins them by 'AND' sql operator
# WARNING:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Git::Repository
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
belongs_to :owner, :class_name => 'User'

View File

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

View File

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

View File

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

View File

@ -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' ]

View File

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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Project < ActiveRecord::Base
VISIBILITIES = ['open', 'hidden']

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'rubygems'
# 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.
# Require any additional compass plugins here.

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
set :rvm_type, :user

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rosa::Application.configure do
# 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
# 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
# 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.
# 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
timezone Europe/Moscow
auth --useshadow --enablemd5

View File

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

View File

@ -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

View File

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

View File

@ -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:

View File

@ -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

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag =~ /<label/
%|<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.
Rosa::Application.config.session_store :cookie_store, :key => '_rosa_session'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
Rosa::Application.routes.draw do
# XML RPC
match 'api/xmlrpc' => 'rpc#xe_index'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
#every 1.day, :at => '0:05 am' do
# runner "Download.rotate_nginx_log"
#end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
base_path = File.expand_path(File.join File.dirname(__FILE__), '..')
rails_env = ENV['RAILS_ENV'] || 'production'

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CreatePlatforms < ActiveRecord::Migration
def self.up
create_table :platforms do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CreateProjects < ActiveRecord::Migration
def self.up
create_table :projects do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CreateRepositories < ActiveRecord::Migration
def self.up
create_table :repositories do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RemovePlatformIdFromProjects < ActiveRecord::Migration
def self.up
remove_column :projects, :platform_id

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddRepositoryIdToProjects < ActiveRecord::Migration
def self.up
add_column :projects, :repository_id, :integer, :null => false

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddUnixnameToRepositories < ActiveRecord::Migration
def self.up
add_column :repositories, :unixname, :string, :null => false

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