lamppost 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lamppost-0.0.3.gem +0 -0
- data/lamppost-0.0.4.gem +0 -0
- data/lamppost.gemspec +3 -3
- data/lib/lamppost.rb +5 -47
- data/lib/lamppost/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbee39fac8c93aa72111b3c739f320f28bede59b
|
4
|
+
data.tar.gz: 1ac5292eabe9607a380a487907ffdf5736bd5bda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05355df0f2d9dc421d0152bef00db9588c9f96a2ed5a2846f39f1a8d3c286a73af153c54ee1df4c7dce6ea84355d01e94f16ac8cde2f660cab02f3128f25db88
|
7
|
+
data.tar.gz: ce6a134733a5ff810e17cdb104fdfb89df1b10076b7b0d303fe7979b26ed4733abab443a6c68da4ada23f2ac977deabfb7fdd63cf51192a8b7cbbb6d1631513a
|
data/lamppost-0.0.3.gem
ADDED
Binary file
|
data/lamppost-0.0.4.gem
ADDED
Binary file
|
data/lamppost.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['Chris Kalafarski']
|
10
10
|
spec.email = ['chris@farski.com']
|
11
11
|
|
12
|
-
spec.summary = %q{Simple OPML parsing with
|
13
|
-
spec.description = %q{Lamppost is an OPML that
|
12
|
+
spec.summary = %q{Simple OPML parsing with Feedjira}
|
13
|
+
spec.description = %q{Lamppost is an OPML that provides OPML parsing through Feedjira}
|
14
14
|
spec.homepage = 'https://github.com/farski/lamppost'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'minitest', '~> 5.5'
|
28
28
|
spec.add_development_dependency 'rake', '~> 10.0'
|
29
29
|
|
30
|
-
spec.add_runtime_dependency '
|
30
|
+
spec.add_runtime_dependency 'feedjira-opml', '~> 1.0'
|
31
31
|
end
|
data/lib/lamppost.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'lamppost/version'
|
2
|
-
require '
|
2
|
+
require 'feedjira/opml'
|
3
3
|
|
4
4
|
module Lamppost
|
5
5
|
class OPML
|
@@ -7,60 +7,18 @@ module Lamppost
|
|
7
7
|
@xml = file_or_xml.is_a?(File) ? file_or_xml.read : file_or_xml
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
head
|
12
|
-
end
|
13
|
-
|
14
|
-
def date_created
|
15
|
-
head[:dateCreated] if !head[:dateCreated].empty?
|
16
|
-
end
|
17
|
-
|
18
|
-
def date_modified
|
19
|
-
head[:dateModified] if !head[:dateModified].empty?
|
20
|
-
end
|
21
|
-
|
22
|
-
def owner_name
|
23
|
-
head[:ownerName] if !head[:ownerName].empty?
|
24
|
-
end
|
25
|
-
|
26
|
-
def owner_email
|
27
|
-
head[:ownerEmail] if !head[:ownerEmail].empty?
|
28
|
-
end
|
29
|
-
|
30
|
-
def owner_id
|
31
|
-
head[:ownerId] if !head[:ownerId].empty?
|
32
|
-
end
|
33
|
-
|
34
|
-
def docs
|
35
|
-
head[:docs] if !head[:docs].empty?
|
10
|
+
def head
|
11
|
+
@head ||= document.head
|
36
12
|
end
|
37
13
|
|
38
14
|
def outlines
|
39
|
-
document.
|
40
|
-
type = node['type']
|
41
|
-
text = node['text']
|
42
|
-
xml_url = node['xmlUrl']
|
43
|
-
memo << Struct.new(:type, :text, :xml_url).new(type, text, xml_url)
|
44
|
-
memo
|
45
|
-
end
|
15
|
+
@outlines ||= document.body.outlines
|
46
16
|
end
|
47
17
|
|
48
18
|
private
|
49
19
|
|
50
20
|
def document
|
51
|
-
@document ||=
|
52
|
-
end
|
53
|
-
|
54
|
-
def head
|
55
|
-
@head ||= {
|
56
|
-
title: document.css('opml > head > title').text,
|
57
|
-
dateCreated: document.css('opml > head > dateCreated').text,
|
58
|
-
dateModified: document.css('opml > head > dateModified').text,
|
59
|
-
ownerName: document.css('opml > head > ownerName').text,
|
60
|
-
ownerEmail: document.css('opml > head > ownerEmail').text,
|
61
|
-
ownerId: document.css('opml > head > ownerId').text,
|
62
|
-
docs: document.css('opml > head > docs').text,
|
63
|
-
}
|
21
|
+
@document ||= Feedjira::Feed.parse_with(Feedjira::Parser::OPML, @xml)
|
64
22
|
end
|
65
23
|
end
|
66
24
|
end
|
data/lib/lamppost/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lamppost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kalafarski
|
@@ -53,20 +53,20 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: feedjira-opml
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
69
|
-
description: Lamppost is an OPML that
|
68
|
+
version: '1.0'
|
69
|
+
description: Lamppost is an OPML that provides OPML parsing through Feedjira
|
70
70
|
email:
|
71
71
|
- chris@farski.com
|
72
72
|
executables: []
|
@@ -82,6 +82,8 @@ files:
|
|
82
82
|
- Rakefile
|
83
83
|
- bin/console
|
84
84
|
- bin/setup
|
85
|
+
- lamppost-0.0.3.gem
|
86
|
+
- lamppost-0.0.4.gem
|
85
87
|
- lamppost.gemspec
|
86
88
|
- lib/lamppost.rb
|
87
89
|
- lib/lamppost/version.rb
|
@@ -109,5 +111,5 @@ rubyforge_project:
|
|
109
111
|
rubygems_version: 2.4.5
|
110
112
|
signing_key:
|
111
113
|
specification_version: 4
|
112
|
-
summary: Simple OPML parsing with
|
114
|
+
summary: Simple OPML parsing with Feedjira
|
113
115
|
test_files: []
|