lamppost 0.0.4 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6919ac3feb6dc3d9ce5d1bae81449508768c368a
4
- data.tar.gz: 0fc90e2ae501e2176a5a7839bcb8563fea89a387
3
+ metadata.gz: dbee39fac8c93aa72111b3c739f320f28bede59b
4
+ data.tar.gz: 1ac5292eabe9607a380a487907ffdf5736bd5bda
5
5
  SHA512:
6
- metadata.gz: 8aa0822c838296df366c9d83cbac44051ef1896d5354d4e15e9112aa60f9ec156489c104ebaebca8b1e8bed85e0d9909de13bd0166f999484402eb124b06a1f7
7
- data.tar.gz: 5cb4be42c66302a1099398b4150a92b0877d9375755ff3b77f15dece9201b15068fa48167e4d15febfe0d5fd9068dfc0fd9603a3ff549134f817541ebf92aa92
6
+ metadata.gz: 05355df0f2d9dc421d0152bef00db9588c9f96a2ed5a2846f39f1a8d3c286a73af153c54ee1df4c7dce6ea84355d01e94f16ac8cde2f660cab02f3128f25db88
7
+ data.tar.gz: ce6a134733a5ff810e17cdb104fdfb89df1b10076b7b0d303fe7979b26ed4733abab443a6c68da4ada23f2ac977deabfb7fdd63cf51192a8b7cbbb6d1631513a
Binary file
Binary file
@@ -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 Nokogiri}
13
- spec.description = %q{Lamppost is an OPML that conforms strictly to the OPML 2.0 specification}
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 'nokogiri', '~> 1.6'
30
+ spec.add_runtime_dependency 'feedjira-opml', '~> 1.0'
31
31
  end
@@ -1,5 +1,5 @@
1
1
  require 'lamppost/version'
2
- require 'nokogiri'
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 title
11
- head[:title] if !head[:title].empty?
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.css('opml > body > outline').inject([]) do |memo, node|
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 ||= Nokogiri::XML.parse(@xml)
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
@@ -1,3 +1,3 @@
1
1
  module Lamppost
2
- VERSION = '0.0.4'
2
+ VERSION = '1.0.0'
3
3
  end
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
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: nokogiri
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.6'
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.6'
69
- description: Lamppost is an OPML that conforms strictly to the OPML 2.0 specification
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 Nokogiri
114
+ summary: Simple OPML parsing with Feedjira
113
115
  test_files: []