lamppost 1.0.0 → 1.0.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
- data/.gitignore +1 -0
- data/README.md +28 -24
- data/lamppost.gemspec +1 -1
- data/lib/lamppost/version.rb +1 -1
- metadata +2 -4
- data/lamppost-0.0.3.gem +0 -0
- data/lamppost-0.0.4.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2564f440b533305a273de588526d1866e72a5c5e
|
4
|
+
data.tar.gz: d928622980ec1f2dd1177c8dd629275492edca1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1515380460d82d5e14b50c3219153deb41093417d9f75c2de8b2c69b7fa9513f5a337f027cc58f86148aa9b401f5ad139fa2c7850b78c5466afcd0a2ebb66574
|
7
|
+
data.tar.gz: 26caacb44b279503cf8d8bec6c024305a3e73324c13bdf67ab8e46747a0624a15b24014be60e55392638ded6c6fb29ec8f788ec7742b1e11b491b60bab34fca3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,39 +1,43 @@
|
|
1
1
|
# Lamppost
|
2
2
|
|
3
|
-
|
3
|
+
Lamppost provides basic OPML parsing. It provides a convenience class for straightforward parsing of XML and files, but because it causes a parser class to get registered with Feedjira, it also allows you to take fetch and parse files with Feedjira itself.
|
4
4
|
|
5
|
-
|
5
|
+
### Basic Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
7
|
+
Pass in either a `File` or a `String`
|
10
8
|
|
11
9
|
```ruby
|
12
|
-
|
10
|
+
opml = Lamppost::OPML.new(response.body)
|
13
11
|
```
|
12
|
+
You have access to any elements from the OPML's `<head>`.
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install lamppost
|
14
|
+
```ruby
|
15
|
+
title = opml.head.title
|
16
|
+
name = opml.head.owner_name
|
17
|
+
```
|
22
18
|
|
23
|
-
|
19
|
+
And the outlines from the `<body>`
|
24
20
|
|
25
|
-
|
21
|
+
```ruby
|
22
|
+
opml.outlines.each do |outline|
|
23
|
+
text = outline.text
|
24
|
+
url = outline.xml_url
|
25
|
+
end
|
26
|
+
```
|
26
27
|
|
27
|
-
|
28
|
+
### Feedjira
|
28
29
|
|
29
|
-
|
30
|
+
Behind the scenes Lampost uses Feedjira parser classes provided by the [feedjira-opml](https://www.github.com/farski/feedjira-opml) gem. That gem registers the OPML parser with Feedjira, so it is available any time Feedjira is used to parse a document.
|
30
31
|
|
31
|
-
|
32
|
+
```ruby
|
33
|
+
# Parse against OPML explicitly
|
34
|
+
Feedjira::Feed.parse_with(Feedjira::Parser::OPML, response.body)
|
35
|
+
```
|
32
36
|
|
33
|
-
|
37
|
+
```ruby
|
38
|
+
# Feedjira will implicitly match the OPML parser when
|
39
|
+
# it finds an <opml> tag
|
40
|
+
Feedjira::Feed.parse(response.body)
|
41
|
+
```
|
34
42
|
|
35
|
-
|
36
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
-
5. Create a new Pull Request
|
43
|
+
You could also use Feedjira's `fetch_and_parse` method if you'd like.
|
data/lamppost.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['chris@farski.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Simple OPML parsing with Feedjira}
|
13
|
-
spec.description = %q{Lamppost is
|
13
|
+
spec.description = %q{Lamppost is a basic OPML parser that uses Feedjira}
|
14
14
|
spec.homepage = 'https://github.com/farski/lamppost'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kalafarski
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
-
description: Lamppost is
|
69
|
+
description: Lamppost is a basic OPML parser that uses Feedjira
|
70
70
|
email:
|
71
71
|
- chris@farski.com
|
72
72
|
executables: []
|
@@ -82,8 +82,6 @@ files:
|
|
82
82
|
- Rakefile
|
83
83
|
- bin/console
|
84
84
|
- bin/setup
|
85
|
-
- lamppost-0.0.3.gem
|
86
|
-
- lamppost-0.0.4.gem
|
87
85
|
- lamppost.gemspec
|
88
86
|
- lib/lamppost.rb
|
89
87
|
- lib/lamppost/version.rb
|
data/lamppost-0.0.3.gem
DELETED
Binary file
|
data/lamppost-0.0.4.gem
DELETED
Binary file
|