Some cleanups, required ruby changed to 2.1.5 and version bump
This commit is contained in:
parent
145e422c43
commit
22ac3b94bc
@ -1,6 +1,9 @@
|
||||
Rails:
|
||||
Enabled: true
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.1
|
||||
|
||||
Metrics/LineLength:
|
||||
Max: 140
|
||||
|
||||
|
@ -1,6 +1,13 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
1.0.1
|
||||
+++++
|
||||
|
||||
- Coding standard cleanups
|
||||
- ruby 2.1.5 required or newer
|
||||
- version bump
|
||||
|
||||
1.0.0
|
||||
+++++
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Redmine Tweaks plugin for Redmine
|
||||
* Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
* Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Redmine Tweaks plugin for Redmine
|
||||
* Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
* Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
@ -24,7 +24,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'redmine_tweaks'
|
||||
copyright = u'2013-2016, AlphaNodes GmbH'
|
||||
copyright = u'2013-2017, AlphaNodes GmbH'
|
||||
author = u'Alexander Meindl'
|
||||
|
||||
# The short X.Y version.
|
||||
|
@ -33,7 +33,7 @@ Requirements
|
||||
+--------------------+----------------------+
|
||||
| `Redmine`_ version | >= 2.6.0 |
|
||||
+--------------------+----------------------+
|
||||
| `Ruby`_ version | >= 2.0.0 |
|
||||
| `Ruby`_ version | >= 2.1.5 |
|
||||
+--------------------+----------------------+
|
||||
| Gem packages | see `PluginGemfile`_ |
|
||||
+--------------------+----------------------+
|
||||
|
4
init.rb
4
init.rb
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require 'redmine'
|
||||
require 'redmine_tweaks'
|
||||
@ -8,7 +8,7 @@ Redmine::Plugin.register :redmine_tweaks do
|
||||
name 'Tweaks'
|
||||
author 'AlphaNodes GmbH'
|
||||
description 'Wiki and content extensions'
|
||||
version '1.0.0'
|
||||
version '1.0.1'
|
||||
author_url 'https://alphanodes.com/'
|
||||
url 'https://github.com/alphanodes/redmine_tweaks'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
if ActiveRecord::Base.connection.table_exists?(:settings)
|
||||
Rails.configuration.to_prepare do
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Redmine Tweak helper functions
|
||||
module RedmineTweaks
|
||||
@ -94,7 +94,7 @@ module RedmineTweaks
|
||||
|
||||
html_options = {}
|
||||
html_options[:class] = 'external' if item[:url].include? '://'
|
||||
html_options[:title] = item[:title] unless item[:title].blank?
|
||||
html_options[:title] = item[:title] if item[:title].present?
|
||||
Redmine::MenuManager.map(:top_menu).push menu_name,
|
||||
item[:url],
|
||||
caption: item[:name].to_s,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
module RedmineTweaks
|
||||
class RedmineTweaksHookListener < Redmine::Hook::ViewListener
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require_dependency 'redmine/info'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
module RedmineTweaks
|
||||
module Patches
|
||||
@ -35,7 +35,7 @@ module RedmineTweaks
|
||||
return groups[manager_role].first.id unless groups.nil? || groups[manager_role].blank?
|
||||
|
||||
users_list = project.users_by_role
|
||||
return users_list[manager_role].first.id unless users_list[manager_role].blank?
|
||||
return users_list[manager_role].first.id if users_list[manager_role].present?
|
||||
end
|
||||
|
||||
def autoassign_get_group_list
|
||||
@ -56,7 +56,7 @@ module RedmineTweaks
|
||||
def new_ticket_message
|
||||
@new_ticket_message = ''
|
||||
message = Setting.plugin_redmine_tweaks[:new_ticket_message]
|
||||
@new_ticket_message << message unless message.blank?
|
||||
@new_ticket_message << message if message.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require_dependency 'time_entry'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require_dependency 'wiki_controller'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require_dependency 'wiki'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
module RedmineTweaks
|
||||
module Patches
|
||||
@ -20,7 +20,7 @@ module RedmineTweaks
|
||||
pdf.alias_nb_pages
|
||||
pdf.footer_date = format_date(User.current.today)
|
||||
pdf.add_page
|
||||
unless RedmineTweaks.settings[:wiki_pdf_header].blank?
|
||||
if RedmineTweaks.settings[:wiki_pdf_header].present?
|
||||
pdf.SetFontStyle('', 9)
|
||||
pdf.RDMwriteFormattedCell(100,
|
||||
5,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Calendar wiki macros
|
||||
module RedmineTweaks
|
||||
@ -27,7 +27,7 @@ module RedmineTweaks
|
||||
options[:month] = options[:month].to_i - 1
|
||||
|
||||
selected = ''
|
||||
selected = RedmineTweaks.convert_string2date(options[:select]) unless options[:select].blank?
|
||||
selected = RedmineTweaks.convert_string2date(options[:select]) if options[:select].present?
|
||||
|
||||
locale = User.current.language.blank? ? ::I18n.locale : User.current.language
|
||||
# not more then 30 calendars per page are expected
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Date wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Gist wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Issue wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Last_updated_at wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Last_updated_by wiki macros
|
||||
module RedmineTweaks
|
||||
@ -13,7 +13,7 @@ module RedmineTweaks
|
||||
macro :last_updated_by do |obj, args|
|
||||
raise 'The correct usage is {{last_updated_by}}' unless args.empty?
|
||||
content_tag(:span,
|
||||
"#{avatar(obj.author, size: 14)} #{link_to_user(obj.author)}".html_safe,
|
||||
safe_join([avatar(obj.author, size: 14), ' ', link_to_user(obj.author)]),
|
||||
class: 'last-updated-by')
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Member wiki macros
|
||||
module RedmineTweaks
|
||||
@ -54,7 +54,7 @@ module RedmineTweaks
|
||||
users = []
|
||||
raw_users.each do |user|
|
||||
user_roles[user.id] = user.roles_for_project(project)
|
||||
if !options[:role].present? || RedmineTweaks.check_role_matches(user_roles[user.id], options[:role])
|
||||
if options[:role].blank? || RedmineTweaks.check_role_matches(user_roles[user.id], options[:role])
|
||||
users << user
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Project wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Recently updated wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Slideshare wiki macros
|
||||
module RedmineTweaks
|
||||
@ -26,12 +26,12 @@ module RedmineTweaks
|
||||
height = 485
|
||||
slide = 0
|
||||
|
||||
width = options[:width] unless options[:width].blank?
|
||||
height = options[:height] unless options[:height].blank?
|
||||
slide = options[:slide].to_i unless options[:slide].blank?
|
||||
width = options[:width] if options[:width].present?
|
||||
height = options[:height] if options[:height].present?
|
||||
slide = options[:slide].to_i if options[:slide].present?
|
||||
|
||||
if (options[:width].blank? && !options[:height].blank?) ||
|
||||
(!options[:width].blank? && options[:height].blank?) ||
|
||||
if (options[:width].blank? && options[:height].present?) ||
|
||||
(options[:width].present? && options[:height].blank?) ||
|
||||
args.empty?
|
||||
raise 'The correct usage is {{slideshare(<key>[, width=x, height=y, slide=number])}}'
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Twitter wiki macros
|
||||
module RedmineTweaks
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# User wiki macros
|
||||
module RedmineTweaks
|
||||
@ -38,7 +38,7 @@ module RedmineTweaks
|
||||
end
|
||||
|
||||
s = []
|
||||
if !options[:avatar].blank? && options[:avatar]
|
||||
if options[:avatar].present? && options[:avatar]
|
||||
s << avatar(user, size: 14) + ' '
|
||||
end
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Vimeo wiki macros
|
||||
module RedmineTweaks
|
||||
@ -26,13 +26,13 @@ module RedmineTweaks
|
||||
height = 360
|
||||
autoplay = false
|
||||
|
||||
width = options[:width] unless options[:width].blank?
|
||||
height = options[:height] unless options[:height].blank?
|
||||
width = options[:width] if options[:width].present?
|
||||
height = options[:height] if options[:height].present?
|
||||
autoplay = true if !options[:autoplay].nil? &&
|
||||
(options[:autoplay] == 'true' || options[:autoplay] == '1')
|
||||
|
||||
if (options[:width].blank? && !options[:height].blank?) ||
|
||||
(!options[:width].blank? && options[:height].blank?) ||
|
||||
if (options[:width].blank? && options[:height].present?) ||
|
||||
(options[:width].present? && options[:height].blank?) ||
|
||||
args.empty?
|
||||
raise 'The correct usage is {{vimeo(<video key>[, width=x, height=y])}}'
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
# Youtube wiki macros
|
||||
module RedmineTweaks
|
||||
@ -26,13 +26,13 @@ module RedmineTweaks
|
||||
height = 360
|
||||
autoplay = false
|
||||
|
||||
width = options[:width] unless options[:width].blank?
|
||||
height = options[:height] unless options[:height].blank?
|
||||
width = options[:width] if options[:width].present?
|
||||
height = options[:height] if options[:height].present?
|
||||
autoplay = true if !options[:autoplay].nil? &&
|
||||
(options[:autoplay] == 'true' || options[:autoplay] == '1')
|
||||
|
||||
if (options[:width].blank? && !options[:height].blank?) ||
|
||||
(!options[:width].blank? && options[:height].blank?) ||
|
||||
if (options[:width].blank? && options[:height].present?) ||
|
||||
(options[:width].present? && options[:height].blank?) ||
|
||||
args.empty?
|
||||
raise 'The correct usage is {{youtube(<video key>[, width=x, height=y])}}'
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
@ -21,7 +21,11 @@ module Redmine
|
||||
end
|
||||
|
||||
def test_locales_validness
|
||||
lang_files_count = Dir["#{Rails.root}/plugins/redmine_tweaks/config/locales/*.yml"].size
|
||||
lang_files_count = Dir[Rails.root.join('plugins',
|
||||
'redmine_tweaks',
|
||||
'config',
|
||||
'locales',
|
||||
'*.yml')].size
|
||||
assert_equal lang_files_count, 3
|
||||
valid_languages.each do |lang|
|
||||
assert set_language_if_valid(lang)
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Redmine Tweaks plugin for Redmine
|
||||
# Copyright (C) 2013-2016 AlphaNodes GmbH
|
||||
# Copyright (C) 2013-2017 AlphaNodes GmbH
|
||||
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user