omah 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/omah.rb +24 -8
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: afdf96b9edfb22cf13f44492cd81a25657710f18
|
4
|
+
data.tar.gz: 2488fb391bf83d80757a068df71b8159dd84f19f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9197e8ccb21e69da86e47f0024931e83b30ebcb5b18c7faf0ae4933096ff1cc0de6275b52a97337653cb08535f07969e53b92b837388274af50c98a857ad6d5c
|
7
|
+
data.tar.gz: 3a13e4f3740d838f90afab6d8dd3a4e6df8defb5fa6ff10780f6108bdbc28ca981a99aaf812fcc28fecb781ce158327f001bed7d6a3d52ab32b1ee0a15cc6018
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/omah.rb
CHANGED
@@ -22,14 +22,14 @@ class Omah
|
|
22
22
|
|
23
23
|
include Library
|
24
24
|
|
25
|
-
def initialize(options
|
25
|
+
def initialize(user: 'user', filepath: '.', options: {xslt: 'listing.xsl'}, plugins: [] )
|
26
26
|
|
27
|
-
|
28
|
-
@
|
29
|
-
@
|
27
|
+
@user = user
|
28
|
+
@xslt = options[:xslt]
|
29
|
+
@variables ||= {}
|
30
30
|
|
31
31
|
FileUtils.mkdir_p @user # attempt to mkdir regardless if it already exists
|
32
|
-
Dir.chdir @user
|
32
|
+
Dir.chdir File.join(filepath, @user)
|
33
33
|
|
34
34
|
dailyfile = 'dynarexdaily.xml'
|
35
35
|
|
@@ -40,6 +40,20 @@ class Omah
|
|
40
40
|
end
|
41
41
|
|
42
42
|
@dd = DynarexDaily.new x, options: {dir_archive: :yearly}
|
43
|
+
|
44
|
+
|
45
|
+
# intialize plugins
|
46
|
+
|
47
|
+
@plugins = plugins.inject([]) do |r, plugin|
|
48
|
+
|
49
|
+
name, settings = plugin
|
50
|
+
return r if settings[:active] == false and !settings[:active]
|
51
|
+
|
52
|
+
klass_name = 'OmahPlugin' + name.to_s.split(/[-_]/).map{|x| x.capitalize}.join
|
53
|
+
|
54
|
+
r << Kernel.const_get(klass_name).new(settings: settings, variables: @variables)
|
55
|
+
|
56
|
+
end
|
43
57
|
|
44
58
|
end
|
45
59
|
|
@@ -116,8 +130,7 @@ class Omah
|
|
116
130
|
@dd.create msg.merge(txt_filepath: txt_filepath, \
|
117
131
|
html_filepath: html_filepath, attachment1: parts_path[0], \
|
118
132
|
attachment2: parts_path[1], attachment3: parts_path[2])
|
119
|
-
|
120
|
-
|
133
|
+
|
121
134
|
end
|
122
135
|
|
123
136
|
if @xslt then
|
@@ -141,7 +154,9 @@ class Omah
|
|
141
154
|
|
142
155
|
end
|
143
156
|
|
144
|
-
|
157
|
+
@plugins.each{|x| x.on_newmail(messages, doc) }
|
158
|
+
File.write 'dynarexdaily.xml', doc.xml(pretty: true)
|
159
|
+
|
145
160
|
end
|
146
161
|
|
147
162
|
private
|
@@ -176,6 +191,7 @@ class Omah
|
|
176
191
|
=end
|
177
192
|
s
|
178
193
|
end
|
194
|
+
|
179
195
|
|
180
196
|
def text_sanitiser(s)
|
181
197
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|