Skip to content

Commit

Permalink
Merge pull request #56 from centosadmin/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
constXife authored Aug 1, 2017
2 parents 1a4f6ad + 79e3f9f commit c9cfebd
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ addons:

env:
- REDMINE_VER=3.3-stable
- REDMINE_VER=master
- REDMINE_VER=3.4-stable

install: "echo skip bundle install"

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.0.1

* Add Rails 5.1 support
* Fix uninitialized constant TelegramMessageSender::Telegram
* Remove git usage in plugin code
* Fix LiveHandlerWorker not found issue
* Fix mail from field

# 1.0.0

* Upgrade redmine_telegram_common to version 0.1.0
Expand Down
5 changes: 3 additions & 2 deletions README-RU.md
Original file line number Diff line number Diff line change
@@ -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) обо всех проблемах, с которыми Вы столкнётесь при его использовании. Мы готовы ответить на Все ваши вопросы, касающиеся этого плагина.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[![Code Climate](https://codeclimate.com/github/centosadmin/redmine_intouch/badges/gpa.svg)](https://codeclimate.com/github/centosadmin/redmine_intouch)

[Русская версия](README-RU.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)

Plugin is designed to send notifications to Redmine’s users by Telegram or E-mail.

Please help us make this plugin better telling us of any [issues](https://github.com/centosadmin/redmine_intouch/issues) you'll face using it. We are ready to answer all your questions regarding this plugin.
Expand Down
2 changes: 1 addition & 1 deletion app/models/intouch_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/views/projects/settings/intouch/_settings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
4 changes: 2 additions & 2 deletions app/views/settings/_intouch.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
4 changes: 2 additions & 2 deletions app/views/settings_templates/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
4 changes: 2 additions & 2 deletions app/views/settings_templates/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
4 changes: 2 additions & 2 deletions app/views/sidekiq_cron_jobs/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
6 changes: 3 additions & 3 deletions app/workers/live_handler_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
end
7 changes: 5 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
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
# 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
Expand All @@ -13,7 +16,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'
author 'Southbridge'
author_url 'https://github.com/centosadmin'

Expand Down
5 changes: 0 additions & 5 deletions lib/intouch.rb
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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
Expand Down

0 comments on commit c9cfebd

Please sign in to comment.