mymedia-pages 0.1.7 → 0.1.8
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 +3 -1
- data.tar.gz.sig +0 -0
- data/lib/mymedia-pages.rb +14 -25
- metadata +2 -2
- 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: 809f1a3cee00322cfa48782c228d1f3895f92766
|
4
|
+
data.tar.gz: 906b99837af46ad7fe2829c022b5e919add14d40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cca88abbee502b5460e4a736763a8c3ec7d06d0df84459ced5e70ec406883e4db621ccb92faddae2cc55f0222640bb4ab1b75a3424c380de61b5077436c626cf
|
7
|
+
data.tar.gz: afa63e8b610334c49c16ec4e7c323f3d4074b6c5fe62f4bc0f0f6bbef922073558d6728e0c6b4dcefbda87ab08e8576ce34d27e40254109c17efb54cfdca738a
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
_�
|
2
|
+
���.JכLy�ᕛ���Ul�
|
3
|
+
��B�NM|Ó^� n}9S�v �w�mB�K�������k�k���o���|-&���~vE�?�凑�;w���������y@�[��\�������!��F����v���*D�w8MD��4[��\�Y�]T`Ea5Z(_)c�W|П�}??�f��$#��<������G�/4���O�h��T9�9լ�VwI�r,l�Z?j�Q����i;f����'�@�#
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -31,8 +31,6 @@ class MyMediaPages < MyMedia::Base
|
|
31
31
|
|
32
32
|
file_publish(src_path, raw_msg) do |destination, raw_destination|
|
33
33
|
|
34
|
-
#FileUtils.cp src_path, destination
|
35
|
-
#FileUtils.cp src_path, raw_destination
|
36
34
|
ext = File.extname(src_path)
|
37
35
|
|
38
36
|
if ext[/\.(?:md|txt)/] then
|
@@ -52,10 +50,10 @@ class MyMediaPages < MyMedia::Base
|
|
52
50
|
|
53
51
|
|
54
52
|
modify_xml(doc, raw_dest_xml)
|
55
|
-
modify_xml(doc, dest_xml
|
53
|
+
modify_xml(doc, dest_xml)
|
56
54
|
|
57
55
|
basic_xsl = File.read "#{@home}/r/xsl/#{@public_type}.xsl"
|
58
|
-
|
56
|
+
|
59
57
|
File.write raw_destination,
|
60
58
|
Nokogiri::XSLT(basic_xsl)\
|
61
59
|
.transform(Nokogiri::XML(File.read raw_dest_xml))
|
@@ -70,20 +68,22 @@ class MyMediaPages < MyMedia::Base
|
|
70
68
|
FileUtils.cp destination, File.dirname(destination) + html_filename
|
71
69
|
FileUtils.cp dest_xml, File.dirname(dest_xml) + xml_filename
|
72
70
|
|
71
|
+
tags = doc.root.xpath('summary/tags/tag/text()')
|
72
|
+
raw_msg = "%s %s" % [doc.root.text('summary/title'),
|
73
|
+
tags.map {|x| "#%s" % x }.join(' ')]
|
73
74
|
|
74
|
-
#target_url = [@website, @public_type, html_filename].join('/')
|
75
75
|
|
76
76
|
else
|
77
77
|
|
78
78
|
html_filename = File.basename(src_path)
|
79
79
|
FileUtils.cp src_path, destination
|
80
80
|
FileUtils.cp src_path, raw_destination
|
81
|
+
|
82
|
+
raw_msg = File.read(destination)[/<title>([^<]+)<\/title>/,1]
|
81
83
|
end
|
82
|
-
|
84
|
+
|
83
85
|
if not File.basename(src_path)[/[pwn]\d{6}T\d{4}\.(?:html|md|txt)/] then
|
84
86
|
|
85
|
-
|
86
|
-
|
87
87
|
FileUtils.cp destination, @home + "/#{@public_type}/" + html_filename
|
88
88
|
|
89
89
|
if xml_filename then
|
@@ -91,27 +91,15 @@ class MyMediaPages < MyMedia::Base
|
|
91
91
|
end
|
92
92
|
|
93
93
|
static_filepath = @home + "/#{@public_type}/static.xml"
|
94
|
-
|
95
|
-
x_filename = @static_html == true ? html_filename : xml_filename
|
96
|
-
|
97
|
-
|
94
|
+
x_filename = @static_html == true ? html_filename : xml_filename
|
98
95
|
target_url = [@website, @public_type, x_filename].join('/')
|
99
96
|
|
100
|
-
publish_dynarex(static_filepath, {title:
|
97
|
+
publish_dynarex(static_filepath, {title: raw_msg, url: target_url })
|
101
98
|
|
102
99
|
|
103
100
|
|
104
101
|
end
|
105
102
|
|
106
|
-
if doc then
|
107
|
-
|
108
|
-
tags = doc.root.xpath('summary/tags/tag/text()')
|
109
|
-
raw_msg = "%s %s" % [doc.root.text('summary/title'),
|
110
|
-
tags.map {|x| "#%s" % x }.join]
|
111
|
-
else
|
112
|
-
raw_msg = File.read(destination)[/<title>([^<]+)<\/title>/,1]
|
113
|
-
end
|
114
|
-
|
115
103
|
[raw_msg, target_url]
|
116
104
|
end
|
117
105
|
|
@@ -146,8 +134,8 @@ class MyMediaPages < MyMedia::Base
|
|
146
134
|
summary = doc.root.element('summary')
|
147
135
|
|
148
136
|
title = summary.text('title')
|
149
|
-
tags = summary.xpath('tags/tag/text()').map{|x| '#' + x}.join
|
150
|
-
|
137
|
+
tags = summary.xpath('tags/tag/text()').map{|x| '#' + x}.join(' ')
|
138
|
+
|
151
139
|
url = "%s/%s/yy/mm/dd/hhmmhrs.html" % [@website, @media_type]
|
152
140
|
full_title = (url + title + ' ' + tags)
|
153
141
|
|
@@ -163,7 +151,8 @@ class MyMediaPages < MyMedia::Base
|
|
163
151
|
|
164
152
|
def modify_xml(docx, filepath, xslpath='r/')
|
165
153
|
|
166
|
-
doc = docx.clone
|
154
|
+
doc = docx.clone
|
155
|
+
|
167
156
|
raw_msg = microblog_title(doc)
|
168
157
|
|
169
158
|
doc.instructions.push %w(xml-stylesheet title='XSL_formatting' type='text/xsl') \
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
R8qQYTqUH5uyN1gXTamDXNnXrSWNIRgATqBFU0Rk4ia1O2X6/oMnJctbKR+A3n78
|
32
32
|
zZLvJwXE0u524g==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: mymedia
|
metadata.gz.sig
CHANGED
Binary file
|