rss 0.3.1 → 0.3.3

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
  SHA256:
3
- metadata.gz: 256ad5c3d40e196bf28856b91c644de51c96f739893bd758e1d708c16f3cb4ed
4
- data.tar.gz: 2d64ea8248adfc12c7b068f1b3fbe84e7bf11109ca9712f1e81808f86f330f60
3
+ metadata.gz: 2858076bf1633de3eb979dd67dc495b3a9fc545bcdf959743447d091bc4b2e84
4
+ data.tar.gz: 2b62b0efced5a8d564623e1101b42931bd305d551eaa87b86606a81d07cb2e12
5
5
  SHA512:
6
- metadata.gz: 2b2b9eeb72011de92f218871ddd0993aee856c8ec496ee4b79a98d36912c826a6860eff37ebcc9ad447f5311560c5a0906ada2b13abab8b9cad081ba62b3e495
7
- data.tar.gz: 736246b1c3b6c3eed52161fa220f170aa0da4da6c163dd2656b5ea5f4b5d77d5b96b353eea1b9b51d68e9014f1da221c1dc0a49236a6c020b2c4994d4fca2195
6
+ metadata.gz: 52d76d49e2e8ce38ce9df1581bfb471dc7bc4778720c99c88f595c7e24a51948766f444f2f0b8bba23f00bdb908c59ac5b0d5cdfdf3ba7ecc30d11269373478a
7
+ data.tar.gz: d70eb85476fc0b1c487ae37185f90e51364dd2167c21a1f17b6e3070e62978706abcc56e1c9361c3ccb9a0cbc19a9d5a535df1c3c83f2f6fbf4e1d26cab96e35
data/NEWS.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # News
2
2
 
3
+ ## 0.3.3 - 2026-06-10
4
+
5
+ ### Improvements
6
+
7
+ * Improved PI content parse performance.
8
+ * GH-66
9
+ * GH-67
10
+ * Patch by Connor Shea.
11
+
12
+ ### Thanks
13
+
14
+ * Connor Shea
15
+
16
+ ## 0.3.2 - 2025-12-19
17
+
18
+ ### Improvements
19
+
20
+ * Updated documents.
21
+ * GH-59
22
+ * Patch by 1s22s1.
23
+
24
+ * Added support for Ruby 4.0.0.
25
+ * GH-62
26
+ * Patch by Taketo Takashima.
27
+
28
+ ### Thanks
29
+
30
+ * 1s22s1
31
+ * Taketo Takashima
32
+
3
33
  ## 0.3.1 - 2024-08-02
4
34
 
5
35
  ### 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, but we'll need the help of open-uri:
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
- require 'rss'
37
- require 'open-uri'
38
-
39
- url = 'https://www.ruby-lang.org/en/feeds/news.rss'
40
- URI.open(url) do |rss|
41
- feed = RSS::Parser.parse(rss)
42
- puts "Title: #{feed.channel.title}"
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/parser.rb CHANGED
@@ -391,7 +391,7 @@ module RSS
391
391
  ns.fetch(prefix, "")
392
392
  end
393
393
 
394
- CONTENT_PATTERN = /\s*([^=]+)=(["'])([^\2]+?)\2/
394
+ CONTENT_PATTERN = /\G\s*([^=]+)=(["'])([^\2]+?)\2/
395
395
  # Extract the first name="value" pair from content.
396
396
  # Works with single quotes according to the constant
397
397
  # CONTENT_PATTERN. Return a Hash.
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/util"
4
+ require "cgi/escape"
5
5
  require "time"
6
6
 
7
7
  class Time
data/lib/rss/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module RSS
2
2
  # The current version of RSS
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.3"
4
4
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
 
3
- require "cgi/util"
3
+ require "cgi/escape"
4
4
 
5
5
  module RSS
6
6
 
data/lib/rss/xml.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
 
3
- require "cgi/util"
3
+ require "cgi/escape"
4
4
 
5
5
  module RSS
6
6
  module XML
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, but we'll need the help of
23
- # open-uri:
22
+ # the right place. It's really easy to do this.
24
23
  #
25
24
  # require 'rss'
26
- # require 'open-uri'
27
- #
28
- # url = 'http://www.ruby-lang.org/en/feeds/news.rss'
29
- # URI.open(url) do |rss|
30
- # feed = RSS::Parser.parse(rss)
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,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2024-08-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rexml
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.6.0.dev
98
+ rubygems_version: 4.0.10
99
99
  specification_version: 4
100
100
  summary: Family of libraries that support various formats of XML "feeds".
101
101
  test_files: []