classic_omah 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +4 -1
- data/lib/classic_omah.rb +16 -11
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3c80ae1a706e3126a6bf41e70f1eba07168b610
|
4
|
+
data.tar.gz: 08bb8098af80655f401b0268ffff56d391ceae5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d402c01ea9fff984fda2384438c9fa058c5d72693f26484e28f919ef77eae6d640d32040e7be9fff89afe981d2f70cbda4918c2a5a873147ae5bd41f719edb2
|
7
|
+
data.tar.gz: 69bc243ff93c2f6a940a23086f12e185d92b34489eb333045a5d77f513fb4ff305a60c1314c51964c87d48ae4f03171872d0b2ad403ceed2150fc0172fdc6de2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
X�2�D��
|
2
|
+
_%����g�3:��6�VL�$���8�)��'PH5Ih�� �b[��x+{3�����ҙ�-x���0]� �d���!nc@�#-��[��˖�Q�Wg�rR#lɸx5�=���lQ��ia��r�X �D���Z$���S�.QȩED�A5�����E���A���̟��
|
3
|
+
�8��� �=��ܤA���Hf�o��9�:��
|
4
|
+
^�£`�^_:��%k�B��(P%j�+�шt�V��@��"��h
|
data/lib/classic_omah.rb
CHANGED
@@ -8,9 +8,10 @@ require 'sps-pub'
|
|
8
8
|
|
9
9
|
class ClassicOmah
|
10
10
|
|
11
|
-
def initialize(user: 'user', filepath: '.', mail: {}, sps: {})
|
11
|
+
def initialize(user: 'user', filepath: '.', mail: {}, sps: {}, email_address: nil)
|
12
|
+
|
13
|
+
@user = user
|
12
14
|
|
13
|
-
@user = user
|
14
15
|
@mail = { address: '',
|
15
16
|
port: 110,
|
16
17
|
user_name: '',
|
@@ -21,14 +22,17 @@ class ClassicOmah
|
|
21
22
|
return "ClassicOmah: missing %s" % field if field
|
22
23
|
|
23
24
|
@sps = SPSPub.new(address: sps[:address], port: sps[:port]) if sps
|
25
|
+
@email_address = email_address ? email_address : \
|
26
|
+
@mail[:user_name] + '@' + @mail[:address].split('.')[1..-1].join('.')
|
24
27
|
|
25
28
|
Dir.chdir filepath
|
26
29
|
|
27
30
|
end
|
28
31
|
|
29
32
|
def fetch_email()
|
30
|
-
|
31
|
-
|
33
|
+
|
34
|
+
mail = @mail
|
35
|
+
Mail.defaults { retriever_method(:pop3, mail) }
|
32
36
|
|
33
37
|
email = Mail.all
|
34
38
|
return 'no new messages' unless email.any?
|
@@ -60,14 +64,15 @@ class ClassicOmah
|
|
60
64
|
# messages are stored to the file dynarexdaily.xml
|
61
65
|
o.store messages
|
62
66
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
67
|
+
m = 'message'
|
68
|
+
m += 's' if messages.length > 1
|
69
|
+
fqm = "email/new: %s received %s new %s" \
|
70
|
+
% [@email_address, messages.length, m]
|
71
|
+
|
72
|
+
@sps.notice fqm if @sps
|
70
73
|
|
71
74
|
Mail.delete_all
|
75
|
+
|
76
|
+
fqm
|
72
77
|
end
|
73
78
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classic_omah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
ec/o5SQ4bMXwc9ifCfznclsHqFNg5+AV+ouKowZ+9UzxZmMdRDrfIxEgij7oXLH9
|
32
32
|
E8HCtMzl8FkVLw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-05-
|
34
|
+
date: 2015-05-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: omah
|
@@ -123,5 +123,5 @@ rubyforge_project:
|
|
123
123
|
rubygems_version: 2.4.6
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
|
-
summary:
|
126
|
+
summary: Mail gem + Omah (Offline Mail Helper) gem
|
127
127
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|