lamppost 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbee39fac8c93aa72111b3c739f320f28bede59b
4
- data.tar.gz: 1ac5292eabe9607a380a487907ffdf5736bd5bda
3
+ metadata.gz: 2564f440b533305a273de588526d1866e72a5c5e
4
+ data.tar.gz: d928622980ec1f2dd1177c8dd629275492edca1d
5
5
  SHA512:
6
- metadata.gz: 05355df0f2d9dc421d0152bef00db9588c9f96a2ed5a2846f39f1a8d3c286a73af153c54ee1df4c7dce6ea84355d01e94f16ac8cde2f660cab02f3128f25db88
7
- data.tar.gz: ce6a134733a5ff810e17cdb104fdfb89df1b10076b7b0d303fe7979b26ed4733abab443a6c68da4ada23f2ac977deabfb7fdd63cf51192a8b7cbbb6d1631513a
6
+ metadata.gz: 1515380460d82d5e14b50c3219153deb41093417d9f75c2de8b2c69b7fa9513f5a337f027cc58f86148aa9b401f5ad139fa2c7850b78c5466afcd0a2ebb66574
7
+ data.tar.gz: 26caacb44b279503cf8d8bec6c024305a3e73324c13bdf67ab8e46747a0624a15b24014be60e55392638ded6c6fb29ec8f788ec7742b1e11b491b60bab34fca3
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /vendor/bundle
11
+ *.gem
data/README.md CHANGED
@@ -1,39 +1,43 @@
1
1
  # Lamppost
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lamppost`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
5
+ ### Basic Usage
6
6
 
7
- ## Installation
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
- gem 'lamppost'
10
+ opml = Lamppost::OPML.new(response.body)
13
11
  ```
12
+ You have access to any elements from the OPML's `<head>`.
14
13
 
15
- And then execute:
16
-
17
- $ bundle
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
- ## Usage
19
+ And the outlines from the `<body>`
24
20
 
25
- TODO: Write usage instructions here
21
+ ```ruby
22
+ opml.outlines.each do |outline|
23
+ text = outline.text
24
+ url = outline.xml_url
25
+ end
26
+ ```
26
27
 
27
- ## Development
28
+ ### Feedjira
28
29
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+ ```ruby
33
+ # Parse against OPML explicitly
34
+ Feedjira::Feed.parse_with(Feedjira::Parser::OPML, response.body)
35
+ ```
32
36
 
33
- ## Contributing
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
- 1. Fork it ( https://github.com/[my-github-username]/lamppost/fork )
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 an OPML that provides OPML parsing through Feedjira}
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
 
@@ -1,3 +1,3 @@
1
1
  module Lamppost
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
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: 1.0.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 an OPML that provides OPML parsing through Feedjira
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