Skip to content

Commit

Permalink
Drop Redmine versions (3.4, 3.3, 3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
maeda-m committed Mar 18, 2019
1 parent 7e7670a commit 1a04b21
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 65 deletions.
23 changes: 7 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@

language: ruby

# http://www.redmine.org/projects/redmine/wiki/RedmineInstall
rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6

env:
- REDMINE_REPOS=branches/3.4-stable
- REDMINE_REPOS=branches/3.3-stable
- REDMINE_REPOS=branches/3.2-stable

gemfile:
- $REDMINE_PATH/Gemfile

matrix:
allow_failures:
- rvm: 2.4
- REDMINE_REPOS=branches/4.0-stable

before_install:
- export PLUGIN_NAME=redmine_serial_number_field
- export DB=sqlite
- export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- export REDMINE_PATH=$HOME/redmine
- export BUNDLE_GEMFILE=$REDMINE_PATH/Gemfile
- svn co http://svn.redmine.org/redmine/$REDMINE_REPOS $REDMINE_PATH
- ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME
- cp test/database.travis.yml $REDMINE_PATH/config/database.yml
- cd $REDMINE_PATH
- bundle update

before_script:
- bundle exec rake db:migrate
- bundle exec rails db:migrate

script:
- RUBYOPT=-W0 bundle exec rake redmine:plugins:test NAME=$PLUGIN_NAME
- bundle exec rails redmine:plugins:test NAME=$PLUGIN_NAME RAILS_ENV=test

branches:
only:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 2.0.0

- Support Redmine 4.0 (@nanego)
- Support French locale (@nanego)
- Drop support Redmine version 3.4 lower (@maeda-m)

## 1.0.0

- Changed the range to count sequential numbers from project unit to whole sharing as custom field unit #4 (@neocosmic2)

## 0.9.0

- Support Turkish locale #3 (@atopcu)
- Allow only sequence numbers #2 (@y-arai)
- Drop support Redmine versions 2.6 and 3.1 (@maeda-m)
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
gem 'fiscali'

group :test do
gem 'rails-controller-testing'
gem 'byebug'
end
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Add a format to be serial number in the specified format as a issue custom field

## Supported versions

* Redmine 3.2.x or higher
* Redmine 4.0 (Ruby 2.2, 2.3, 2.4, 2.5, 2.6)

## Format specifications

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Redmine に自動で連番を付加するカスタムフィールドを提供す

## Supported versions

* Redmine 3.2.x or higher
* Redmine 4.0 (Ruby 2.2, 2.3, 2.4, 2.5, 2.6)

## Format specifications

Expand Down
21 changes: 8 additions & 13 deletions app/patches/issue_custom_field_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@ module SerialNumberField
module IssueCustomFieldPatch
extend ActiveSupport::Concern

included do
unloadable
def validate_custom_field
super

def validate_custom_field
super
invalid_message = l('activerecord.errors.messages.invalid')
if errors[:regexp].include?(invalid_message) && field_format == SerialNumberField::Format::NAME
regexp_error_messages = errors[:regexp].clone

invalid_message = l('activerecord.errors.messages.invalid')
if errors[:regexp].include?(invalid_message) && field_format == SerialNumberField::Format::NAME
regexp_error_messages = errors[:regexp].clone

errors.delete(:regexp)
regexp_error_messages.each do |regexp_error_message|
errors[:regexp] = regexp_error_message unless regexp_error_message == invalid_message
end
errors.delete(:regexp)
regexp_error_messages.each do |regexp_error_message|
errors[:regexp] = regexp_error_message unless regexp_error_message == invalid_message
end
end

end

end
Expand Down
3 changes: 0 additions & 3 deletions app/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
module SerialNumberField
module IssuePatch
extend ActiveSupport::Concern
unloadable

included do
unloadable

after_save :assign_serial_number!
end

Expand Down
1 change: 0 additions & 1 deletion config/locales/tr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

tr:
label_serial_number: Otomatik Seri No

Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name 'Redmine Serial Number Field'
author 'Matsukei Co.,Ltd'
description 'Add a format to be serial number in the specified format as a issue custom field.'
version '1.0.0'
requires_redmine version_or_higher: '2.6'
version '2.0.0'
requires_redmine version_or_higher: '4.0'
url 'https://github.com/matsukei/redmine_serial_number_field'
author_url 'http://www.matsukei.co.jp/'
end
Expand Down
14 changes: 7 additions & 7 deletions test/functional/custom_fields_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_new_should_serial_number_format_has_only_issue
format_name = SerialNumberField::Format::NAME
expect_selected = 'IssueCustomField' == type ? 1 : 0

get :new, {
get :new, :params => {
:type => type,
:custom_field => {
:field_format => format_name
Expand All @@ -43,7 +43,7 @@ def test_new_should_serial_number_format_has_only_issue
end

def test_new_serial_number_format
get :new, {
get :new, :params => {
:type => 'IssueCustomField',
:custom_field => {
:field_format => SerialNumberField::Format::NAME
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_create_serial_number_field
valid_regexp_values.each_with_index do |valid_regexp, i|
field_name = "auto_number_#{i.next}"
field = new_record(IssueCustomField) do
post :create, {
post :create, :params => {
:type => "IssueCustomField",
:custom_field => {
:field_format => "serial_number",
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_create_serial_number_field
def test_create_serial_number_field_with_failure
invalid_regexp_values.each_with_index do |invalid_regexp, i|
assert_no_difference 'CustomField.count' do
post :create, {
post :create, :params => {
:type => "IssueCustomField",
:custom_field => {
:field_format => "serial_number",
Expand All @@ -121,7 +121,7 @@ def test_create_serial_number_field_with_failure
def test_edit_serial_number_field
custom_field = create_default_serial_number_field

get :edit, {
get :edit, :params => {
:id => custom_field.id
}

Expand All @@ -135,7 +135,7 @@ def test_update_serial_number_field
custom_field = create_default_serial_number_field

valid_regexp_values.each_with_index do |valid_regexp, i|
put :update, {
put :update, :params => {
:id => custom_field.id,
:custom_field => {
:regexp => valid_regexp
Expand All @@ -152,7 +152,7 @@ def test_update_serial_number_field_with_failure
custom_field = create_default_serial_number_field

invalid_regexp_values.each_with_index do |invalid_regexp, i|
put :update, {
put :update, :params => {
:id => custom_field.id,
:custom_field => {
:regexp => invalid_regexp
Expand Down
Loading

0 comments on commit 1a04b21

Please sign in to comment.