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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f6cba23afa87e81b13125c2abcbb76014a89c4f
4
- data.tar.gz: 81c6a70ec299eecd750b1e6f9a1f2d783ea99456
3
+ metadata.gz: b3c80ae1a706e3126a6bf41e70f1eba07168b610
4
+ data.tar.gz: 08bb8098af80655f401b0268ffff56d391ceae5a
5
5
  SHA512:
6
- metadata.gz: 1b1e2656126225c538f01031448bbfbd8c5da6ab0464224a9e7734273bf717a8545d626657181aed3a0834adc375505d60b5a3305bb459fb6a1da5227f81effa
7
- data.tar.gz: f85eac32959a209151c96fbc7d2fa670e4e16a52d7d7be74799a08272b200088540742ad5dd13806426e77427fde3d87e1df2317a11ddb7b2c1c26404160370e
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
- =،-Fs���j��!��'��H%��F3��re�Sn��M���!(#w�!@�������4��&�� �+�� &If��?9���<è>w}�8-�����‚(�;ho: ��k��32��ce)��꛺ڿAs�������e���j��J����w�m4y��O��C���?�u<đ���g�����eD���*�)L��`���hF|A��M�9��3�Z3����J��g5�3)��[�Ʒo��V
1
+ X�2D��
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
- Mail.defaults { retriever_method :pop3, @mail }
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
- if @sps then
64
-
65
- m = 'message'
66
- m += 's' if messages.length > 1
67
- @sps.notice "email/new/%s: received %s new %s" \
68
- % [@mail[:user_name], messages.length, m]
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.0
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-23 00:00:00.000000000 Z
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: classic_omah
126
+ summary: Mail gem + Omah (Offline Mail Helper) gem
127
127
  test_files: []
metadata.gz.sig CHANGED
Binary file