mymedia-kvx 0.2.6 → 0.3.0

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: ebae74096330ea5c94b066056721c567d25fa5e9
4
- data.tar.gz: 4b1daafd9083fa46a7738848152e4234e8d94ea2
3
+ metadata.gz: aedbe343d2c05a3d81f0fcf921a4505cfc95696c
4
+ data.tar.gz: 62b64d6b69cd8512a908bb7a9d6e9803e734e928
5
5
  SHA512:
6
- metadata.gz: d134e9edd58fbea8313aa4b863d490b462abacd4b8f81fd799a5a2d896414995d28207c852404cedbc4f8beb30ef3b54e2aa8af2c90be0e5729a3aeb5b52dab1
7
- data.tar.gz: 40c20798b9f638ee36c77c25e7760667e197b4ccd64beca29879cab152329d500573df14240d6ddae5d9c4a13b5c18422caed2721c1542a0accd9642ce1e83cf
6
+ metadata.gz: da2a4559a859a48f84fa7095cae62f9e2bec00e6cb3331b8e42160c4c9366462826745ada7382df9fdd96d10a44097f1bfa5af67d8590bf81a5a66f9855f68a2
7
+ data.tar.gz: e1f6880d1f3d3d92afb6088914d7a8e30a7c3eb45f2df85b409059eeb5cf692453ceec939bd99522ecfe77b02dddbb82cc15ed6ebb89eba29ac751216cba8bf3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/mymedia-kvx.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # file: mymedia-kvx.rb
4
4
 
5
5
  require 'mymedia'
6
+ require 'martile'
6
7
 
7
8
 
8
9
  class MyMediaKvx < MyMedia::Base
@@ -13,8 +14,10 @@ class MyMediaKvx < MyMedia::Base
13
14
  config: nil, ext: '.txt', xsl: nil)
14
15
 
15
16
  @public_type = public_type
17
+
16
18
  super(media_type: media_type, public_type: public_type, config: config)
17
19
 
20
+
18
21
  @media_src = "%s/media/%s" % [@home, public_type]
19
22
  @prefix = 'k'
20
23
  @target_ext = '.html'
@@ -41,7 +44,7 @@ class MyMediaKvx < MyMedia::Base
41
44
  if not raw_msg or raw_msg.empty? then
42
45
  raw_msg = File.basename(src_path) + " updated: " + Time.now.to_s
43
46
  end
44
-
47
+
45
48
  if File.extname(src_path) == '.txt' then
46
49
 
47
50
  kvx, raw_msg = copy_edit(src_path, dest_xml)
@@ -62,8 +65,10 @@ class MyMediaKvx < MyMedia::Base
62
65
 
63
66
  # transform the XML to an HTML file
64
67
 
65
- File.write raw_destination, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
66
- File.write destination, xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
68
+ File.write raw_destination, \
69
+ xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
70
+ File.write destination, \
71
+ xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
67
72
 
68
73
  if not File.basename(src_path)[/#{@prefix}\d{6}T\d{4}\.txt/] then
69
74
 
@@ -71,7 +76,8 @@ class MyMediaKvx < MyMedia::Base
71
76
  FileUtils.cp destination, @home + "/#{@public_type}/" + html_filename
72
77
 
73
78
  if File.extname(src_path) == '.txt' then
74
- FileUtils.cp src_path, @home + "/#{@public_type}/" + File.basename(src_path)
79
+ FileUtils.cp src_path, @home + "/#{@public_type}/" \
80
+ + File.basename(src_path)
75
81
  end
76
82
 
77
83
  #publish the static links feed
@@ -128,6 +134,14 @@ class MyMediaKvx < MyMedia::Base
128
134
  'source_url|source_file|published|xslt')
129
135
  a.each {|x| x.attributes[:class] = 'meta'}
130
136
 
137
+ body = doc.root.element 'body'
138
+ desc = body.element 'desc'
139
+
140
+ if desc then
141
+ desc.add RDiscount.new(Martile.new(desc.text).to_s).to_html
142
+ desc.text = ''
143
+ end
144
+
131
145
  File.write destination, doc.xml(pretty: true)
132
146
 
133
147
  [kvx, raw_msg]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mymedia-kvx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  YzFxKlntIoLHNxMAQ9M9J4Yo+Lqm3HQ1PfyOUBU1Ut9Jkp76o++6L7SZbjSkvntp
32
32
  3P+jHJ4bpGBJQg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-05-27 00:00:00.000000000 Z
34
+ date: 2015-07-16 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mymedia
@@ -53,6 +53,26 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.2.5
56
+ - !ruby/object:Gem::Dependency
57
+ name: martile
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.2'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.6.7
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.2'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.6.7
56
76
  description:
57
77
  email: james@r0bertson.co.uk
58
78
  executables: []
@@ -80,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
100
  version: '0'
81
101
  requirements: []
82
102
  rubyforge_project:
83
- rubygems_version: 2.4.6
103
+ rubygems_version: 2.4.8
84
104
  signing_key:
85
105
  specification_version: 4
86
106
  summary: Publishes Kvx files using the MyMedia framework
metadata.gz.sig CHANGED
Binary file