Skip to content

Commit

Permalink
Modernize gem.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 7, 2024
1 parent f44aef1 commit 769c298
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 36 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nio4r
name: Test

on: [push, pull_request]

Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/.bundle/
/pkg/
/gems.locked
/.covered.db
/external

*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Gregory Longtin <Greg.mpls@gmail.com> <MSP-Greg@users.noreply.github.com>
Elad Eyal <elad.eyal@intel.com>
Boaz Segev <bo@bowild.com>
Tao Luo <luotao.ruby@gmail.com>
Jean Boussier <jean.boussier+github@shopify.com>
4 changes: 3 additions & 1 deletion Gemfile → gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
group :maintenance, optional: true do
gem "bake"
gem "bake-gem"
# gem "bake-modernize"
gem "bake-modernize"

gem "rake"
end

group :development, :test do
Expand Down
2 changes: 1 addition & 1 deletion lib/nio/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Released under the MIT License.
# Copyright, 2011-2018, by Tony Arcieri.
# Copyright, 2018-2023, by Samuel Williams.
# Copyright, 2018-2024, by Samuel Williams.
# Copyright, 2023, by Tsimnuj Hawj.

module NIO
Expand Down
2 changes: 2 additions & 0 deletions lib/nio4r.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2023, by Phillip Aldridge.
# Copyright, 2023, by Samuel Williams.
Expand Down
7 changes: 5 additions & 2 deletions license.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Copyright, 2017, by Usaku Nakamura.
Copyright, 2017-2022, by Gregory Longtin.
Copyright, 2017, by Lars Kanis.
Copyright, 2017, by Tomoya Ishida.
Copyright, 2018-2023, by Samuel Williams.
Copyright, 2018-2024, by Samuel Williams.
Copyright, 2019, by Cédric Boutillier.
Copyright, 2019-2020, by Benoit Daloze.
Copyright, 2019, by Jesús Burgos Maciá.
Expand All @@ -45,9 +45,12 @@ Copyright, 2020-2021, by Joao Fernandes.
Copyright, 2021, by Jun Jiang.
Copyright, 2021, by Pavel Lobashov.
Copyright, 2021, by Jeffrey Martin.
Copyright, 2023, by Pavel Rosický.
Copyright, 2023-2024, by Pavel Rosický.
Copyright, 2023, by Tsimnuj Hawj.
Copyright, 2023, by Phillip Aldridge.
Copyright, 2023, by Maxime Demolin.
Copyright, 2023-2024, by Vít Ondruch.
Copyright, 2023, by Jean Boussier.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 23 additions & 26 deletions nio4r.gemspec
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# frozen_string_literal: true

require File.expand_path("lib/nio/version", __dir__)
require_relative "lib/nio/version"

Gem::Specification.new do |spec|
spec.authors = ["Tony Arcieri"]
spec.email = ["bascule@gmail.com"]
spec.homepage = "https://github.com/socketry/nio4r"
spec.licenses = ["MIT", "BSD-2-Clause"]
spec.summary = "New IO for Ruby"
spec.description = <<-DESCRIPTION.strip.gsub(/\s+/, " ")
Cross-platform asynchronous I/O primitives for scalable network clients
and servers. Inspired by the Java NIO API, but simplified for ease-of-use.
DESCRIPTION

spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
spec.files = `git ls-files`.split("\n")
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
spec.name = "nio4r"
spec.require_paths = ["lib"]
spec.version = NIO::VERSION
spec.name = "nio4r"
spec.version = NIO::VERSION

spec.summary = "New IO for Ruby"
spec.authors = ["Tony Arcieri", "Samuel Williams", "Olle Jonsson", "Gregory Longtin", "Tiago Cardoso", "Joao Fernandes", "Thomas Dziedzic", "Boaz Segev", "Logan Bowers", "Pedro Paiva", "Jun Aruga", "Omer Katz", "Upekshe Jayasekera", "Tim Carey-Smith", "Benoit Daloze", "Sergey Avseyev", "Tomoya Ishida", "Usaku Nakamura", "Cédric Boutillier", "Daniel Berger", "Dirkjan Bussink", "Hiroshi Shibata", "Jesús Burgos Maciá", "Luis Lavena", "Pavel Rosický", "Sadayuki Furuhashi", "Stephen von Takach", "Vladimir Kochnev", "Vít Ondruch", "Anatol Pomozov", "Bernd Ahlers", "Charles Oliver Nutter", "Denis Washington", "Elad Eyal", "Jean byroot Boussier", "Jeffrey Martin", "John Thornton", "Jun Jiang", "Lars Kanis", "Marek Kowalcze", "Maxime Demolin", "Orien Madgwick", "Pavel Lobashov", "Per Lundberg", "Phillip Aldridge", "Ravil Bayramgalin", "Shannon Skipper", "Tao Luo", "Thomas Kuntz", "Tsimnuj Hawj", "Zhang Kang"]
spec.licenses = ["MIT", "BSD-2-Clause"]

spec.cert_chain = ['release.cert']
spec.signing_key = File.expand_path('~/.gem/release.pem')

spec.homepage = "https://github.com/socketry/nio4r"

spec.metadata = {
"bug_tracker_uri" => "https://github.com/socketry/nio4r/issues",
"changelog_uri" => "https://github.com/socketry/nio4r/blob/main/changes.md",
"documentation_uri" => "https://www.rubydoc.info/gems/nio4r/#{spec.version}",
"source_code_uri" => "https://github.com/socketry/nio4r/tree/v#{spec.version}",
"wiki_uri" => "https://github.com/socketry/nio4r/wiki",
"funding_uri" => "https://github.com/sponsors/ioquatix/",
"bug_tracker_uri" => "https://github.com/socketry/nio4r/issues",
"changelog_uri" => "https://github.com/socketry/nio4r/blob/main/changes.md",
"documentation_uri" => "https://www.rubydoc.info/gems/nio4r",
"funding_uri" => "https://github.com/sponsors/ioquatix/",
"source_code_uri" => "https://github.com/socketry/nio4r.git",
"wiki_uri" => "https://github.com/socketry/nio4r/wiki",
}

spec.files = Dir.glob(['{ext,lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)
spec.require_paths = ['lib']

spec.extensions = ["ext/nio4r/extconf.rb"]

This comment has been minimized.

Copy link
@chadlwilson

chadlwilson May 7, 2024

Hello @ioquatix - This seems to cause spec.extensions to be there even on JRuby, which seems to cause an install failure in my case.

Previously spec.extensions seemed to only be set if JRUBY_VERSION was unset - this line seems to be still there at 769c298#diff-dd153b45826144f6cdd0f0cf500f1a68ab8b1e55991b671fd4e483c4d907f026R38

Was this additional line intentional to be there for JRuby now?

This comment has been minimized.

Copy link
@chadlwilson

chadlwilson May 7, 2024

Fetching nio4r 2.7.2 (java)
Installing nio4r 2.7.2 (java) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/go/pipelines/build-linux/server/src/main/webapp/WEB-INF/rails/gems/jruby/3.1.0/gems/nio4r-2.7.2-java/ext/nio4r
/go/pipelines/build-linux/server/scripts/jruby -I
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib extconf.rb
checking for unistd.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

This comment has been minimized.

Copy link
@chadlwilson

chadlwilson May 7, 2024

Sorry, I now see raised at #315 will link there.


spec.required_ruby_version = ">= 2.4"

if defined? JRUBY_VERSION
Expand All @@ -37,7 +37,4 @@ Gem::Specification.new do |spec|
else
spec.extensions = ["ext/nio4r/extconf.rb"]
end

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
end
5 changes: 1 addition & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# ![nio4r](https://raw.github.com/socketry/nio4r/master/logo.png)

[![Gem Version](https://badge.fury.io/rb/nio4r.svg)](http://rubygems.org/gems/nio4r)
[![Build Status](https://github.com/socketry/nio4r/workflows/nio4r/badge.svg?branch=master&event=push)](https://github.com/socketry/nio4r/actions?query=workflow:nio4r)
[![Code Climate](https://codeclimate.com/github/socketry/nio4r.svg)](https://codeclimate.com/github/socketry/nio4r)
[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/nio4r/2.2.0)
[![Development Status](https://github.com/socketry/nio4r/workflows/Test/badge.svg)](https://github.com/socketry/nio4r/actions?workflow=Test)

**New I/O for Ruby (nio4r)**: cross-platform asynchronous I/O primitives for
scalable network clients and servers. Modeled after the Java NIO API, but
Expand Down
28 changes: 28 additions & 0 deletions release.cert
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8i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