mymedia 0.2.12 → 0.2.13

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: eda745c33db809e75fe3b0c75ed68144c8145f2c
4
- data.tar.gz: 8ffc030303f9ab3fda4e994e26be7e9aafbe24b8
3
+ metadata.gz: f2b6caefba096cabac5be086c6a97bde789b8375
4
+ data.tar.gz: 4ca9a5d2bc3cc8a927d47067524a3deb2c18f8d8
5
5
  SHA512:
6
- metadata.gz: a20ee8b2a1ed81b70ad28008359d91295d8cbb8663383c8999ea39f2631095837360fa7b7348f3322e9afc4eacb71b7d95e3b06474721d1801a75442e4c85bd3
7
- data.tar.gz: 0ae3477cee518bce722b535e5f0021d266204a9f23ec6f21599672cac94cc0bbbed84351c5cd21b13ef2afc54168cf1d004b20b2a3adf8f28ccc558fa7ca420e
6
+ metadata.gz: d6db9f9f3d95bbc5029ca3e300ab41afe04a1de77c56e1fb423c15c46c63f286207aabdf39463da490a25f166d3d5d24edce09f692d3deff37c71f4a644fbd23
7
+ data.tar.gz: 21ec5e6174f987e02c40f2e51d795616816a49c41434e4246f38ffd249a030b0cc9bb376319fcfd0ea2ea881c4a661efb0f3e98d370e042d49f15e700195b801
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/mymedia.rb CHANGED
@@ -30,7 +30,7 @@ module MyMedia
30
30
 
31
31
  def publish_dynarex(dynarex_filepath='', \
32
32
  record={title: '',url: '', raw_url: ''}, options={})
33
-
33
+
34
34
  opt = {id: nil, rss: false}.merge(options)
35
35
 
36
36
  dynarex = if File.exists? dynarex_filepath then
@@ -41,12 +41,11 @@ module MyMedia
41
41
 
42
42
  dynarex.create record, id: opt[:id]
43
43
  dynarex.save dynarex_filepath
44
-
45
44
  publish_html(dynarex_filepath) if @index_page == true
46
45
 
47
46
 
48
47
  if opt[:rss] == true then
49
-
48
+
50
49
  dynarex.xslt_schema = dynarex.summary[:xslt_schema]
51
50
  rss_filepath = dynarex_filepath.sub(/\.xml$/,'_rss.xml')
52
51
  File.open(rss_filepath, 'w'){|f| f.write dynarex.to_rss }
@@ -63,15 +62,19 @@ module MyMedia
63
62
  raise MyMediaPublisherException, \
64
63
  "template path: #{template_path} not found" unless \
65
64
  File.exists?(template_path)
65
+ =begin jr 040916
66
66
  dataisland = DataIsland.new(template_path, @opts)
67
67
 
68
68
  File.open(path2 + '/index.html','w'){|f| f.write dataisland.html_doc.xml pretty: true}
69
+ =end
69
70
  end
70
71
 
71
72
  def send_message(topic: @sps[:default_subscriber], msg: '')
72
-
73
+
73
74
  fqm = "%s: %s" % [topic, msg]
75
+
74
76
  SPSPub.notice fqm, address: @sps[:address]
77
+ sleep 0.02
75
78
  end
76
79
 
77
80
  end
@@ -84,7 +87,7 @@ module MyMedia
84
87
  attr_reader :to_s
85
88
 
86
89
  def initialize(media_type: 'blog', public_type: 'blog', ext: 'txt', config: nil)
87
-
90
+
88
91
  super()
89
92
 
90
93
  @schema = 'posts/post(title, url, raw_url)'
@@ -104,8 +107,9 @@ module MyMedia
104
107
  logfile = c[:log]
105
108
 
106
109
  @logger = nil
107
- @logger = Logger.new(logfile,'daily') if logfile
108
- @logger.info('inside MyMedia::Base') if @logger
110
+
111
+ #@logger = Logger.new(logfile,'daily') if logfile
112
+ #@logger.info('inside MyMedia::Base') if @logger
109
113
 
110
114
  @media_type = media_type
111
115
  @public_type = public_type ||= @media_type
@@ -133,14 +137,14 @@ module MyMedia
133
137
 
134
138
  def auto_copy_publish(raw_msg='')
135
139
 
136
- #filename = DirToXML.new(@media_src).select_by_ext(@ext)\
137
- # .sort_by(:last_modified).last[:name]
138
140
  dir = DirToXML.new(@media_src, recursive: true)
141
+
139
142
  r = dir.last_modified
140
-
143
+
141
144
  filename = r.is_a?(Hash) ? r[:name] : File.join(r.map {|x| x[:name]})
142
145
 
143
146
  copy_publish( filename ,raw_msg)
147
+
144
148
  end
145
149
 
146
150
  def basename(s1, s2)
@@ -158,7 +162,7 @@ module MyMedia
158
162
 
159
163
  def file_publish(src_path, raw_msg='')
160
164
 
161
- raise @logger.debug("source file '%s' not found" % src_path) unless File.exists? src_path
165
+ #raise @logger.debug("source file '%s' not found" % src_path) unless File.exists? src_path
162
166
  ext = File.extname(src_path)
163
167
  @target_ext ||= ext
164
168
 
@@ -184,7 +188,7 @@ module MyMedia
184
188
  raw_msg = raw_msg.join ' ' if raw_msg.is_a? Array
185
189
 
186
190
  raw_msg = src_path[/([^\/]+)\.\w+$/,1] + ' ' + raw_msg if raw_msg[/^#/]
187
-
191
+
188
192
 
189
193
  if block_given? then
190
194
  raw_msg, target_url = yield(destination, raw_destination)
@@ -193,19 +197,16 @@ module MyMedia
193
197
  FileUtils.cp src_path, destination
194
198
  FileUtils.cp src_path, raw_destination
195
199
  end
196
-
197
200
 
198
201
  raw_msg = raw_msg.join if raw_msg.is_a? Array
199
-
200
- static_filename = if raw_msg.length > 0 then
202
+
203
+ static_filename = if raw_msg.to_s.length > 0 then
201
204
  normalize(raw_msg) + File.extname(destination)
202
205
  else
203
206
 
204
207
  basename(@media_src, src_path)
205
208
 
206
- end
207
-
208
-
209
+ end
209
210
 
210
211
  static_path = "%s/%s/%s" % [@public_type, \
211
212
  Time.now.strftime('%Y/%b/%d').downcase, static_filename]
@@ -215,8 +216,9 @@ module MyMedia
215
216
  static_destination = "%s/%s" % [@home, static_path]
216
217
 
217
218
  #FileUtils.mkdir_p File.dirname(static_destination)
218
- FileUtils.cp destination, static_destination
219
- FileUtils.cp raw_destination, raw_static_destination
219
+ FileUtils.cp destination, static_destination
220
+
221
+ #jr010817 FileUtils.cp raw_destination, raw_static_destination
220
222
 
221
223
  # Make a static filename XML file copy?
222
224
  if File.extname(static_destination) == '.html' then
@@ -232,7 +234,7 @@ module MyMedia
232
234
  target_url ||= "%s/%s" % [@website, public_path]
233
235
  static_url ||= "%s/%s" % [@website, static_path]
234
236
 
235
- if raw_msg.length > 0 then
237
+ if raw_msg.to_s.length > 0 then
236
238
  msg = "%s %s" % [target_url, raw_msg ]
237
239
  else
238
240
  msg = "the %s %s %s" % [notice, @public_type.sub(/s$/,''), target_url]
@@ -313,7 +315,8 @@ module MyMedia
313
315
 
314
316
  dynarex_filepath = "%s/%s/dynarex.xml" % [@home, @public_type]
315
317
  raw_dynarex_filepath = "%s/r/%s/dynarex.xml" % [@home, @public_type]
316
-
318
+
319
+
317
320
  publish_dynarex(dynarex_filepath, record, {rss: @rss || false})
318
321
  publish_dynarex(raw_dynarex_filepath, record, {rss: @rss || false})
319
322
 
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.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  QGupEiSvhduKe7yJhCMhsjS3Y0bQLzHoYkgODDXj3b5FZM187Odi2YacSwL64ush
32
32
  uwWZRkjawruhkg==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-09-04 00:00:00.000000000 Z
34
+ date: 2017-08-01 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex
@@ -154,7 +154,7 @@ dependencies:
154
154
  - !ruby/object:Gem::Version
155
155
  version: 0.2.1
156
156
  description:
157
- email: james@r0bertson.co.uk
157
+ email: james@jamesrobertson.eu
158
158
  executables: []
159
159
  extensions: []
160
160
  extra_rdoc_files: []
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project:
183
- rubygems_version: 2.5.1
183
+ rubygems_version: 2.6.8
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: Makes publishing to the web easier
metadata.gz.sig CHANGED
Binary file