diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-28 11:32:37 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-28 11:32:37 +0300 |
commit | f0227d761fa24b7f0fdf0b5fecd6d52a6d991714 (patch) | |
tree | bb5d7e83823195212db5151824fd33ea1ab9cc77 | |
parent | 2940de43a5aba532e67022e03eb6d5772625c248 (diff) | |
parent | f93616d62b7ea174da2e0c86ae1325a805ddccef (diff) | |
download | gitlab-ce-f0227d761fa24b7f0fdf0b5fecd6d52a6d991714.tar.gz |
Merge branch 'master' of github.com:gitlabhq/gitlabhq
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | Gemfile.lock | 13 | ||||
-rw-r--r-- | app/controllers/projects/services_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project_services/hipchat_service.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/regex.rb | 8 | ||||
-rw-r--r-- | lib/tasks/dev.rake | 5 | ||||
-rw-r--r-- | spec/lib/gitlab/regex_spec.rb | 3 |
8 files changed, 27 insertions, 12 deletions
diff --git a/CHANGELOG b/CHANGELOG index 96b4d4cde1f..33cf1c4378e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,6 +26,7 @@ v 7.11.0 (unreleased) - Prevent sending empty messages to HipChat (Chulki Lee) - Improve UI for mobile phones on dashboard and project pages - Add room notification and message color option for HipChat + - Allow to use non-ASCII letters and dashes in project and namespace name. (Jakub Jirutka) v 7.10.0 - Ignore submodules that are defined in .gitmodules but are checked in as directories. @@ -208,6 +208,7 @@ group :development do gem "letter_opener" gem 'quiet_assets', '~> 1.0.1' gem 'rack-mini-profiler', require: false + gem 'rerun', '~> 0.10.0' # Better errors handler gem 'better_errors' diff --git a/Gemfile.lock b/Gemfile.lock index 0f965d7b542..676a5197900 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -167,7 +167,7 @@ GEM faraday (>= 0.7.4, < 0.9) fastercsv (1.5.5) ffaker (1.22.1) - ffi (1.9.3) + ffi (1.9.8) fog (1.21.0) fog-brightbox fog-core (~> 1.21, >= 1.21.1) @@ -323,8 +323,8 @@ GEM addressable (~> 2.3) letter_opener (1.1.2) launchy (~> 2.2) - listen (2.3.1) - celluloid (>= 0.15.2) + listen (2.10.0) + celluloid (~> 0.16.0) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) lumberjack (1.0.4) @@ -456,8 +456,8 @@ GEM raindrops (0.13.0) rake (10.4.2) raphael-rails (2.1.2) - rb-fsevent (0.9.3) - rb-inotify (0.9.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) ffi (>= 0.5.0) rdoc (3.12.2) json (~> 1.4) @@ -482,6 +482,8 @@ GEM redis-store (1.1.4) redis (>= 2.2) request_store (1.0.5) + rerun (0.10.0) + listen (~> 2.7, >= 2.7.3) rest-client (1.6.7) mime-types (>= 1.16) rinku (1.7.3) @@ -763,6 +765,7 @@ DEPENDENCIES redcarpet (~> 3.2.3) redis-rails request_store + rerun (~> 0.10.0) rspec-rails (= 2.99) rubocop (= 0.28.0) rugments diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 2080ee9a00f..dc18bbd8d5b 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -1,5 +1,5 @@ class Projects::ServicesController < Projects::ApplicationController - ALLOWED_PARAMS = [:title, :token, :type, :active, :api_key, :subdomain, + ALLOWED_PARAMS = [:title, :token, :type, :active, :api_key, :api_version, :subdomain, :room, :recipients, :project_url, :webhook, :user_key, :device, :priority, :sound, :bamboo_url, :username, :password, :build_key, :server, :teamcity_url, :build_type, diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb index 2fa5f0ce71c..3a15b2207ea 100644 --- a/app/models/project_services/hipchat_service.rb +++ b/app/models/project_services/hipchat_service.rb @@ -20,7 +20,7 @@ class HipchatService < Service MAX_COMMITS = 3 - prop_accessor :token, :room, :server, :notify, :color + prop_accessor :token, :room, :server, :notify, :color, :api_version validates :token, presence: true, if: :activated? def title @@ -41,6 +41,8 @@ class HipchatService < Service { type: 'text', name: 'room', placeholder: 'Room name or ID' }, { type: 'checkbox', name: 'notify' }, { type: 'select', name: 'color', choices: ['yellow', 'red', 'green', 'purple', 'gray', 'random'] }, + { type: 'text', name: 'api_version', + placeholder: 'Leave blank for default (v2)' }, { type: 'text', name: 'server', placeholder: 'Leave blank for default. https://hipchat.example.com' } ] @@ -60,7 +62,7 @@ class HipchatService < Service private def gate - options = { api_version: 'v2' } + options = { api_version: api_version || 'v2' } options[:server_url] = server unless server.blank? @gate ||= HipChat::Client.new(token, options) end diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index 0571574aa4f..9f1adc860d1 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -15,20 +15,20 @@ module Gitlab def namespace_name_regex - @namespace_name_regex ||= /\A[a-zA-Z0-9_\-\. ]*\z/.freeze + @namespace_name_regex ||= /\A[\p{Alnum}\p{Pd}_\. ]*\z/.freeze end def namespace_name_regex_message - "can contain only letters, digits, '_', '-', '.' and space." + "can contain only letters, digits, '_', '.', dash and space." end def project_name_regex - @project_name_regex ||= /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\. ]*\z/.freeze + @project_name_regex ||= /\A[\p{Alnum}_][\p{Alnum}\p{Pd}_\. ]*\z/.freeze end def project_name_regex_message - "can contain only letters, digits, '_', '-', '.' and space. " \ + "can contain only letters, digits, '_', '.', dash and space. " \ "It must start with letter, digit or '_'." end diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index 058c7417040..b22c631c8ba 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -7,4 +7,9 @@ namespace :dev do Rake::Task["gitlab:setup"].invoke Rake::Task["gitlab:shell:setup"].invoke end + + desc 'GITLAB | Start/restart foreman and watch for changes' + task :foreman => :environment do + sh 'rerun --dir app,config,lib -- foreman start' + end end diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 727884c41c5..7fdc8fa600d 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require 'spec_helper' describe Gitlab::Regex do @@ -16,6 +17,8 @@ describe Gitlab::Regex do it { expect('GitLab CE').to match(Gitlab::Regex.project_name_regex) } it { expect('100 lines').to match(Gitlab::Regex.project_name_regex) } it { expect('gitlab.git').to match(Gitlab::Regex.project_name_regex) } + it { expect('Český název').to match(Gitlab::Regex.project_name_regex) } + it { expect('Dash – is this').to match(Gitlab::Regex.project_name_regex) } it { expect('?gitlab').not_to match(Gitlab::Regex.project_name_regex) } end end |