rss 0.3.0 → 0.3.2
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/NEWS.md +33 -0
- data/README.md +8 -12
- data/lib/rss/rss.rb +2 -2
- data/lib/rss/version.rb +1 -1
- data/lib/rss/xml-stylesheet.rb +1 -1
- data/lib/rss/xml.rb +1 -1
- data/lib/rss.rb +6 -11
- metadata +3 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2ab2e2eae9a7728b36476373e748eaf66ce357b857156f96f9afc366f747625
|
|
4
|
+
data.tar.gz: c92b1582e936b810d4725ca7498656a9e5014e78de7dc541b1a1825eb1b51480
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05e252cb211146849b60519821e591cdd7e26031817c3ef091e706b28db2316550970b015a7fe36ea2c6921a79cdadbf150012de065398ce1a5be494dab97c0d
|
|
7
|
+
data.tar.gz: 9beba0ef3f14611f7ddbb62b58797e8f814b64bf454fa4cf1e21276d471464d47f91fad31cf1be51d7f5c2339ded75d2c3608fe20aca5e4851d373ac809de0fe
|
data/NEWS.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# News
|
|
2
2
|
|
|
3
|
+
## 0.3.2 - 2025-12-19
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* Updated documents.
|
|
8
|
+
* GH-59
|
|
9
|
+
* Patch by 1s22s1.
|
|
10
|
+
|
|
11
|
+
* Added support for Ruby 4.0.0.
|
|
12
|
+
* GH-62
|
|
13
|
+
* Patch by Taketo Takashima.
|
|
14
|
+
|
|
15
|
+
### Thanks
|
|
16
|
+
|
|
17
|
+
* 1s22s1
|
|
18
|
+
* Taketo Takashima
|
|
19
|
+
|
|
20
|
+
## 0.3.1 - 2024-08-02
|
|
21
|
+
|
|
22
|
+
### Improvements
|
|
23
|
+
|
|
24
|
+
* itunes: Add support for lowercased values (`full`, `trailer` and
|
|
25
|
+
`bonus`) for `<itunes:episodeType>`.
|
|
26
|
+
* GH-51
|
|
27
|
+
* GH-53
|
|
28
|
+
* Reported by Artem Alimov.
|
|
29
|
+
* Patch by Andrew H Schwartz.
|
|
30
|
+
|
|
31
|
+
### Thanks
|
|
32
|
+
|
|
33
|
+
* Artem Alimov
|
|
34
|
+
* Andrew H Schwartz
|
|
35
|
+
|
|
3
36
|
## 0.3.0 - 2023-08-12
|
|
4
37
|
|
|
5
38
|
### Improvements
|
data/README.md
CHANGED
|
@@ -30,20 +30,16 @@ Or install it yourself as:
|
|
|
30
30
|
|
|
31
31
|
### Consuming RSS
|
|
32
32
|
|
|
33
|
-
If you'd like to read someone's RSS feed with your Ruby code, you've come to the right place. It's really easy to do this
|
|
33
|
+
If you'd like to read someone's RSS feed with your Ruby code, you've come to the right place. It's really easy to do this:
|
|
34
34
|
|
|
35
35
|
```ruby
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
feed.items.each do |item|
|
|
44
|
-
puts "Item: #{item.title}"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
36
|
+
require 'rss'
|
|
37
|
+
|
|
38
|
+
feed = RSS::Parser.parse('https://www.ruby-lang.org/en/feeds/news.rss')
|
|
39
|
+
puts "Title: #{feed.channel.title}"
|
|
40
|
+
feed.items.each do |item|
|
|
41
|
+
puts "Item: #{item.title}"
|
|
42
|
+
end
|
|
47
43
|
```
|
|
48
44
|
|
|
49
45
|
As you can see, the workhorse is RSS::Parser#parse, which takes the source of the feed and a parameter that performs validation on the feed. We get back an object that has all of the data from our feed, accessible through methods. This example shows getting the title out of the channel element, and looping through the list of items.
|
data/lib/rss/rss.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: false
|
|
2
2
|
|
|
3
3
|
require "English"
|
|
4
|
-
require "cgi/
|
|
4
|
+
require "cgi/escape"
|
|
5
5
|
require "time"
|
|
6
6
|
|
|
7
7
|
class Time
|
|
@@ -593,7 +593,7 @@ EOC
|
|
|
593
593
|
module_eval(<<-DEF, *get_file_and_line_from_caller(2))
|
|
594
594
|
def #{name}=(new_value)
|
|
595
595
|
if @do_validate and
|
|
596
|
-
!["Full", "Trailer", "Bonus", nil].include?(new_value)
|
|
596
|
+
!["Full", "full", "Trailer", "trailer", "Bonus", "bonus", nil].include?(new_value)
|
|
597
597
|
raise NotAvailableValueError.new('#{disp_name}', new_value)
|
|
598
598
|
end
|
|
599
599
|
@#{name} = new_value
|
data/lib/rss/version.rb
CHANGED
data/lib/rss/xml-stylesheet.rb
CHANGED
data/lib/rss/xml.rb
CHANGED
data/lib/rss.rb
CHANGED
|
@@ -19,19 +19,14 @@
|
|
|
19
19
|
# == Consuming RSS
|
|
20
20
|
#
|
|
21
21
|
# If you'd like to read someone's RSS feed with your Ruby code, you've come to
|
|
22
|
-
# the right place. It's really easy to do this
|
|
23
|
-
# open-uri:
|
|
22
|
+
# the right place. It's really easy to do this.
|
|
24
23
|
#
|
|
25
24
|
# require 'rss'
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# puts "Title: #{feed.channel.title}"
|
|
32
|
-
# feed.items.each do |item|
|
|
33
|
-
# puts "Item: #{item.title}"
|
|
34
|
-
# end
|
|
25
|
+
#
|
|
26
|
+
# feed = RSS::Parser.parse('https://www.ruby-lang.org/en/feeds/news.rss')
|
|
27
|
+
# puts "Title: #{feed.channel.title}"
|
|
28
|
+
# feed.items.each do |item|
|
|
29
|
+
# puts "Item: #{item.title}"
|
|
35
30
|
# end
|
|
36
31
|
#
|
|
37
32
|
# As you can see, the workhorse is RSS::Parser#parse, which takes the source of
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rss
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kouhei Sutou
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rexml
|
|
@@ -24,48 +23,6 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: bundler
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: rake
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: test-unit
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - ">="
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
69
26
|
description: Family of libraries that support various formats of XML "feeds".
|
|
70
27
|
email:
|
|
71
28
|
- kou@cozmixng.org
|
|
@@ -124,7 +81,6 @@ homepage: https://github.com/ruby/rss
|
|
|
124
81
|
licenses:
|
|
125
82
|
- BSD-2-Clause
|
|
126
83
|
metadata: {}
|
|
127
|
-
post_install_message:
|
|
128
84
|
rdoc_options: []
|
|
129
85
|
require_paths:
|
|
130
86
|
- lib
|
|
@@ -139,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
139
95
|
- !ruby/object:Gem::Version
|
|
140
96
|
version: '0'
|
|
141
97
|
requirements: []
|
|
142
|
-
rubygems_version:
|
|
143
|
-
signing_key:
|
|
98
|
+
rubygems_version: 4.0.2
|
|
144
99
|
specification_version: 4
|
|
145
100
|
summary: Family of libraries that support various formats of XML "feeds".
|
|
146
101
|
test_files: []
|