The auto_link method raises a RuntimeError when passed the text of a Twitter::Tweet object from the latest version (5.2.0) of the twitter gem.
Here's an example:
require 'twitter' # 5.2.0
require 'twitter-text' # 1.7.0
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN"
config.access_token_secret = "YOUR_ACCESS_SECRET"
tweet = client.user_timeline('gem').first
# => RuntimeError: can't modify frozen String
This was working as expected in version 4.8.1, but I haven't tested any of the versions in between.
Nice catch. Sounds like a quickfix would be tweet.text.dup to unfreeze it first. Pull requests are appreciated, probably add dup as the first action of the method (and maybe other places). Otherwise I'll fix it as I go through my tasks.
I think that ought to do the trick.
can this be closed now?
Yep, fixed I believe.