Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bin/readability to work with Ruby 3.x #100

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading