mymedia-kvx 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/mymedia-kvx.rb +18 -4
- metadata +1 -1
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 607dfe595e27693b8ecb3f4660ca1da1441eee67
|
4
|
+
data.tar.gz: 8f685ec20d5d2ceccf63e185a6981138fd3131c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 882295d9cdc0a0264df79ab262c86d8874d58b6b971ac9ac6a0af4c7d39514b5bd18ba145d0637e12cfb146ab0a5e4b5dfe2eb69cb66aeef72c41fbe07f891be
|
7
|
+
data.tar.gz: 7d82e1e554947658c1295140096a0857f15d7ec552ec70665e12167e7336f4b2d6fd13f1399ba25f771eacef6ca303654e2e184d66df9d7e3c0ff131eebd1df6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-kvx.rb
CHANGED
@@ -17,7 +17,7 @@ class MyMediaKvx < MyMedia::Base
|
|
17
17
|
|
18
18
|
@media_src = "%s/media/%s" % [@home, public_type]
|
19
19
|
@prefix = 'k'
|
20
|
-
@target_ext = '.
|
20
|
+
@target_ext = '.html'
|
21
21
|
|
22
22
|
@media_type = media_type
|
23
23
|
@ext = ext
|
@@ -33,6 +33,9 @@ class MyMediaKvx < MyMedia::Base
|
|
33
33
|
raise "file not found : " + src_path unless File.exists? src_path
|
34
34
|
|
35
35
|
file_publish(src_path, raw_msg) do |destination, raw_destination|
|
36
|
+
|
37
|
+
raw_dest_xml = raw_destination.sub(/html$/,'xml')
|
38
|
+
dest_xml = destination.sub(/html$/,'xml')
|
36
39
|
|
37
40
|
if not raw_msg or raw_msg.empty? then
|
38
41
|
raw_msg = File.basename(src_path) + " updated: " + Time.now.to_s
|
@@ -40,8 +43,8 @@ class MyMediaKvx < MyMedia::Base
|
|
40
43
|
|
41
44
|
if File.extname(src_path) == '.txt' then
|
42
45
|
|
43
|
-
kvx, raw_msg = copy_edit(src_path,
|
44
|
-
copy_edit(src_path,
|
46
|
+
kvx, raw_msg = copy_edit(src_path, dest_xml)
|
47
|
+
copy_edit(src_path, raw_dest_xml)
|
45
48
|
|
46
49
|
else
|
47
50
|
|
@@ -50,9 +53,14 @@ class MyMediaKvx < MyMedia::Base
|
|
50
53
|
|
51
54
|
kvx.summary[:original_source] = File.basename(src_path)
|
52
55
|
|
53
|
-
File.write
|
56
|
+
File.write dest_xml, kvx.to_s
|
54
57
|
|
55
58
|
end
|
59
|
+
|
60
|
+
# transform the XML to an HTML file
|
61
|
+
|
62
|
+
File.write raw_destination, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
|
63
|
+
File.write destination, xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
|
56
64
|
|
57
65
|
if not File.basename(src_path)[/#{@prefix}\d{6}T\d{4}\.txt/] then
|
58
66
|
|
@@ -106,4 +114,10 @@ class MyMediaKvx < MyMedia::Base
|
|
106
114
|
[kvx, raw_msg]
|
107
115
|
end
|
108
116
|
|
117
|
+
def xsltproc(xslpath, xmlpath)
|
118
|
+
|
119
|
+
Nokogiri::XSLT(File.open(xslpath))\
|
120
|
+
.transform(Nokogiri::XML(File.open(xmlpath))).to_xhtml(indent: 0)
|
121
|
+
end
|
122
|
+
|
109
123
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
Z��ѧ��f|Ыv_k��L�*��F8�J���D�]&�=WKd]����>�$���p{i|hLu�^�/0���bk^`g�N��4���r�c�,v3���64q�g�ŕ���V��$��A�:��E��V���9��I�:���2��5y���k�%�/�e�.��R|/t��NN�%B`�j�Q{4�P���Z�7�b�
|
2
|
+
�8���
|