Giter Site home page Giter Site logo

feedreader / pluto Goto Github PK

View Code? Open in Web Editor NEW
190.0 6.0 15.0 596 KB

pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds

License: Creative Commons Zero v1.0 Universal

Ruby 99.75% HTML 0.25%
pluto planet feed atom rss feedreader newsreader sqlite planetplanet blogs rss-aggregator rss-reader feed-reader feed-aggregator

pluto's Introduction

For documentation, see the Planet Pluto Guide »


pluto - planet feed reader and (static) website generator - auto-build web pages from published web feeds

Gem Family:

  • pluto - command line tool for planet (static) site generator - lets you build web pages from published web feeds
  • pluto-models - planet schema 'n' models for easy (re)use
  • pluto-update - planet feed 'n' subscription updater
  • pluto-feedfetcher - fetch web feeds (w/ conditional HTTP get e.g. use etags, if-modified-since etc.)
  • pluto-merge - planet site generator (that is, merge 'n' manage planet templates)
  • pluto-tasks - planet rake tasks (setup, update, stats, etc.)

Pluto Quick Starter Kit

(Auto-)build your own (static) planet news site from web feeds, see the /pluto.starter quick starter template repo.

More Planet Templates / Themes

For planet templates / themes, see the /planet-templates org. Packs include: blank, top, hacker, news, paper, digest, and more.

planet.rb Quick Starter Script - Use Your Static Website Compiler / Builder of Choice

(Auto-)add articles & blog posts to your (jekyll & friends) static website via feeds and planet pluto, see the /planet.rb template repo.

More

For web apps using the planet feed reader machinery, see the /plutolive org. Web apps include: pluto.admin, pluto.live.starter, pluto.live, and others.

License

The pluto scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Send them along to the wwwmake Forum/Mailing List. Thanks!

pluto's People

Contributors

carlschwan avatar geraldb avatar hellcp avatar jgigault avatar luke-biel avatar mgorny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pluto's Issues

cannot start pluto

$>ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
$
>pluto
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- active_record (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /var/lib/gems/1.9.1/gems/pluto-1.0.0/lib/pluto.rb:21:in <top (required)>' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /var/lib/gems/1.9.1/gems/pluto-1.0.0/bin/pluto:3:in<top (required)>'
from /usr/local/bin/pluto:23:in load' from /usr/local/bin/pluto:23:in

'

What is the problem, and how do I fix it?

[RFE] Export collected feeds as new atom/rss feed?

Hi, is there a way to export all collected feeds as a new, combined feed?

The reason for the request is: I am used to access planet pages (planet Fedora, planet Gnome, etc.) and subscribe to the available, combined feeds of these planets. I want to offer this on my planets as well.

Any chance of making this possible as an option or in the template?

*** error: undefined method `to_h' [breaking]

The core issue seems to be this to_h method:

*** error: undefined method `to_h' for #ActiveRecord::DatabaseConfigurations:0x000055bce7aa9098
Did you mean? to_s

We've been getting depreciation warnings for this method, and now the time is up.

Previously running Pluto with Ruby 2.6, and got this message.

Run gem install pluto && gem install nokogiri && gem install sanitize
ERROR: Error installing pluto:
The last version of activesupport (>= 0) to support your Ruby & RubyGems was 6.1.4.4. Try installing it with gem install activesupport -v 6.1.4.4 and then running the current command again
activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.9.207.

Ofc I tried to just install the other version of active support, or some different versions of ruby, on different machines.

I got it all to install under 2.6 with just the gentle depreciation warning, but that only worked once.. (but couldn't see any difference between the packages installed from working version to broken). maybe there is some hidden way to get back to the soft warning.

I understand you've been otherwise occupied, and its the holidays and all, so I'm certainly not expecting miracles... tho some quick fix would be super.

I have the next 2 weeks off from the newsletter, so I will have some time to hunt for a replacement, if necessary :-[.....

Net::OpenTimeout error when fetching the blog posts

here is my backtrace:

08:03:07  /usr/lib/ruby/2.5.0/net/protocol.rb:41:in `ssl_socket_connect': Net::OpenTimeout (Net::OpenTimeout)
08:03:07  	from /usr/lib/ruby/2.5.0/net/http.rb:985:in `connect'
08:03:07  	from /usr/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
08:03:07  	from /usr/lib/ruby/2.5.0/net/http.rb:909:in `start'
08:03:07  	from /usr/lib/ruby/2.5.0/net/http.rb:1458:in `request'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/fetcher-0.4.5/lib/fetcher/worker.rb:203:in `get_response'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/fetcher-0.4.5/lib/fetcher/worker.rb:56:in `get'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-feedfetcher-0.1.5/lib/pluto/feedfetcher/cond_get_with_cache.rb:34:in `fetch'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-update-1.6.3/lib/pluto/update/feed_refresher.rb:57:in `refresh_feed_worker'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-update-1.6.3/lib/pluto/update/feed_refresher.rb:49:in `block in refresh_feeds_for'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/relation/delegation.rb:85:in `each'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/relation/delegation.rb:85:in `each'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-update-1.6.3/lib/pluto/update/feed_refresher.rb:48:in `refresh_feeds_for'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/updater.rb:51:in `update_for'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/updater.rb:31:in `run'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/main.rb:232:in `block (3 levels) in <top (required)>'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/main.rb:208:in `each'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/main.rb:208:in `block (2 levels) in <top (required)>'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/gli-2.19.0/lib/gli/command_support.rb:131:in `execute'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/gli-2.19.0/lib/gli/app_support.rb:296:in `block in call_command'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/gli-2.19.0/lib/gli/app_support.rb:309:in `call_command'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/gli-2.19.0/lib/gli/app_support.rb:83:in `run'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto/cli/main.rb:390:in `<top (required)>'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/lib/pluto.rb:24:in `main'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/gems/pluto-1.3.4/bin/pluto:5:in `<top (required)>'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/bin/pluto:23:in `load'
08:03:07  	from /home/user/workspace/Website_planet-kde-org/vendor/ruby/2.5.0/bin/pluto:23:in `<main>'

HTTP/HTTPS redirect too deep when server uses cookies to authenticate connection

Hi!

I am running in a weird hedge case when connecting to a feed that uses a redirect+cookie to authenticate the connection.

Here is a script inspired by #33 that replicates the issue:

require 'fetcher'

url = 'https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education'

worker = Fetcher::Worker.new

response = worker.get( url )

puts response.code
puts response.message
puts response.content_type
puts response.body[0..100]

which results in

❯ ruby debug.rb
[debug] fetch - get(_response) src: https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education
[debug] using direct net http access; no proxy configured
[debug] GET /search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education uri=https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education, redirect_limit=5
[debug] 302 Found location=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education&client_id=springerlink&response_type=cookie
[debug] GET /authorize?redirect_uri=https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education&client_id=springerlink&response_type=cookie uri=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education&client_id=springerlink&response_type=cookie, redirect_limit=4
[debug] 302 Found location=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Ffacet-content-type%3DArticle&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d
[debug] GET /transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Ffacet-content-type%3DArticle&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d uri=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Ffacet-content-type%3DArticle&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d, redirect_limit=3
[debug] 302 Found location=https://link.springer.com/search.rss?facet-content-type=Article&error=cookies_not_supported&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d
[debug] GET /search.rss?facet-content-type=Article&error=cookies_not_supported&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d uri=https://link.springer.com/search.rss?facet-content-type=Article&error=cookies_not_supported&code=95d6f221-7e47-47eb-b2ff-eafd9a6bf63d, redirect_limit=2
[debug] 302 Found location=null?idp_error=cookies_not_supported
[debug] url relative; try to make it absolute
[debug] GET /null?idp_error=cookies_not_supported uri=https://link.springer.com/null?idp_error=cookies_not_supported, redirect_limit=1
[debug] 302 Found location=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie
[debug] GET /authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie uri=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie, redirect_limit=0
[debug] 302 Found location=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fnull%3Fidp_error%3Dcookies_not_supported&code=c2d1ee0e-a1a9-48a4-acd5-e6ff6cbce67c
Traceback (most recent call last):
	2: from debug.rb:7:in `<main>'
	1: from /Library/Ruby/Gems/2.6.0/gems/fetcher-0.4.5/lib/fetcher/worker.rb:56:in `get'
/Library/Ruby/Gems/2.6.0/gems/fetcher-0.4.5/lib/fetcher/worker.rb:166:in `get_response': HTTP redirect too deep (ArgumentError)

I can also replicate the infinite redirect using curl -L 'https://link.springer.com/search.rss?facet-content-type=Article&facet-journal-id=40753&channel-name=International+Journal+of+Research+in+Undergraduate+Mathematics+Education' on my machine.

At least in curl, explicitly setting the cookies for the connection with -b cookies.txt breaks the infinite redirect.

Is there a way to set the connection cookies in fetcher to allow for this remote authentication case?

Thank you!

Deprecation warning using ActiveRecord 5.2

When using ActiveRecord 5.2.x deprecation warnings are issued:

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "coalesce(items.updated,items.published,'1971-01-01') desc". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql(). (called from make_for at (erb):12)

Youtube feeds don't print in order

Trying to build a page for youtube feeds, but they don't print in chronological order:

This is with the same template that's running my other feeds that are coming out fine.

https://identosphere.net/blogcatcher/test/

image

I tried looking at the youtube feed, but nothing really jumps out at me why it shouldn't print correctly:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:yt="http://www.youtube.com/xml/schemas/2015" xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom">
 <link rel="self" href="http://www.youtube.com/feeds/videos.xml?channel_id=UCaMfVoHQzwX47XKUawWVCzg"/>
 <id>yt:channel:UCaMfVoHQzwX47XKUawWVCzg</id>
 <yt:channelId>UCaMfVoHQzwX47XKUawWVCzg</yt:channelId>
 <title>Bloom</title>
 <link rel="alternate" href="https://www.youtube.com/channel/UCaMfVoHQzwX47XKUawWVCzg"/>
 <author>
  <name>Bloom</name>
  <uri>https://www.youtube.com/channel/UCaMfVoHQzwX47XKUawWVCzg</uri>
 </author>
 <published>2017-10-11T19:32:16+00:00</published>
 <entry>
  <id>yt:video:yoGUqljxxro</id>
  <yt:videoId>yoGUqljxxro</yt:videoId>
  <yt:channelId>UCaMfVoHQzwX47XKUawWVCzg</yt:channelId>
  <title>Videoguide di Bloom 004 - Verifica la proprietà dei tuoi account di social network</title>
  <link rel="alternate" href="https://www.youtube.com/watch?v=yoGUqljxxro"/>
  <author>
   <name>Bloom</name>
   <uri>https://www.youtube.com/channel/UCaMfVoHQzwX47XKUawWVCzg</uri>
  </author>
  <published>2020-06-09T01:54:49+00:00</published>
  <updated>2020-08-25T20:28:49+00:00</updated>
  <media:group>
   <media:title>Videoguide di Bloom 004 - Verifica la proprietà dei tuoi account di social network</media:title>
   <media:content url="https://www.youtube.com/v/yoGUqljxxro?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
   <media:thumbnail url="https://i2.ytimg.com/vi/yoGUqljxxro/hqdefault.jpg" width="480" height="360"/>
   <media:description>In questa Guida Bloom daremo una rapida occhiata a come attestare i vostri account Facebook, Twitter, Google e LinkedIn. Questo aiuta a convalidare la vostra identità e vi fornisce ulteriori dati che possono essere condivisi in modo appropriato.

Visita https://bloom.co/identity per ulteriori informazioni su BloomID e invia un'email a [email protected] per eventuali domande.

Scarica l'applicazione mobile all'indirizzo https://go.onelink.me/9Fr3/198b98f3.

Ulteriori informazioni:

- Sito Web: https://bloom.co
- Blog: https://bloom.co/blog</media:description>
   <media:community>
    <media:starRating count="2" average="3.00" min="1" max="5"/>
    <media:statistics views="100"/>
   </media:community>
  </media:group>
 </entry>

Connection error is fatal (while 404 is not)

It seems that connection errors are treated more fatally than 404 errors:

$ ./bin/pluto b candrews.ini 
activerecord-utils/0.4.0 (activerecord/6.0.2) on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
activityutils/0.1.1 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
pluto/1.3.2 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
[info] db settings:
[info] {:adapter=>"sqlite3", :database=>"./candrews.db"}
-- create_table(:logs)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/sqlite3/schema_statements.rb:91: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:260: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:305: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:201: warning: The called method `primary_key' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:202: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:378: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:429: warning: The called method `new_column_definition' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:412: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_creation.rb:17: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1099: warning: The called method `type_to_sql' is defined here
   -> 0.0158s
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/internal_metadata.rb:41: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:227: warning: The called method `string' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:274: warning: The called method `transaction' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/persistence.rb:503: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/timestamp.rb:127: warning: The called method `create_or_update' is defined here
-- create_table(:props)
   -> 0.0108s
-- create_table(:activities)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0123s
-- create_table(:sites)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0114s
-- create_table(:subscriptions)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:424: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:120: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:142: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:786: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1172: warning: The called method `add_index_options' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1199: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1262: warning: The called method `quoted_columns_for_index' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1266: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1254: warning: The called method `add_options_for_index_columns' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1256: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1237: warning: The called method `add_index_sort_order' is defined here
   -> 0.0376s
-- create_table(:feeds)
   -> 0.0135s
-- create_table(:items)
   -> 0.0231s
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
[info] Updating feed subscription >candrews< - >https://candrews.integralblue.com/tag/gentoo/feed/atom<...
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation/delegation.rb:115: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:27: warning: The called method `initialize' is defined here
[info] found cache entry for >https://candrews.integralblue.com/tag/gentoo/feed/atom<

*** error: Failed to open TCP connection to candrews.integralblue.com:443 (Connection refused - connect(2) for "candrews.integralblue.com" port 443)

(it stops processing larger file here, while 404s are ignored)

The .ini file:

title = Planet Gentoo (test)

[candrews]
title = Craig Andrews
link = https://candrews.integralblue.com/
feed = https://candrews.integralblue.com/tag/gentoo/feed/atom

TypeError: no implicit conversion of String into Integer

Trying to build\run this app directly, rather than just installed gem.

  1. Fork repository.
  2. cd pluto/pluto-merge' (or pluto/pluto`)
  3. gem install hoe
  4. rake init --trace
rake aborted!
TypeError: no implicit conversion of String into Integer
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:528:in `[]'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:528:in `block in define_spec'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/specification.rb:2008:in `initialize'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:512:in `new'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:512:in `define_spec'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:815:in `post_initialize'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/hoe-3.22.1/lib/hoe.rb:394:in `spec'
/Users/infominer/jamstack/plutoplanet/pluto/pluto-merge/Rakefile:4:in `<top (required)>'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/infominer/.rbenv/versions/2.7.0/bin/rake:23:in `load'
/Users/infominer/.rbenv/versions/2.7.0/bin/rake:23:in `<main>'

I spent a lot of time digging around the code and trying different things, but didn't get very far.

Ultimately, I'm trying to require an additional dependency (nokogiri) to use in my template.. hopefully I'm at least pointed in the right general direction :)

Wrong/missing encoding of ampersands in atom/rss feeds

Hi,
I got an "XML Parsing Error: not well-formed" using the pluto-generated feeds available on http://blogs.openstreetmap.org/ because of a wrong re-encoding (or missing encoding) of the ampersand symbol within links/guids.

I don't know the details of that instance (version/release, environment, etc), but one of the developers suggested it should be a pluto issue.
Could you please check? Test case and details on gravitystorm/blogs.osm.org#28
(I checked past/closed issues about this but I couldn't find any)

Thanks.

Confusing fetched vs updated_at

In https://feedreader.github.io/#create-your-own-templates---template-reference, it says:

<TMPL_VAR date>                |  <%= site.fetched %>     # site (planet) last updated

While I am a Ruby novice, after a few hours I managed to get everything running locally and dove into the code a bit to figure out what Site.fetched does. It seems if I am understanding correctly that SiteFetcher has the feature to load an INI of feeds dynamically. Furthermore, it seems that IFF the below is true the fetched attribute will be updated:

  1. url is set in site config and points to a URL which contains text (being in INI format)
  2. rake update-sites from update.rake in pluto-rake is used

Additionally, I notice that in https://github.com/planet-templates/planet-blank/blob/master/blank.cards.html.erb#L39, updated_at is used instead of fetched.

Is it the correct use-case to use updated_at, and is my understanding of how this works correct? If so, I think the docs in the first link of this issue will need updated.

Thanks ahead of time.

Can't start pluto due to error with ActiveRecord::Migration

I am trying to run pluto from within CentOS with ruby 2.3 installed. However, an error occurs stating that directly inheriting from ActiveRecord:Migration is not allowed:

$ pluto --help
activerecord-utils/0.4.0 (activerecord/5.1.4) on Ruby 2.3.1 (2016-04-26) [x86_64-linux]
/opt/app-root/src/.gem/ruby/gems/activerecord-5.1.4/lib/active_record/migration.rb:525:in `inherited': Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: (StandardError)

  class ActivityDb::CreateDb < ActiveRecord::Migration[4.2]
	from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils/schema.rb:3:in `<module:ActivityDb>'
	from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils/schema.rb:1:in `<top (required)>'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils.rb:5:in `<top (required)>'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /opt/app-root/src/.gem/ruby/gems/pluto-models-1.4.0/lib/pluto/models.rb:29:in `<top (required)>'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/app-root/src/.gem/ruby/gems/pluto-1.2.3/lib/pluto.rb:3:in `<top (required)>'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/app-root/src/.gem/ruby/gems/pluto-1.2.3/bin/pluto:3:in `<top (required)>'
	from /opt/app-root/src/bin/pluto:23:in `load'
	from /opt/app-root/src/bin/pluto:23:in `<main>'

The version is 2.3, I installed the necessary gems by gem install pluto:

$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
bash-4.2$ gem list

*** LOCAL GEMS ***

activemodel (5.1.4)
activerecord (5.1.4)
activerecord-utils (0.4.0)
activesupport (5.1.4)
activityutils (0.1.0)
arel (8.0.0)
bigdecimal (1.2.8)
bundler (1.10.6)
concurrent-ruby (1.0.5)
did_you_mean (1.0.0)
feedfilter (1.1.1)
feedparser (2.1.0)
fetcher (0.4.5)
gli (2.16.1)
i18n (0.8.6)
iniparser (0.1.0)
io-console (0.4.5)
json (1.8.3)
liquid (4.0.0)
logutils (0.6.1)
logutils-activerecord (0.2.1)
minitest (5.10.3)
pakman (0.7.0)
pluto (1.2.3)
pluto-feedfetcher (0.1.0)
pluto-merge (1.1.0)
pluto-models (1.4.0)
pluto-tasks (1.5.3)
pluto-update (1.6.0)
preproc (0.1.0)
props (1.2.0)
props-activerecord (0.2.0)
psych (2.0.17)
rake (10.4.2)
rdoc (4.2.1)
rubyzip (1.2.1)
sqlite3 (1.3.13)
textutils (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.3)

I can recreate the issue every time. In fact, so far I was not able to get pluto running anywhere. The aim is to set up a container image for at least two planets I am responsible for.

pluto build creates a html page without actual feeds

I try to build a news web page, but somehow the generated html page does not contain actual feeds - though pluto fetches them.

What I did:

  • starting RHEL docker image with ruby 2.3
  • installing pluto with gem install pluto
  • pluto i news
  • pluto b ruby-news.ini -t news -o planet
    The output is:
$ pluto b ruby-news.ini -t news -o planet
activerecord-utils/0.4.0 (activerecord/5.1.4) on Ruby 2.3.1 (2016-04-26) [x86_64-linux]
activityutils/0.1.1 on Ruby 2.3.1 (2016-04-26) [x86_64-linux]
pluto/1.2.3 on Ruby 2.3.1 (2016-04-26) [x86_64-linux]
db settings:
{:adapter=>"sqlite3", :database=>"./ruby-news.db"}
dump >ruby-news.ini<:
{"title"=>"Planet Ruby News",
 "source"=>"https://raw.github.com/planetruby/planet/master/ruby-news.ini",
 "rubylang"=>
  {"title"=>"Ruby Lang News",
   "link"=>"http://www.ruby-lang.org/en/news",
   "feed"=>"http://www.ruby-lang.org/en/feeds/news.rss"},
 "jruby"=>
  {"title"=>"JRuby News",
   "link"=>"http://www.jruby.org",
   "feed"=>"http://www.jruby.org/atom.xml"}}
Updating feed subscription >rubylang< - >http://www.ruby-lang.org/en/feeds/news.rss<...
Updating feed subscription >jruby< - >http://www.jruby.org/atom.xml<...
[info] found cache entry for >http://www.ruby-lang.org/en/feeds/news.rss<
OK - fetching feed 'rubylang' - HTTP status 200 OK
http header - server: Cowboy - String
http header - etag: W/"d720d3b57a3f3a09f4d7fcf8c064d3d4" - String
http header - last-modified:  - NilClass
Before parsing feed >rubylang<...
** NEW | Ruby 2.5.0-preview1 Released
** NEW | CVE-2017-10784: Escape sequence injection vulnerability in the Basic authentication of WEBrick
** NEW | CVE-2017-0898: Buffer underrun vulnerability in Kernel.sprintf
** NEW | Ruby 2.3.5 Released
** NEW | Ruby 2.2.8 Released
** NEW | CVE-2017-14033: Buffer underrun vulnerability in OpenSSL ASN1 decode
** NEW | CVE-2017-14064: Heap exposure vulnerability in generating JSON
** NEW | Ruby 2.4.2 Released
** NEW | Multiple vulnerabilities in RubyGems
** NEW | Nominations now being accepted for Ruby Prize 2017
[info] found cache entry for >http://www.jruby.org/atom.xml<
OK - fetching feed 'jruby' - HTTP status 200 OK
http header - server: GitHub.com - String
http header - etag:  - NilClass
http header - last-modified: Wed, 06 Sep 2017 20:14:16 GMT - String
Before parsing feed >jruby<...
** NEW | JRuby 9.1.13.0 Released
** NEW | JRuby 9.1.12.0 Released
** NEW | JRuby 9.1.11.0 Released
** NEW | JRuby 9.1.10.0 Released
** NEW | JRuby 9.1.9.0 Released
** NEW | JRuby 1.7.27 Released
** NEW | JRuby 9.1.8.0 Released
** NEW | JRuby 9.1.7.0 Released
** NEW | JRuby 9.1.6.0 Released
** NEW | JRuby 9.1.5.0 Released
*** warn: no site with key 'ruby-news' found; using untitled site record
Merging template pack 'news'
  Loading template manifest /opt/app-root/src/.pluto/news/news.txt...
  Merging to ruby-news.news.html...
  Loading template (from file) >/opt/app-root/src/.pluto/news/news.html.erb<...
  Copying to css/news.css from /opt/app-root/src/.pluto/news/css/news.css...
  Copying to i/view-headlines.png from /opt/app-root/src/.pluto/news/i/view-headlines.png...
  Copying to i/view-snippets.png from /opt/app-root/src/.pluto/news/i/view-snippets.png...
  Copying to i/view-standard.png from /opt/app-root/src/.pluto/news/i/view-standard.png...
  Copying to js/jquery-2.0.3.min.js from /opt/app-root/src/.pluto/news/js/jquery-2.0.3.min.js...
  Copying to js/news.js from /opt/app-root/src/.pluto/news/js/news.js...
Done (in 0.007640118 s).
Done.

Thus everything seems to run fine. However, the html file itself seems to be empty besides the template data:

<!DOCTYPE html>
<html>
<head>
  <meta charset='utf-8'>
  <meta name='generator' content='Pluto 1.4.1 on Ruby 2.3.1 (2016-04-26) [x86_64-linux]'>

  <title>Planet Untitled</title>

  <link rel='stylesheet' type='text/css' href='css/news.css'>

  <!-- fix: use script_tag  rails-style ??? -->
  <script src='js/jquery-2.0.3.min.js'></script>
  <script src='js/news.js'></script>

  
  

</head>
<body>

<h1>Planet Untitled</h1>

<div class='stream' style='width: 800px;'>

<table>
 <tr>
  <td>
     <div style='width: 50px; max-width: 50px;'></div>
  </td>
  <td width='100%'>
   <!-- 2st column; filler column -->
  <img src='i/view-headlines.png' id='show-headlines'  title='Switch to headlines only view' width='16' height='16'>
  <img src='i/view-snippets.png'  id='show-snippets'   title='Switch to snippet view'        width='16' height='16'>
  <img src='i/view-standard.png'  id='show-fulltext'   title='Switch to full text view'      width='16' height='16'>
  </td>
  <td class='last-update' style='white-space: nowrap; text-align: right;'>
   <!-- 3nd column -->
    Updated
   
  </td>
 </tr>
</table>

<!--
  todo: order first by date and than by feed and than by datetime
    - lets us group all feed items of a feed group together
 -->

<!-- each item -->


<div class='header'>
<table width='100%'>
  <tr>
    <td>
       <div style='width: 50px; max-width: 50px;'></div>  
    </td>
    <td width='100%'>
       <hr class='item-separator'>
    </td>
  </tr>
</table>
</div>

</div> <!-- stream -->

</body>
</html>

I'm sure I am missing something simple here - but what?

DEPRECATION WARNING: to_h is deprecated and will be removed from Rails 7.0

I'm getting this notice in the log. Other than seeing it, there is no issue.

DEPRECATION WARNING: to_h is deprecated and will be removed from Rails 7.0 (You can use `ActiveRecord::Base.configurations.configs_for(env_name: 'env', name: 'primary').configuration_hash` to get the configuration hashes.) (called from load at /home/.../ruby/3.2.0/bin/pluto:25)

Missing feed items author

I see that at rubycocos/feedparser#3 this feature was implemented but when running pluto update planet.ini I get an empty author field in the database for each item.
I'm sure that most of the ATOM and RSS feeds contains the author name (which is visible in the current planet website). I'm using pluto 1.3.4 and feedparser 2.1.2.

Last update doesn't work

If I do a update via pluto b test, the database doesn't change the fetched entry, which is necessary for "Last Update" on the page:

sqlite> .headers on
sqlite> select * from sites;                                                                                                                                   
id|title|key|includes|excludes|url|fetched|http_code|http_etag|http_last_modified|http_server|created_at|updated_at
1|Test Planet|test|||||||||2014-08-08 19:02:42.958924|2014-08-08 19:02:42.958924

Building with blank template fails due to undefined method for ActiveRecord::AssociationRelation

I am trying to run pluto from within CentOS with ruby 2.3 installed. However, when building using the blank template an error occurs stating that there is an undefined method for ActiveRecord::AssociationRelation:

$ pluto b ruby-news.ini -t blank
[...]
OK - fetching feed 'jruby' - HTTP status 200 OK
no change; md5 digests match; skipping parsing feed
*** warn: no site with key 'ruby-news' found; using untitled site record
Merging template pack 'blank'
  Loading template manifest /opt/app-root/src/.pluto/blank/blank.txt...
  Merging to ruby-news.html...
  Loading template (from file) >/opt/app-root/src/.pluto/blank/blank.html.erb<...
  Merging to ruby-news.cards.html...
  Loading template (from file) >/opt/app-root/src/.pluto/blank/blank.cards.html.erb<...

*** error: undefined method `in_columns' for #<ActiveRecord::AssociationRelation []>

The config file is a shortened version of your example:

$ cat ruby-news.ini 
title  = Planet Ruby News
source = https://raw.github.com/planetruby/planet/master/ruby-news.ini

[rubylang]
  title = Ruby Lang News
  link  = http://www.ruby-lang.org/en/news
  feed  = http://www.ruby-lang.org/en/feeds/news.rss

[jruby]
  title = JRuby News
  link  = http://www.jruby.org
  feed  = http://www.jruby.org/atom.xml

If I take the news template, there are no problems.

$ pluto b ruby-news.ini -t news
[...]
Done.

build without feedcheck?

How do I build from the db without checking feeds, while tinkering with the templates?
(just assuming this is possible, but still working understand how the various parts of this project fit together)
-thx

handle / catch "HTTP redirect too deep" error / exception

This feed is updating and showing up on the planet... but I regularly get this error \ fail to build:

[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET
[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET
[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET
[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET
[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET
[info] found cache entry for >https://blog.bmannconsulting.com/feed.xml<
[info] adding header If-None-Match (etag) >"f192fa56e685ca02fed139e8fec11c4d-ssl-df"< for conditional GET

*** error: HTTP redirect too deep

##[error]Process completed with exit code 1.

error: SSL_connect

doesn't happen every time... but this is the second time it happened today. so I figured it was worth reporting here.

[info] found cache entry for >https://glia.net/the-blog?format=rss<
[info] adding header If-None-Match (etag) >W/"0fc4cbe2e2ab08cd539e871f3f48f9d2"< for conditional GET


*** error: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello

##[error]Process completed with exit code 1.

Support PubSub (XMPP)

Greetings!

In XMPP, using PubSub(1) (XEP-0060), it is possible to store posts as Atom Syndication(2) entries into XMPP(3).

There are several XMPP extensions that apply it, namely XEP-0227 (4) and XEP-0472 (5) which make node urn:xmpp:microblog:0 as a common choice to manage news for client accounts (e.g. [email protected]), yet a component account (e.g. pubsub.planetplanet.org) may use all of its nodes for this purpose.

pubsub.planetplanet.org/
|
|-- planet/
    |-- item 1 (Rebecca)
    |-- item 5 (Abe)
    |-- item 2 (Eve)
    |-- item 3 (Adam)
    `-- item 1 (Johnathan)
|-- Rebecca/
    `-- item 1
|-- Abe/
    |-- item 1
    |-- item 2
    |-- item 3
    |-- item 4
    `-- item 5
|-- Adam/
    |-- item 1
    |-- item 2
    `-- item 3
|-- Eve/
    |-- item 1
    `-- item 2
 `-- Johnathan/
    `-- item 1

A Ruby library that might be utilized would be XMPP4R.

I have made a script that realizes viewing PubSub node items as Atom XML feeds over HTTP.

XEP-0060: Publish-Subscribe
RFC 4287: The Atom Syndication Format
Atom Over XMPP
XEP-0277: Microblogging over XMPP
XEP-0472: Pubsub Social Feed
XMPP4R
PubSub Over HTTP

“no implicit conversion of FeedParser::Generator into String” error when there is new content

When pluto-update fetches new content it raises this error and abort:

*** error: no implicit conversion of FeedParser::Generator into String

It behaves this way:

Updating feed subscription >Unvanquished< - >https://unvanquished.net/activity/feed/Unvanquished<...
Updating feed subscription >UnvanquishedAssets< - >https://unvanquished.net/activity/feed/UnvanquishedAssets<...
Updating feed subscription >DaemonEngine< - >https://unvanquished.net/activity/feed/DaemonEngine<...
[info] found cache entry for >https://unvanquished.net/activity/feed/Unvanquished<
[info] adding header If-None-Match (etag) >"5ba7dd38-19015"< for conditional GET
[info] adding header If-Modified-Since (last-modified) >Sun, 23 Sep 2018 18:36:40 GMT< for conditional GET
OK - fetching feed 'Unvanquished' - HTTP status 200 OK
http header - server: nginx/1.6.2 - String
http header - etag: "5ba7dd94-18d4e" - String
http header - last-modified: Sun, 23 Sep 2018 18:38:12 GMT - String
Before parsing feed >Unvanquished<...
** NEW | illwieckz pushed to master in Unvanquished/pluto-devfeeds
UPDATE | illwieckz pushed to master in Unvanquished/pluto-devfeeds
UPDATE | illwieckz pushed to master in Unvanquished/pluto-devfeeds
UPDATE | illwieckz pushed to master in Unvanquished/pluto-devfeeds
UPDATE | slipher commented on pull request Unvanquished/updater2#21
UPDATE | DolceTriade commented on pull request Unvanquished/updater2#21
UPDATE | illwieckz commented on issue Unvanquished/Unvanquished#1085
UPDATE | illwieckz pushed to master in Unvanquished/pluto-devfeeds
UPDATE | Kangz commented on issue Unvanquished/Unvanquished#1086
UPDATE | madscientist159 opened an issue in Unvanquished/Unvanquished
UPDATE | illwieckz commented on issue Unvanquished/Unvanquished#1085
UPDATE | miramardesign commented on issue Unvanquished/Unvanquished#1085
UPDATE | illwieckz commented on issue Unvanquished/Unvanquished#1085
UPDATE | illwieckz commented on issue Unvanquished/Unvanquished#1085
UPDATE | miramardesign commented on issue Unvanquished/Unvanquished#1085
UPDATE | isuhao forked isuhao/breakpad-2 from Unvanquished/breakpad
UPDATE | DolceTriade pushed to master in Unvanquished/updater2
UPDATE | slipher closed an issue in Unvanquished/Unvanquished
UPDATE | slipher commented on issue Unvanquished/Unvanquished#613
UPDATE | slipher closed an issue in Unvanquished/Unvanquished
UPDATE | slipher commented on issue Unvanquished/Unvanquished#635
UPDATE | slipher commented on issue Unvanquished/Unvanquished#1085
UPDATE | miramardesign commented on issue Unvanquished/Unvanquished#1085
UPDATE | slipher commented on issue Unvanquished/Unvanquished#1085
UPDATE | miramardesign opened an issue in Unvanquished/Unvanquished
UPDATE | slipher opened a pull request in Unvanquished/updater2
UPDATE | slipher created a branch slipher/stuff in Unvanquished/updater2
UPDATE | slipher deleted branch slipher/stuff at Unvanquished/updater2
UPDATE | slipher pushed to master in Unvanquished/updater2
UPDATE | slipher merged a pull request in Unvanquished/updater2

*** error: no implicit conversion of FeedParser::Generator into String

I noticed that next time without new content it works so I call pluto update this way:

	bundle exec pluto update planet.ini \
	|| bundle exec pluto update planet.ini

'error: This is not well formed XML' is fatal

I'm sorry for reporting so many issues in one day but I suppose this might also be worth including in the upcoming release.

$ cat hex.ini 
title = Planet Gentoo (test)

[hexxeh]
title = Liam McLoughlin
link = http://hexxeh.net/?cat=5&feed=
feed = http://hexxeh.net/?cat=5&feed=rss2
$ ./bin/pluto b hex.ini 
activerecord-utils/0.4.0 (activerecord/6.0.2) on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
activityutils/0.1.1 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
pluto/1.3.2 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
[info] db settings:
[info] {:adapter=>"sqlite3", :database=>"./hex.db"}
-- create_table(:logs)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/sqlite3/schema_statements.rb:91: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:260: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:305: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:201: warning: The called method `primary_key' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:202: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:378: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:429: warning: The called method `new_column_definition' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:412: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_creation.rb:17: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1099: warning: The called method `type_to_sql' is defined here
   -> 0.0163s
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/internal_metadata.rb:41: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:227: warning: The called method `string' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:274: warning: The called method `transaction' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/persistence.rb:503: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/timestamp.rb:127: warning: The called method `create_or_update' is defined here
-- create_table(:props)
   -> 0.0112s
-- create_table(:activities)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0127s
-- create_table(:sites)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0117s
-- create_table(:subscriptions)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:424: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:120: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:142: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:786: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1172: warning: The called method `add_index_options' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1199: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1262: warning: The called method `quoted_columns_for_index' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1266: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1254: warning: The called method `add_options_for_index_columns' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1256: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1237: warning: The called method `add_index_sort_order' is defined here
   -> 0.0347s
-- create_table(:feeds)
   -> 0.0149s
-- create_table(:items)
   -> 0.0244s
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
[info] Updating feed subscription >hexxeh< - >http://hexxeh.net/?cat=5&feed=rss2<...
[info] Updating feed subscription >zx2c4< - >http://blog.zx2c4.com/planetgentoo<...
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation/delegation.rb:115: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:27: warning: The called method `initialize' is defined here
[info] found cache entry for >http://hexxeh.net/?cat=5&feed=rss2<
[info] OK - fetching feed 'hexxeh' - HTTP status 200 OK
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/attribute_methods/dirty.rb:102: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_mutation_tracker.rb:45: warning: The called method `changed?' is defined here
[info] Before parsing feed >hexxeh<...

*** error: This is not well formed XML
Invalid attribute name: <;r++)console.log("actionQueue",c(t[r]))}function n(){clearTimeout(w);for(var e,t=0;e=h[t];t++)document["on"+e]=null}function a(e){if(!e.target)return!1;var t=e.target,r=(t.tagName||"").toLowerCase();if(e.metaKey)return!1;if(e.shiftKey&&"a"==r)return!1;if(t.hostname&&!t.hostname.match(g))return!1;if(e.type.match(p)&&s(t))return!1;if("label"==r){var n=t.getAttribute("for");if(n){var a=document.getElementById(n);if(a&&f(a))return!1}else for(var i,o=0;i=t.childNodes[o];o++)if(f(i))return!1}return!0}function i(e,t){t.bucket=e,b[e].push(t)}function o(e){var t={};for(var r in e)t[r]=e[r];return t}function u(e){for(;e&&e!=document.body;){if("A"==e.tagName)return e;e=e.parentNode}}function c(e){var t=[];e.bucket&&t.push("["+e.bucket+"]"),t.push(e.type);var r,n,a=e.target,i=u(a),o="",c=e.timestamp&&e.timestamp-d;return"click"===e.type&&i?(r=i.className.trim().replace(/\s+/g,"."),n=i.id.trim(),o=/[^#]$/.test(i.href)?" ("+i.href+")":"",a='"'+i.innerText.replace(/\n+/g," ").trim()+'"'):(r=a.className.trim().replace(/\s+/g,"."),n=a.id.trim(),a=a.tagName.toLowerCase(),e.keyCode&&(a=String.fromCharCode(e.keyCode)+" : "+a)),t.push(a+o+(n&&"#"+n)+(!n&&r?"."+r:"")),c&&t.push(c),t.join(" ")}function f(e){var t=(e.tagName||"").toLowerCase();return"input"==t&&"checkbox"==e.getAttribute("type")}function s(e){var t=(e.tagName||"").toLowerCase();return"textarea"==t||"input"==t&&"text"==e.getAttribute("type")||"true"==e.getAttribute("contenteditable")}for(var m,d=(new Date).getTime(),l=1e4,g=/^([^\.]+\.)*twitter\.com$/,p=/^key/,h=["click","keydown","keypress","keyup"],v=[],w=null,y=!0,b={captured:[],ignored:[],direct:[],all:[]},k=0;m=h[k];k++)document["on"+m]=e;w=setTimeout(function(){y=!1},l),window.swiftActionQueue={buckets:b,flush:t,logActions:r,wasFlushed:!1}}();
  </script>
Line: 25
Position: 3359
Last 80 unconsumed characters:

Here the issue is that the URL is outdated and redirects into non-feed that's not valid XML. While here it's our fault for not cleaning up old entries, I think normally this can happen when someone changes the blog without telling us to update the URL and I think it'd be better to handle it gracefully as well.

The -q/--quiet option doesn't seem to work

According to the CLI help:

    -q, --quiet       - Only show warnings, errors and fatal messages

but as far as I can see it makes no difference, and indeed the command argument handling doesn't even seem to look for that flag?

Relative links not rendering correctly

I've forked a copy of the OpenStreetmap pluto project (https://github.com/WorcSource/blogs.worcestersource.club), but I'm having trouble with one of the feeds.

The issue is none of the relative link to images or other pages within the post are pointing to the originating blog, and instead are pointing locally, as you can see here: https://nostalgic-dubinsky-598971.netlify.com/ (note the "I made a box" post).

The feed in question is here: https://maker.limeblast.co.uk/feed.xml and works perfectly fine on a Planet Venus site that uses it (https://planet.birmingham.io/) , but not on the pluto site I'm trying to use.

The feed itself is generated Jekyll Feed, the devs of which suggest is working as intended because they use an xml:base element (jekyll/jekyll-feed#260)

I'm hoping you can help me resolve this issue. Thank you.

comparison of NilClass with Time failed (only fails with other blogs)

this is a fun one

This feed http://dustycloud.org/blog/index.xml produces this error
*** error: comparison of NilClass with Time failed

but only fails when I run it together with all of the other feeds... run on its own with no other blogs in the .ini file, works fine.

This is the obnoxiously long debug log:
https://github.com/Identosphere/identity-blogcatcher/raw/master/weirdbug.txt
This is the site that causes fail not failing on its own.
https://raw.githubusercontent.com/Identosphere/identity-blogcatcher/master/weirdnotbug.txt

not sure what I'm expecting here, but I spent so much time chasing this down, I couldn't not report

Feeds requiring cookie support

Hello,

Thanks for pluto, we moved the neuroscience planets over from venus a few days ago:

https://github.com/neurofedora/planet-neuroscience
https://github.com/neurofedora/planet-neuroscientists

For the neuroscience planet, which collects feeds from research journals, we're seeing errors which seem to be related to cookies:

[debug] fetch - get(_response) src: https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827
[debug] using direct net http access; no proxy configured
[debug] GET /search.rss?search-within=Journal&facet-journal-id=10827 uri=https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827, redirect_limit=5
[info] found cache entry for >https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827<
[debug] 302 Found location=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827&client_id=springerlink&response_type=cookie
[debug] GET /authorize?redirect_uri=https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827&client_id=springerlink&response_type=cookie uri=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827&client_id=springerlink&response_type=cookie, redirect_limit=4
[debug] 302 Found location=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Fsearch-within%3DJournal&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf
[debug] GET /transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Fsearch-within%3DJournal&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf uri=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fsearch.rss%3Fsearch-within%3DJournal&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf, redirect_limit=3
[debug] 302 Found location=https://link.springer.com/search.rss?search-within=Journal&error=cookies_not_supported&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf
[debug] GET /search.rss?search-within=Journal&error=cookies_not_supported&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf uri=https://link.springer.com/search.rss?search-within=Journal&error=cookies_not_supported&code=5a9cf68b-e1ee-417a-8ca8-c6c202202caf, redirect_limit=2
[debug] 302 Found location=null?idp_error=cookies_not_supported
[debug] url relative; try to make it absolute
[debug] GET /null?idp_error=cookies_not_supported uri=https://link.springer.com/null?idp_error=cookies_not_supported, redirect_limit=1
[debug] 302 Found location=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie
[debug] GET /authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie uri=https://idp.springer.com/authorize?redirect_uri=https://link.springer.com/null?idp_error=cookies_not_supported&client_id=springerlink&response_type=cookie, redirect_limit=0
[debug] 302 Found location=https://idp.springer.com/transit?redirect_uri=https%3A%2F%2Flink.springer.com%2Fnull%3Fidp_error%3Dcookies_not_supported&code=e99fb052-66cc-4e41-ba89-9072db17e558

*** error: HTTP redirect too deep

/home/asinha/.local/share/gem/ruby/gems/fetcher-0.4.5/lib/fetcher/worker.rb:166:in `get_response': HTTP redirect too deep (ArgumentError)
        from /home/asinha/.local/share/gem/ruby/gems/fetcher-0.4.5/lib/fetcher/worker.rb:56:in `get'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-feedfetcher-0.1.6/lib/pluto/feedfetcher/cond_get_with_cache.rb:34:in `fetch'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-update-1.6.4/lib/pluto/update/feed_refresher.rb:57:in `refresh_feed_worker'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-update-1.6.4/lib/pluto/update/feed_refresher.rb:49:in `block in refresh_feeds_for'
        from /home/asinha/.local/share/gem/ruby/gems/activerecord-6.1.4/lib/active_record/relation/delegation.rb:88:in `each'
        from /home/asinha/.local/share/gem/ruby/gems/activerecord-6.1.4/lib/active_record/relation/delegation.rb:88:in `each'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-update-1.6.4/lib/pluto/update/feed_refresher.rb:48:in `refresh_feeds_for'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/updater.rb:51:in `update_for'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/updater.rb:31:in `run'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/main.rb:289:in `block (3 levels) in <top (required)>'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/main.rb:270:in `each'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/main.rb:270:in `block (2 levels) in <top (required)>'
        from /home/asinha/.local/share/gem/ruby/gems/gli-2.20.1/lib/gli/command_support.rb:131:in `execute'
        from /home/asinha/.local/share/gem/ruby/gems/gli-2.20.1/lib/gli/app_support.rb:296:in `block in call_command'
        from /home/asinha/.local/share/gem/ruby/gems/gli-2.20.1/lib/gli/app_support.rb:309:in `call_command'
        from /home/asinha/.local/share/gem/ruby/gems/gli-2.20.1/lib/gli/app_support.rb:83:in `run'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto/cli/main.rb:390:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/asinha/.local/share/gem/ruby/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
        from /home/asinha/.local/share/gem/ruby/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
        from /home/asinha/.local/share/gem/ruby/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/lib/pluto.rb:24:in `main'
        from /home/asinha/.local/share/gem/ruby/gems/pluto-1.3.4/bin/pluto:5:in `<top (required)>'
        from /home/asinha/bin/pluto:23:in `load'
        from /home/asinha/bin/pluto:23:in `<main>'

https://link.springer.com/search.rss?search-within=Journal&facet-journal-id=10827 works fine in a browser, but not on pluto---and it looks like they keep redirecting which causes pluto to error out eventually.

Is there a way to use these feeds with pluto?

support for single use feedreading (with or without ini)

Sometimes I want to print one or two feeds onto a single page so I can review them\for research.

I made a "try.ini" to re-use for these cases, but realizing I need to add a line to my makefile so it deletes the existing database before running the feed, otherwise I get posts from previous runs mixed in.

Wondering if you'd consider enabling that by commandline, something like:

pluto b "https://identosphere.substack.com/feed/, https://decentralized-id.com/feed.xml" -t planetid -o try/

or perhaps:

pluto b try.ini -single -t planetid -o try/

*** error: bad URI(is not URI?)

[info] Merging template pack 'companies'
[info]   Loading template manifest companies/companies.txt...
[info]   Merging to index.html...
[info]   Loading template (from file) >companies/index.html.erb<...

*** error: bad URI(is not URI?): "/images/news/MyData 2021 Awardees News.jpg"

This appears to be an issue with naked spaces in the uri, rather than %20

The challenge here is discovering which feed the error came from.
I did figure out through some tribulation that the troubled image name came from this feed: https://personium.io/blog/feed.xml

Assuming it is a problem with space in the image file-name then ideally the app would translate those to %20 automatically...

Ideally, it would also let me know which feed the bad uri came from.

Thanks for everything.

Issue with rexml/Document

uname -a: Linux LaptopLB 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

>> pluto u planet.ini 
Traceback (most recent call last):
	24: from /home/luke-biel/.rvm/gems/ruby-2.5.5/bin/ruby_executable_hooks:24:in `<main>'
	23: from /home/luke-biel/.rvm/gems/ruby-2.5.5/bin/ruby_executable_hooks:24:in `eval'
	22: from /home/luke-biel/.rvm/gems/ruby-2.5.5/bin/pluto:23:in `<main>'
	21: from /home/luke-biel/.rvm/gems/ruby-2.5.5/bin/pluto:23:in `load'
	20: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/pluto-1.3.4/bin/pluto:3:in `<top (required)>'
	19: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	18: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	17: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/pluto-1.3.4/lib/pluto.rb:4:in `<top (required)>'
	16: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
	15: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
	14: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
	13: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	12: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	11: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/pluto-update-1.6.4/lib/pluto/update.rb:3:in `<top (required)>'
	10: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
	 9: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
	 8: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
	 7: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 6: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 5: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/opmlparser-1.0.0/lib/opmlparser.rb:4:in `<top (required)>'
	 4: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
	 3: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
	 2: from /home/luke-biel/.rvm/gems/ruby-2.5.5/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
	 1: from /home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/home/luke-biel/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rexml/Document (LoadError)

This happens for me on my 2 development linux machines, Manually changing rexml/Document to lowercase in opmlparser solves the issue,

I haven't seen anyone else complaints about it, so I'd prefer to get feedback before opening PR. Maybe it's a setup issue?

*** error: undefined method `published' for nil:NilClass | when publishing empty feed

I'm testing pluto as a replacement for venus for Gentoo Planet, and I've hit the following error, apparently due to one of our feeds having no posts:

$ ./bin/pluto b gokturk.ini 
activerecord-utils/0.4.0 (activerecord/6.0.2) on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
activityutils/0.1.1 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
pluto/1.3.2 on Ruby 2.7.0 (2019-12-25) [x86_64-linux]
[info] db settings:
[info] {:adapter=>"sqlite3", :database=>"./gokturk.db"}
-- create_table(:logs)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/sqlite3/schema_statements.rb:91: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:260: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:305: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:201: warning: The called method `primary_key' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:202: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:378: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:429: warning: The called method `new_column_definition' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:412: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_creation.rb:17: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1099: warning: The called method `type_to_sql' is defined here
   -> 0.0118s
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/internal_metadata.rb:41: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:227: warning: The called method `string' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:274: warning: The called method `transaction' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/persistence.rb:503: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/timestamp.rb:127: warning: The called method `create_or_update' is defined here
-- create_table(:props)
   -> 0.0101s
-- create_table(:activities)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0100s
-- create_table(:sites)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:229: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
   -> 0.0123s
-- create_table(:subscriptions)
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:424: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:120: warning: The called method `initialize' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:142: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:363: warning: The called method `column' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:786: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1172: warning: The called method `add_index_options' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1199: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1262: warning: The called method `quoted_columns_for_index' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1266: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1254: warning: The called method `add_options_for_index_columns' is defined here
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1256: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1237: warning: The called method `add_index_sort_order' is defined here
   -> 0.0326s
-- create_table(:feeds)
   -> 0.0112s
-- create_table(:items)
   -> 0.0206s
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
[info] Updating feed subscription >gokturk< - >https://blogs.gentoo.org/gokturk/category/gentoo/feed/<...
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation/delegation.rb:115: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:27: warning: The called method `initialize' is defined here
[info] found cache entry for >https://blogs.gentoo.org/gokturk/category/gentoo/feed/<
[info] OK - fetching feed 'gokturk' - HTTP status 200 OK
/home/mgorny/.gem/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/attribute_methods/dirty.rb:102: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/mgorny/.gem/ruby/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_mutation_tracker.rb:45: warning: The called method `changed?' is defined here
[info] Before parsing feed >gokturk<...

*** error: undefined method `published' for nil:NilClass

The relevant gokturk.ini file has:

title = Planet Gentoo (test)

[gokturk]
title = Göktürk Yüksek
link = https://blogs.gentoo.org/gokturk/
feed = https://blogs.gentoo.org/gokturk/category/gentoo/feed/

I've installed fresh version of pluto via bundler.

suggest to use a different example rather then format method

the original demo code in README is:

The Date#format Method
class Date
  def format( spec ) self.strftime( spec.to_strftime ); end
end
The new Date#format method formats the date like the passed in example:

date = Date.today   ## test run on 2020-02-09

p date.format( 'January 02, 2006' )         #=> "February 09, 2020"

but the 'format' method is a built in stdlib private istance method of Date:

↪  irb                                                                                                                                                Fri Feb 21 12:03:54 CST 2020
irb 0.9.6(09/06/30) for ruby-2.5.1 [ x86_64-darwin16 ]
using config {:auto_completion=>"on", :auto_indent=>"on", :prompt_mode=>:DEFAULT, :use_bond=>"off"}, type "conf" to display configuration, type "exit" to quit current session
current context: main(Object)#70113110176120
irb(main):001:0> require 'date'
=> true
irb(main):002:0> date = Date.today
=> #<Date: 2020-02-21 ((2458901j,0s,0n),+0s,2299161j)>
irb(main):003:0> date.format
Traceback (most recent call last):
        2: from /Users/rain/.rvm/rubies/ruby-2.5.1/bin/irb:11:in `<main>'
        1: from (irb):3
NoMethodError (private method `format' called for #<Date: 2020-02-21 ((2458901j,0s,0n),+0s,2299161j)>)
irb(main):004:0>

It's not a good idea to override the stdlib method.

Suggest to use a new method such as "format_as":

class Date
  def format_as( spec ) self.strftime( spec.to_strftime ); end
end

date = Date.today   ## test run on 2020-02-09

p date.format_as( 'January 02, 2006' )         #=> "February 09, 2020"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.