gitlab-mail-receiver 0.0.4 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/gitlab-mail-receiver.rb +4 -1
- data/lib/mail-receiver/body_parser.rb +6 -13
- data/lib/mail-receiver/reply_to.rb +4 -0
- data/lib/mail-receiver/version.rb +1 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5feff9f3eb9d17463c81e009831299793eaac57
|
4
|
+
data.tar.gz: 67f84701048b70b30a99a03b2fde6947beec0e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1598df2b81255591d59a53f45a6ce9e7aed690fb531584db516ae1ff8cbb468e18c002b8073726228816d81cb38b0df13e6b94571c91903075527d775d60a357
|
7
|
+
data.tar.gz: 1666262aafe8ffa5afb0a6e753749835d832d419152475cf54c73e2871562d793df701c2056a2fc717fb7700d0fcb4114327c63365e64afe8002ad4f16940a1f
|
data/README.md
CHANGED
@@ -6,6 +6,10 @@ The way of allow your GitLab support Email receive and parse the email content,
|
|
6
6
|
|
7
7
|
[中文介绍](https://ruby-china.org/topics/27143)
|
8
8
|
|
9
|
+
------------
|
10
|
+
|
11
|
+
> PS: After my created this gem, GitLab have released 8.0, and it included same feature. So you don't need this.
|
12
|
+
|
9
13
|
## Features
|
10
14
|
|
11
15
|
- Receive Email reply to check Issue/MergeRequest and create comment.
|
data/lib/gitlab-mail-receiver.rb
CHANGED
@@ -3,9 +3,11 @@ require_relative './mail-receiver/body_parser'
|
|
3
3
|
require_relative './mail-receiver/receiver'
|
4
4
|
require_relative './mail-receiver/reply_to'
|
5
5
|
|
6
|
-
require
|
6
|
+
require 'mailman'
|
7
|
+
require 'email_reply_parser'
|
7
8
|
require 'active_support/core_ext'
|
8
9
|
|
10
|
+
# Extend Mailman config to add sender attribute
|
9
11
|
module MailmanConfig
|
10
12
|
extend ActiveSupport::Concern
|
11
13
|
|
@@ -16,6 +18,7 @@ end
|
|
16
18
|
|
17
19
|
Mailman::Configuration.send(:include, MailmanConfig)
|
18
20
|
|
21
|
+
# MailReceiver
|
19
22
|
module MailReceiver
|
20
23
|
def self.config
|
21
24
|
Mailman.config
|
@@ -1,22 +1,15 @@
|
|
1
|
-
# Mail body context parser
|
2
1
|
module MailReceiver
|
2
|
+
# Mail body context parser
|
3
3
|
module BodyParser
|
4
4
|
def extract
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
chomp.
|
10
|
-
# Strip leading and trailing whitespace
|
11
|
-
strip.force_encoding('utf-8')
|
12
|
-
end
|
13
|
-
|
14
|
-
def decoded_part
|
15
|
-
self.part.decoded
|
5
|
+
EmailReplyParser.read(part.to_s)
|
6
|
+
.fragments.map(&:to_s)
|
7
|
+
.join("\n").rstrip
|
8
|
+
.force_encoding('utf-8')
|
16
9
|
end
|
17
10
|
|
18
11
|
def part
|
19
|
-
|
12
|
+
mail.multipart? ? mail.parts.first.body : mail.body
|
20
13
|
end
|
21
14
|
end
|
22
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-mail-receiver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mailman
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.17.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: email_reply_parser
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.5.8
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.5.8
|
69
83
|
description: The way of allow your GitLab support Email receive and parse the email
|
70
84
|
content, and find Issue/MergeRequest to create reply.
|
71
85
|
email:
|
@@ -106,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
120
|
version: 1.3.6
|
107
121
|
requirements: []
|
108
122
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.4.
|
123
|
+
rubygems_version: 2.4.8
|
110
124
|
signing_key:
|
111
125
|
specification_version: 4
|
112
126
|
summary: Allow your GitLab receive mails to create Issue comment
|
113
127
|
test_files: []
|
114
|
-
has_rdoc:
|