From 7248dddec33acbab3851fe2e6c8795367d0ec7a7 Mon Sep 17 00:00:00 2001 From: constXife Date: Fri, 30 Jun 2017 23:30:22 +0700 Subject: [PATCH 01/16] Initiate 1.0.1 dev version --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index f0ea4f4..9ef086c 100644 --- a/init.rb +++ b/init.rb @@ -13,7 +13,7 @@ name 'Redmine Intouch plugin' url 'https://github.com/centosadmin/redmine_intouch' description 'This is a plugin for Redmine which sends a reminder email and Telegram messages to the assignee workign on a task, whose status is not updated with-in allowed duration' - version '1.0.0' + version '1.0.1-dev' author 'Southbridge' author_url 'https://github.com/centosadmin' From 04f152d0c2013e412e9597ff01dffcf0fe59070b Mon Sep 17 00:00:00 2001 From: constXife Date: Fri, 30 Jun 2017 23:37:38 +0700 Subject: [PATCH 02/16] Remove commit_hash method to prevent "Git fatal" on any rails command --- CHANGELOG.md | 4 ++++ app/views/projects/settings/intouch/_settings.html.erb | 4 ++-- app/views/settings/_intouch.html.erb | 4 ++-- app/views/settings_templates/edit.html.erb | 4 ++-- app/views/settings_templates/new.html.erb | 4 ++-- app/views/sidekiq_cron_jobs/edit.html.erb | 4 ++-- lib/intouch.rb | 5 ----- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eab155..052fd6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.0.1 [In progress] + +* Remove git usage in plugin code + # 1.0.0 * Upgrade redmine_telegram_common to version 0.1.0 diff --git a/app/views/projects/settings/intouch/_settings.html.erb b/app/views/projects/settings/intouch/_settings.html.erb index 198cadf..81082c7 100644 --- a/app/views/projects/settings/intouch/_settings.html.erb +++ b/app/views/projects/settings/intouch/_settings.html.erb @@ -52,6 +52,6 @@ <% content_for :header_tags do %> - <%= stylesheet_link_tag "intouch.css?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> - <%= javascript_include_tag "intouch.js?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> + <%= stylesheet_link_tag 'intouch.css', plugin: 'redmine_intouch' %> + <%= javascript_include_tag 'intouch.js', plugin: 'redmine_intouch' %> <% end %> diff --git a/app/views/settings/_intouch.html.erb b/app/views/settings/_intouch.html.erb index f20a951..f4c8cd7 100644 --- a/app/views/settings/_intouch.html.erb +++ b/app/views/settings/_intouch.html.erb @@ -24,6 +24,6 @@ <% html_title(l(:label_settings), l('intouch.label.base')) -%> <% content_for :header_tags do %> - <%= stylesheet_link_tag "intouch.css?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> - <%= javascript_include_tag "intouch.js?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> + <%= stylesheet_link_tag 'intouch.css', plugin: 'redmine_intouch' %> + <%= javascript_include_tag 'intouch.js', plugin: 'redmine_intouch' %> <% end %> diff --git a/app/views/settings_templates/edit.html.erb b/app/views/settings_templates/edit.html.erb index 2e8d2c4..d551a3c 100644 --- a/app/views/settings_templates/edit.html.erb +++ b/app/views/settings_templates/edit.html.erb @@ -17,6 +17,6 @@ <% end %> <% content_for :header_tags do %> - <%= stylesheet_link_tag "intouch.css?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> - <%= javascript_include_tag "intouch.js?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> + <%= stylesheet_link_tag 'intouch.css', plugin: 'redmine_intouch' %> + <%= javascript_include_tag 'intouch.js', plugin: 'redmine_intouch' %> <% end %> diff --git a/app/views/settings_templates/new.html.erb b/app/views/settings_templates/new.html.erb index 4d99676..ee6b992 100644 --- a/app/views/settings_templates/new.html.erb +++ b/app/views/settings_templates/new.html.erb @@ -17,6 +17,6 @@ <% end %> <% content_for :header_tags do %> - <%= stylesheet_link_tag "intouch.css?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> - <%= javascript_include_tag "intouch.js?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> + <%= stylesheet_link_tag 'intouch.css', plugin: 'redmine_intouch' %> + <%= javascript_include_tag 'intouch.js', plugin: 'redmine_intouch' %> <% end %> diff --git a/app/views/sidekiq_cron_jobs/edit.html.erb b/app/views/sidekiq_cron_jobs/edit.html.erb index f3f1553..6427cc0 100644 --- a/app/views/sidekiq_cron_jobs/edit.html.erb +++ b/app/views/sidekiq_cron_jobs/edit.html.erb @@ -23,6 +23,6 @@ <% end %> <% content_for :header_tags do %> - <%= stylesheet_link_tag "intouch.css?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> - <%= javascript_include_tag "intouch.js?#{Intouch.commit_hash}", plugin: 'redmine_intouch' %> + <%= stylesheet_link_tag 'intouch.css', plugin: 'redmine_intouch' %> + <%= javascript_include_tag 'intouch.js', plugin: 'redmine_intouch' %> <% end %> diff --git a/lib/intouch.rb b/lib/intouch.rb index a6c2e93..6b392c3 100644 --- a/lib/intouch.rb +++ b/lib/intouch.rb @@ -1,6 +1,5 @@ module Intouch AVAILABLE_PROTOCOLS = %w(telegram email) - INTOUCH_COMMIT_HASH = `cd #{Rails.root}/plugins/redmine_intouch && git rev-parse --short HEAD`.chomp def self.set_locale I18n.locale = Setting['default_language'] @@ -19,10 +18,6 @@ def self.sidekiq_cron_jobs Sidekiq::Cron::Job.all.select { |job| names.include? job.name } end - def self.commit_hash - INTOUCH_COMMIT_HASH - end - def self.active_protocols Setting.plugin_redmine_intouch['active_protocols'] || [] end From ded7eaf7f612d778324279726078ea10da9ba0ee Mon Sep 17 00:00:00 2001 From: constXife Date: Mon, 10 Jul 2017 21:58:20 +0700 Subject: [PATCH 03/16] Add condition to LiveHandlerWorker --- CHANGELOG.md | 1 + app/workers/live_handler_worker.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 052fd6c..8fcde73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 1.0.1 [In progress] * Remove git usage in plugin code +* Fix LiveHandlerWorker not found issue # 1.0.0 diff --git a/app/workers/live_handler_worker.rb b/app/workers/live_handler_worker.rb index ac53491..bb9edd0 100644 --- a/app/workers/live_handler_worker.rb +++ b/app/workers/live_handler_worker.rb @@ -2,7 +2,7 @@ class LiveHandlerWorker include Sidekiq::Worker def perform(journal_id) - journal = Journal.find(journal_id) - Intouch::Live::Handler::UpdatedIssue.new(journal).call + journal = Journal.find_by(id: journal_id) + Intouch::Live::Handler::UpdatedIssue.new(journal).call if journal end -end \ No newline at end of file +end From 0c774c87e58951b7ac9894b4cc918644a4c683a0 Mon Sep 17 00:00:00 2001 From: constXife Date: Fri, 14 Jul 2017 00:15:19 +0700 Subject: [PATCH 04/16] Fix mail from --- CHANGELOG.md | 1 + app/models/intouch_mailer.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fcde73..b45c139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Remove git usage in plugin code * Fix LiveHandlerWorker not found issue +* Fix mail from field # 1.0.0 diff --git a/app/models/intouch_mailer.rb b/app/models/intouch_mailer.rb index bb08098..6bf5f25 100644 --- a/app/models/intouch_mailer.rb +++ b/app/models/intouch_mailer.rb @@ -6,7 +6,7 @@ class IntouchMailer < ActionMailer::Base include Redmine::I18n - default from: "#{Setting.app_title} <#{Setting.mail_from}>" + default from: Setting.mail_from def self.default_url_options Mailer.default_url_options From eb77af2a339eaaac0ade43427883cff710602150 Mon Sep 17 00:00:00 2001 From: constXife Date: Mon, 31 Jul 2017 03:21:21 +0700 Subject: [PATCH 05/16] Add require telegram bot. --- init.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/init.rb b/init.rb index 9ef086c..ca5e192 100644 --- a/init.rb +++ b/init.rb @@ -1,6 +1,7 @@ FileUtils.mkdir_p(Rails.root.join('log/intouch')) unless Dir.exist?(Rails.root.join('log/intouch')) require 'intouch' +require 'telegram/bot' ActionDispatch::Callbacks.to_prepare do paths = '/lib/intouch/{patches/*_patch,hooks/*_hook}.rb' From 30390755684dcc3d7fce2c8cca811c55efd83db6 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 15:14:39 +0700 Subject: [PATCH 06/16] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45c139..994630e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 1.0.1 [In progress] +* Fix uninitialized constant TelegramMessageSender::Telegram * Remove git usage in plugin code * Fix LiveHandlerWorker not found issue * Fix mail from field From 22d297f973e1c5eee8f785abb6499c11ecd9ed6f Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 15:15:12 +0700 Subject: [PATCH 07/16] Release 1.0.1 --- CHANGELOG.md | 2 +- init.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 994630e..1710bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.0.1 [In progress] +# 1.0.1 * Fix uninitialized constant TelegramMessageSender::Telegram * Remove git usage in plugin code diff --git a/init.rb b/init.rb index ca5e192..d6ea233 100644 --- a/init.rb +++ b/init.rb @@ -14,7 +14,7 @@ name 'Redmine Intouch plugin' url 'https://github.com/centosadmin/redmine_intouch' description 'This is a plugin for Redmine which sends a reminder email and Telegram messages to the assignee workign on a task, whose status is not updated with-in allowed duration' - version '1.0.1-dev' + version '1.0.1' author 'Southbridge' author_url 'https://github.com/centosadmin' From 31b882883bd39f98a92b38c0cac7a3c66b8b199a Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 16:45:14 +0700 Subject: [PATCH 08/16] Fix to_prepare to Rails 5.1/4 --- init.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.rb b/init.rb index d6ea233..1ae916b 100644 --- a/init.rb +++ b/init.rb @@ -3,7 +3,9 @@ require 'intouch' require 'telegram/bot' -ActionDispatch::Callbacks.to_prepare do +# Rails 5.1/Rails 4 +reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader +reloader.to_prepare do paths = '/lib/intouch/{patches/*_patch,hooks/*_hook}.rb' Dir.glob(File.dirname(__FILE__) + paths).each do |file| require_dependency file From 9d8afbfb4a192a5909c77c2bbb25589cefbaae31 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 17:03:11 +0700 Subject: [PATCH 09/16] Fix to_prepare --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 1ae916b..10cbe28 100644 --- a/init.rb +++ b/init.rb @@ -4,7 +4,7 @@ require 'telegram/bot' # Rails 5.1/Rails 4 -reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader +reloader = ActionDispatch::Reloader.respond_to?(:to_prepare) ? ActiveSupport::Reloader : ActionDispatch::Reloader reloader.to_prepare do paths = '/lib/intouch/{patches/*_patch,hooks/*_hook}.rb' Dir.glob(File.dirname(__FILE__) + paths).each do |file| From a9d8f53c242843e330b5e6e24153347a866a2d63 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 17:08:21 +0700 Subject: [PATCH 10/16] Fix to_prepare --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 10cbe28..e2a8243 100644 --- a/init.rb +++ b/init.rb @@ -4,7 +4,7 @@ require 'telegram/bot' # Rails 5.1/Rails 4 -reloader = ActionDispatch::Reloader.respond_to?(:to_prepare) ? ActiveSupport::Reloader : ActionDispatch::Reloader +reloader = ActionDispatch::Reloader.respond_to?(:to_prepare) ? ActionDispatch::Reloader : ActiveSupport::Reloader reloader.to_prepare do paths = '/lib/intouch/{patches/*_patch,hooks/*_hook}.rb' Dir.glob(File.dirname(__FILE__) + paths).each do |file| From 51cbe0fe9b553bace2520511bd4168a116a4f965 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 17:16:25 +0700 Subject: [PATCH 11/16] Add rails 5.1 support --- CHANGELOG.md | 1 + init.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1710bd6..fd958e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 1.0.1 +* Add Rails 5.1 support * Fix uninitialized constant TelegramMessageSender::Telegram * Remove git usage in plugin code * Fix LiveHandlerWorker not found issue diff --git a/init.rb b/init.rb index e2a8243..1ae916b 100644 --- a/init.rb +++ b/init.rb @@ -4,7 +4,7 @@ require 'telegram/bot' # Rails 5.1/Rails 4 -reloader = ActionDispatch::Reloader.respond_to?(:to_prepare) ? ActionDispatch::Reloader : ActiveSupport::Reloader +reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader reloader.to_prepare do paths = '/lib/intouch/{patches/*_patch,hooks/*_hook}.rb' Dir.glob(File.dirname(__FILE__) + paths).each do |file| From 0f7b896e63a8211aea3730527628d92078a40746 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 17:56:57 +0700 Subject: [PATCH 12/16] Test only 3.3 and 3.4 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c479345..77534c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ addons: env: - REDMINE_VER=3.3-stable - - REDMINE_VER=master + - REDMINE_VER=3.4-stable install: "echo skip bundle install" From 50508b309dbad7afec91f4ce6a19a67f6f08fb8f Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 18:07:36 +0700 Subject: [PATCH 13/16] Update badges --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9609b5..3cb884f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ +# redmine_intouch + [![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch) [Русская версия](README-RU.md) -# redmine_intouch +master: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=master)](https://travis-ci.org/centosadmin/redmine_intouch) +develop: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=develop)](https://travis-ci.org/centosadmin/redmine_intouch) Plugin is designed to send notifications to Redmine’s users by Telegram or E-mail. From 9242849b70413d8cb05f9994199671915e113f9c Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 18:08:35 +0700 Subject: [PATCH 14/16] Update readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3cb884f..dbdb638 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ +[Русская версия](README-RU.md) + # redmine_intouch [![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch) -[Русская версия](README-RU.md) - master: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=master)](https://travis-ci.org/centosadmin/redmine_intouch) + develop: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=develop)](https://travis-ci.org/centosadmin/redmine_intouch) Plugin is designed to send notifications to Redmine’s users by Telegram or E-mail. From e9886e032f3758825f1f36772acb2d1f38316c0c Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 18:09:22 +0700 Subject: [PATCH 15/16] Update readme --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index dbdb638..add8abc 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,7 @@ # redmine_intouch [![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch) - -master: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=master)](https://travis-ci.org/centosadmin/redmine_intouch) - -develop: [![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=develop)](https://travis-ci.org/centosadmin/redmine_intouch) +[![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=master)](https://travis-ci.org/centosadmin/redmine_intouch) Plugin is designed to send notifications to Redmine’s users by Telegram or E-mail. From 79e3f9f42dd1a7a9f2d2fd5afb39bc364b002c00 Mon Sep 17 00:00:00 2001 From: constXife Date: Tue, 1 Aug 2017 18:19:53 +0700 Subject: [PATCH 16/16] Update ru readme --- README-RU.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README-RU.md b/README-RU.md index 62a4cc9..3cdf134 100644 --- a/README-RU.md +++ b/README-RU.md @@ -1,9 +1,10 @@ -[![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch) - [English version](README.md) # redmine_intouch +[![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch) +[![Build Status](https://travis-ci.org/centosadmin/redmine_intouch.svg?branch=master)](https://travis-ci.org/centosadmin/redmine_intouch) + Плагин предназначен для рассылки уведомлений пользователям Redmine через Telegram или E-mail. Пожалуйста, помогите нам сделать этот плагин лучше, сообщая во вкладке [Issues](https://github.com/centosadmin/redmine_intouch/issues) обо всех проблемах, с которыми Вы столкнётесь при его использовании. Мы готовы ответить на Все ваши вопросы, касающиеся этого плагина.