Skip to content

Commit c5484d4

Browse files
Add redmine_plugin_kit and switch used Additionals methods to it
1 parent 6541484 commit c5484d4

File tree

16 files changed

+23
-23
lines changed

16 files changed

+23
-23
lines changed

Diff for: Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ gem 'gitolite-rugged', git: 'https://github.com/jbox-web/gitolite-rugged.git', t
66
# Ruby/Rack Git Smart-HTTP Server Handler
77
gem 'gitlab-grack', '~> 2.0.0', git: 'https://github.com/jbox-web/grack.git', require: 'grack', branch: 'fix_gemfile'
88

9+
gem 'redmine_plugin_kit'
10+
911
# Memcached client for GitCache
1012
gem 'dalli'
1113

Diff for: app/forms/plugin_settings_validation/redmine_config.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ module RedmineConfig
2121
# hierarchical_organisation and unique_repo_identifier are now combined
2222
#
2323
before_validation do
24-
self.unique_repo_identifier = if Additionals.true? hierarchical_organisation
24+
self.unique_repo_identifier = if RedminePluginKit.true? hierarchical_organisation
2525
'false'
2626
else
2727
'true'
2828
end
2929

3030
## If we don't auto-create repository, we cannot create README file
31-
self.init_repositories_on_create = 'false' unless Additionals.true? all_projects_use_git
31+
self.init_repositories_on_create = 'false' unless RedminePluginKit.true? all_projects_use_git
3232
end
3333

3434
validates :redmine_has_rw_access_on_all_repos, presence: true, inclusion: { in: RedmineGitHosting::Validators::BOOLEAN_FIELDS }
@@ -48,7 +48,7 @@ module RedmineConfig
4848
# Check duplication if we are switching from a mode to another
4949
#
5050
def check_for_duplicated_repo
51-
return if Additionals.true? hierarchical_organisation
51+
return if RedminePluginKit.true? hierarchical_organisation
5252
return unless Repository::Xitolite.have_duplicated_identifier?
5353

5454
errors.add :base, 'Detected non-unique repository identifiers. Cannot switch to flat mode'

Diff for: app/models/repository/xitolite.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def mirror_push(url, branch, args = [])
6666
private
6767

6868
def valid_repository_options
69-
return unless Additionals.true? create_readme
70-
return unless Additionals.true? enable_git_annex
69+
return if RedminePluginKit.false? create_readme
70+
return if RedminePluginKit.false? enable_git_annex
7171

7272
errors.add :base, :invalid_options
7373
end

Diff for: app/presenters/repository_presenter.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def render_clipboard_button
5858
end
5959

6060
def committer_label(value)
61-
Additionals.true?(value[:committer]) ? l(:label_read_write_permission) : l(:label_read_only_permission)
61+
RedminePluginKit.true?(value[:committer]) ? l(:label_read_write_permission) : l(:label_read_only_permission)
6262
end
6363

6464
def element_name

Diff for: app/use_cases/settings/apply.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def do_delete_trash_repo
148148
end
149149

150150
def do_add_redmine_rw_access
151-
if Additionals.true? current_setting(:redmine_has_rw_access_on_all_repos)
151+
if RedminePluginKit.true? current_setting(:redmine_has_rw_access_on_all_repos)
152152
gitolite_accessor.enable_rw_access
153153
else
154154
gitolite_accessor.disable_rw_access

Diff for: app/views/settings/_redmine_git_hosting.html.slim

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
span
66
= l :label_need_help
77
' :
8-
= link_to l(:label_redmine_git_hosting_wiki), RedmineGitHosting::Config::GITHUB_WIKI, class: 'external'
8+
= link_to_external l(:label_redmine_git_hosting_wiki),
9+
RedmineGitHosting::Config::GITHUB_WIKI
910

1011
br
1112

1213
span
1314
= l :label_open_issue
1415
' :
15-
= link_to l(:label_redmine_git_hosting_issue), RedmineGitHosting::Config::GITHUB_ISSUE, class: 'external'
16+
= link_to_external l(:label_redmine_git_hosting_issue),
17+
RedmineGitHosting::Config::GITHUB_ISSUE
1618

1719
br
1820
br

Diff for: assets/stylesheets/.stylelintignore

-1
This file was deleted.

Diff for: db/migrate/20130807223227_migrate_parameters.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def up
137137
when 'deleteGitRepositories'
138138
new_setting[:delete_git_repositories] = value
139139
when 'gitRepositoryHierarchy'
140-
if Additionals.true? value
140+
if RedminePluginKit.true? value
141141
new_setting[:hierarchical_organisation] = 'true'
142142
new_setting[:unique_repo_identifier] = 'false'
143143
else

Diff for: lib/redmine_git_hosting.rb

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
module RedmineGitHosting
1010
extend self
1111

12+
VERSION = '5.0.1-master'
13+
1214
# Load RedminePluginLoader
1315
require 'redmine_git_hosting/redmine_plugin_loader'
1416
extend RedminePluginLoader

Diff for: lib/redmine_git_hosting/config/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Base
1313

1414
def get_setting(setting, bool = false)
1515
if bool
16-
Additionals.true? do_get_setting(setting)
16+
RedminePluginKit.true? do_get_setting(setting)
1717
else
1818
do_get_setting setting
1919
end

Diff for: lib/redmine_git_hosting/patches/repositories_controller_patch.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ def creation_options
8383
end
8484

8585
def create_readme_file?
86-
Additionals.true? @repository.create_readme
86+
RedminePluginKit.true? @repository.create_readme
8787
end
8888

8989
def enable_git_annex?
90-
Additionals.true? @repository.enable_git_annex
90+
RedminePluginKit.true? @repository.enable_git_annex
9191
end
9292

9393
REV_PARAM_RE = /\A[a-f0-9]*\Z/i

Diff for: lib/redmine_git_hosting/plugins/extenders/branch_updater.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def post_update
1717
private
1818

1919
def update_default_branch?
20-
Additionals.true? update_default_branch
20+
RedminePluginKit.true? update_default_branch
2121
end
2222

2323
def do_update_default_branch

Diff for: lib/redmine_git_hosting/plugins/extenders/git_annex_creator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def installable?
2626
end
2727

2828
def enable_git_annex?
29-
Additionals.true? enable_git_annex
29+
RedminePluginKit.true? enable_git_annex
3030
end
3131

3232
def git_annex_installed?

Diff for: lib/redmine_git_hosting/plugins/extenders/readme_creator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def installable?
2828
end
2929

3030
def create_readme_file?
31-
Additionals.true? create_readme_file
31+
RedminePluginKit.true? create_readme_file
3232
end
3333

3434
def do_create_readme_file

Diff for: lib/redmine_git_hosting/plugins/sweepers/base_sweeper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(repository_data, _options = {})
1515
private
1616

1717
def delete_repository?
18-
Additionals.true? delete_repository
18+
RedminePluginKit.true? delete_repository
1919
end
2020
end
2121
end

Diff for: lib/redmine_git_hosting/version.rb

-5
This file was deleted.

0 commit comments

Comments
 (0)