mymedia 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 181a0859c00cf3841fd5a0d43a9e0ec4e6ab88e5
4
- data.tar.gz: c3528e7c17ec0172e4ef127325cf6688a8808255
3
+ metadata.gz: d19a4f59dd9034344237d9d34ea2796a94ab11f9
4
+ data.tar.gz: 3ca557e9e150dbdf4c9d077e6f520e665bf7f4ef
5
5
  SHA512:
6
- metadata.gz: 624e69f14868bd1663e11f0882d30a70393cd1f63c7b92cf23207090c69f834e58477c56d307f1dccf2e6df89bf25ffe1c9d0d2d8bd9d761ebe2e27171a24ffb
7
- data.tar.gz: ba2d25df22247f2df59918996a73850325efc6d0fb0a6ba1ba97ffc0edb10b5894db7bbc155cf21b16416b3f7c7f21c9fda4684c18bb4a7251a26b7bb9d16bd6
6
+ metadata.gz: d121a85694dc586bfeb8e8c08b0323bfcde36784dbb98878dc9c4ce115e4c33d8d795ad71492a2668943739e8201f77670b3c1aba0e8e10c329061ca1e0b7af0
7
+ data.tar.gz: a0b1c7538d90b7f05115c5ef9913be10a3ff3534f587003ab9a1100e6d2a1b8e3b0bc5bf4cdef3267fb68141783333d451696caafb447099351e0b8c1604a98c
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/mymedia.rb CHANGED
@@ -14,6 +14,10 @@ require 'simple-config'
14
14
 
15
15
 
16
16
  module MyMedia
17
+
18
+ class MyMediaPublisherException < Exception
19
+ end
20
+
17
21
 
18
22
  class Publisher
19
23
 
@@ -49,11 +53,13 @@ module MyMedia
49
53
 
50
54
  def publish_html(filepath)
51
55
 
52
-
53
56
  path2 = File.dirname(filepath)
54
57
  template_path = File.join path2, 'index-template.html'
55
- return unless @index_page == true and File.exists?(template_path)
56
58
 
59
+ return unless @index_page == true
60
+ raise MyMediaPublisherException, \
61
+ "template path: #{template_path} not found" unless \
62
+ File.exists?(template_path)
57
63
  dataisland = DataIsland.new(template_path)
58
64
  File.open(path2 + '/index.html','w'){|f| f.write dataisland.html_doc.xml pretty: true}
59
65
  end
@@ -245,13 +251,16 @@ module MyMedia
245
251
  c = SimpleConfig.new(config).to_h
246
252
 
247
253
  @home = c[:home]
254
+ @index_page = c[:index_page] == 'true'
248
255
  @public_type = public_type
249
256
  @rss = rss
250
257
 
258
+
251
259
  @logger = Logger.new('/tmp/mymedia.log','daily')
252
260
  end
253
261
 
254
262
  def publish_frontpage(s='index.html')
263
+
255
264
  publish_html(@home + '/' + s)
256
265
  'frontpage published'
257
266
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mymedia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  AuNecS7mQYhxSVKaAH8VGzIiea4rbybYlYRsOllgAkcmCFTQW39mbtmMPtDedk1N
32
32
  ZQNJr93cq0mf/Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-01-01 00:00:00.000000000 Z
34
+ date: 2015-01-05 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex
metadata.gz.sig CHANGED
Binary file