mymedia_snippets 0.1.0 → 0.1.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/mymedia_snippets.rb +25 -25
- metadata +29 -30
- 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: 984c037461778a78b1bbd5316b648462a0976026
|
4
|
+
data.tar.gz: 9ba9c2714ba4169e4661256568829d960ca6f3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83d7b883251b8ee9430d3b1f33c64b01af96cb5f4fe3ce21586d58b41a1dae1f9ae2a97619a1d1c8829c4e265cef28e88714add4910885f923626ba97c2da7fc
|
7
|
+
data.tar.gz: b09c84dd897d090ff9c414cd04df4c6c6c53f4cd0414895293591932dcd3c64f0a2494817d0c800ef45c28a9fe4dc248f42ebd571581a47698fdca5e76cd973c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/mymedia_snippets.rb
CHANGED
@@ -6,43 +6,43 @@ require 'coderay'
|
|
6
6
|
require 'mymedia-pages'
|
7
7
|
|
8
8
|
|
9
|
-
|
9
|
+
class MyMediaSnippets < MyMediaPages
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@css_href = css_href
|
17
|
-
@lang = lang
|
11
|
+
def initialize(media_type: 'snippets', config: 'mymedia.conf',
|
12
|
+
css_href: '/snippets/coderay_ruby.css', lang: :ruby, log: log)
|
13
|
+
|
14
|
+
super(media_type: media_type, config: config, log: log)
|
18
15
|
|
19
|
-
|
16
|
+
@css_href = css_href
|
17
|
+
@lang = lang
|
20
18
|
|
21
|
-
|
19
|
+
end
|
22
20
|
|
23
|
-
|
21
|
+
def modify_xml(doc,filepath)
|
24
22
|
|
25
|
-
|
23
|
+
super do |doc|
|
26
24
|
|
27
|
-
|
25
|
+
r = doc.root.xpath('//pre/code')
|
28
26
|
|
29
|
-
|
27
|
+
r.each do |node|
|
30
28
|
|
31
|
-
|
29
|
+
parent = node.parent
|
32
30
|
|
33
|
-
|
34
|
-
parent.insert_before doc_code.root
|
35
|
-
parent.delete
|
36
|
-
end
|
31
|
+
xml = CodeRay.scan(node.text.unescape, @lang).div(:css => :class)
|
37
32
|
|
38
|
-
|
33
|
+
doc_code = Rexle.new(xml.sub('code>',"code>\n"))
|
34
|
+
parent.insert_before doc_code.root
|
35
|
+
parent.delete
|
39
36
|
end
|
40
37
|
|
38
|
+
doc
|
41
39
|
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_css_js(xml)
|
44
|
+
xml.link({rel: 'stylesheet', type: 'text/css', \
|
45
|
+
href: @css_href, media: 'screen, projection, tv'},'')
|
46
|
+
end
|
47
47
|
|
48
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia_snippets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,27 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|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X43OqiPACiDcCJcqV2FX6UUygc1wKOqkQGKa4u7INX5kStNG+Iog
|
28
|
+
27rKMWLKp0RvzyzXbE2tfBebzUshm+zzk6sb1QzM2zsD8elXX4mYSg48VdZweYQK
|
29
|
+
j1dkY5IkY2GWBgceyhQgmOeYZ0HKg92J9Eimt7ctGBoFTXQpcweFD485WSp+h0OM
|
30
|
+
YiZxmsjxASs3Rc7SAdF285IGdVE2qjHr9Wqozm1W6eYqNiPtvHkQuPHxIDOvjWy1
|
31
|
+
H4c=
|
33
32
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
33
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
35
34
|
dependencies:
|
36
35
|
- !ruby/object:Gem::Dependency
|
37
36
|
name: mymedia-pages
|
@@ -39,20 +38,20 @@ dependencies:
|
|
39
38
|
requirements:
|
40
39
|
- - "~>"
|
41
40
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
41
|
+
version: '0.2'
|
43
42
|
- - ">="
|
44
43
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.1
|
44
|
+
version: 0.2.1
|
46
45
|
type: :runtime
|
47
46
|
prerelease: false
|
48
47
|
version_requirements: !ruby/object:Gem::Requirement
|
49
48
|
requirements:
|
50
49
|
- - "~>"
|
51
50
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
51
|
+
version: '0.2'
|
53
52
|
- - ">="
|
54
53
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.1
|
54
|
+
version: 0.2.1
|
56
55
|
- !ruby/object:Gem::Dependency
|
57
56
|
name: coderay
|
58
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,7 +61,7 @@ dependencies:
|
|
62
61
|
version: '1.1'
|
63
62
|
- - ">="
|
64
63
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.1.
|
64
|
+
version: 1.1.2
|
66
65
|
type: :runtime
|
67
66
|
prerelease: false
|
68
67
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,9 +71,9 @@ dependencies:
|
|
72
71
|
version: '1.1'
|
73
72
|
- - ">="
|
74
73
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.1.
|
74
|
+
version: 1.1.2
|
76
75
|
description:
|
77
|
-
email: james@
|
76
|
+
email: james@jamesrobertson.eu
|
78
77
|
executables: []
|
79
78
|
extensions: []
|
80
79
|
extra_rdoc_files: []
|
@@ -100,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
99
|
version: '0'
|
101
100
|
requirements: []
|
102
101
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.6.13
|
104
103
|
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: A MyMedia gem for publishing code snippets
|
metadata.gz.sig
CHANGED
Binary file
|