Skip to content

Commit

Permalink
Merge pull request #100 from apainintheneck/fix-bin-readability-comma…
Browse files Browse the repository at this point in the history
…nd-on-ruby-3

Update bin/readability to work with Ruby 3.x
  • Loading branch information
cantino authored Nov 23, 2024
2 parents 8abe36e + ecf963f commit aaca620
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Example
require 'readability'
require 'open-uri'

source = open('http://lab.arc90.com/experiments/readability/').read
source = URI.parse('http://lab.arc90.com/experiments/readability/').read
puts Readability::Document.new(source).content


Expand Down
4 changes: 2 additions & 2 deletions bin/readability
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'rubygems'
require 'open-uri'
require 'optparse'
require File.dirname(__FILE__) + '/../lib/readability'
require_relative '../lib/readability'

options = { :debug => false, :images => false }
options_parser = OptionParser.new do |opts|
Expand All @@ -28,7 +28,7 @@ if ARGV.length != 1
exit 1
end

text = open(ARGV.first).read
text = URI.parse(ARGV.first).read
params = if options[:images]
{ :tags => %w[div p img a],
:attributes => %w[src href],
Expand Down

0 comments on commit aaca620

Please sign in to comment.