parasew / instiki

a basic wiki clone so pretty and easy to set up, you’ll wonder if it’s really a wiki.
https://golem.ph.utexas.edu/wiki/instiki/show/HomePage
503 stars 111 forks source link

Running Instiki with Ruby 3.0 #79

Closed Shamaoke closed 3 years ago

Shamaoke commented 3 years ago

In order Instiki to be functional when running with Ruby 3.0 you will need:

  1. Add gem 'rexml' to Gemfile, because now it isn't a default gem;

  2. Add gem 'webrick' to Gemfile for the same reason as in #1;

  3. In script/server:119 change the following

- server.run(app, options.merge(:AccessLog => []))
+ server.run(app, **options.merge(:AccessLog => []))

since now the keyword method arguments work differently. See details.

That seems to be enough.

distler commented 3 years ago

Thanks!!

Ruby 3.0 was on my to-do list.

Have you verified that all the tests pass?

bundle exec rake test
Shamaoke commented 3 years ago

@distler

I've got two errors.

Failure: test_pages_by_revision(WebTest):
  <"EverBeenHated"> expected but was
  <"HomePage">.
test/unit/web_test.rb:12:in `test_pages_by_revision'
      9:
     10:   def test_pages_by_revision
     11:     add_sample_pages
  => 12:     assert_equal 'EverBeenHated', @web.select.by_revision.first.name
     13:   end
     14:
     15:   def test_pages_by_match

-------------------------------------------------------------------------------------------------------------------------------------------------------------
1235 tests, 2080 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
99.919% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Failure: test_dnsbl_filter_deny_action(WikiControllerTest):
  <403> expected but was
  <302>.
test/functional/wiki_controller_test.rb:809:in `test_dnsbl_filter_deny_action'
     806:     r = process 'save', 'web' => 'wiki1', 'id' => 'NewPage', 'content' => "Contents of a new page\r\n",
     807:       'author' => 'AuthorOfNewPage'
     808:
  => 809:     assert_equal 403, r.response_code
     810:     resp = [ %{<p>Access denied. Your IP address, 127.0.0.2, was found on one or more DNSBL blocking list(s).</p>\n},
     811:              %{<p>See <a href='http://www.spamcop.net/w3m?action=checkblock&amp;ip=127.0.0.2'>here</a> for more information.</p>\n},
     812:              %{<p>See <a href='http://www.spamhaus.org/query/bl?ip=127.0.0.2'>here</a> for more information.</p>\n}]

-------------------------------------------------------------------------------------------------------------------------------------------------------------
142 tests, 522 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
99.2958% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------
distler commented 3 years ago

The second is a transient failure, which I wouldn't worry about. The first bears investigation....

distler commented 3 years ago

With 8ef20e3, all tests seem to pass, both in Ruby 2.7 and Ruby 3.0. Thanks for doing the legwork on this.

Shamaoke commented 3 years ago

Ok. Thanks for your work maintaining the project.