namelessjon-feed_me 0.0.4 → 0.0.5

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.
data/TODO CHANGED
@@ -1,5 +1,2 @@
1
1
  TODO:
2
- Fix LICENSE with your name
3
- Fix Rakefile with your name and contact info
4
- Add your code to lib/feed_me.rb
5
- Add your Merb rake tasks to lib/feed_me/merbtasks.rb
2
+ - Add categories to atom feeds
@@ -95,9 +95,13 @@ class FeedMe::AbstractParser
95
95
  end
96
96
 
97
97
  def fetch(selector, search_in = xml, method = :inner_html)
98
- item = search_in.at(selector)
98
+ item = search_in.search(selector)
99
99
 
100
- self.try("extract_" + method.to_s, item) if item
100
+ unless method == :array
101
+ self.try("extract_" + method.to_s, item.first) unless item.empty?
102
+ else
103
+ item.map { |i| self.try("extract_inner_html", i) }
104
+ end
101
105
  end
102
106
 
103
107
  def extract_inner_html(item)
@@ -53,7 +53,8 @@ module FeedMe
53
53
  :item_id => :guid,
54
54
  :url => :link,
55
55
  :content => :description,
56
- :author => :special
56
+ :author => :special,
57
+ :categories => [:category, :array]
57
58
  }
58
59
  }
59
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namelessjon-feed_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -39,12 +39,12 @@ files:
39
39
  - Rakefile
40
40
  - TODO
41
41
  - lib/feed_me
42
- - lib/feed_me/consts.rb
43
42
  - lib/feed_me/feed_struct.rb
44
43
  - lib/feed_me/item_parser.rb
45
44
  - lib/feed_me/merbtasks.rb
46
45
  - lib/feed_me/simple_struct.rb
47
46
  - lib/feed_me/feed_parser.rb
47
+ - lib/feed_me/consts.rb
48
48
  - lib/feed_me/abstract_parser.rb
49
49
  - lib/feed_me.rb
50
50
  has_rdoc: true